summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2018-01-05 16:38:17 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2018-01-05 16:38:17 +0000
commit8bbad8486a72bd6436ca7236fc8e3ef00fead139 (patch)
tree8ed086a1effd409635d93a2dc38ed92b2c33935c
parentbc972b3e4f61de660e2693f3c3f7bd2a98bf780c (diff)
downloadgcc-8bbad8486a72bd6436ca7236fc8e3ef00fead139.tar.gz
PR target/83604
* config/i386/sse.md (VI248_VLBW): Rename to ... (VI248_AVX512VL): ... this. Don't guard V32HI with TARGET_AVX512BW. (vpshrd_<mode><mask_name>, vpshld_<mode><mask_name>, vpshrdv_<mode>, vpshrdv_<mode>_mask, vpshrdv_<mode>_maskz, vpshrdv_<mode>_maskz_1, vpshldv_<mode>, vpshldv_<mode>_mask, vpshldv_<mode>_maskz, vpshldv_<mode>_maskz_1): Use VI248_AVX512VL mode iterator instead of VI248_VLBW. * gcc.target/i386/pr83604.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256280 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/i386/sse.md108
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/i386/pr83604.c11
4 files changed, 81 insertions, 54 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3e48f38d073..e1042b89ddd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2018-01-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/83604
+ * config/i386/sse.md (VI248_VLBW): Rename to ...
+ (VI248_AVX512VL): ... this. Don't guard V32HI with TARGET_AVX512BW.
+ (vpshrd_<mode><mask_name>, vpshld_<mode><mask_name>,
+ vpshrdv_<mode>, vpshrdv_<mode>_mask, vpshrdv_<mode>_maskz,
+ vpshrdv_<mode>_maskz_1, vpshldv_<mode>, vpshldv_<mode>_mask,
+ vpshldv_<mode>_maskz, vpshldv_<mode>_maskz_1): Use VI248_AVX512VL
+ mode iterator instead of VI248_VLBW.
+
2018-01-05 Jan Hubicka <hubicka@ucw.cz>
* ipa-fnsummary.c (record_modified_bb_info): Add OP.
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index b0ba91e6b84..0030a008e12 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -448,8 +448,8 @@
(define_mode_iterator VI2_AVX2_AVX512BW
[(V32HI "TARGET_AVX512BW") (V16HI "TARGET_AVX2") V8HI])
-(define_mode_iterator VI248_VLBW
- [(V32HI "TARGET_AVX512BW") V16SI V8DI
+(define_mode_iterator VI248_AVX512VL
+ [V32HI V16SI V8DI
(V16HI "TARGET_AVX512VL") (V8SI "TARGET_AVX512VL")
(V4DI "TARGET_AVX512VL") (V8HI "TARGET_AVX512VL")
(V4SI "TARGET_AVX512VL") (V2DI "TARGET_AVX512VL")])
@@ -20116,10 +20116,10 @@
(set_attr "mode" "<sseinsnmode>")])
(define_insn "vpshrd_<mode><mask_name>"
- [(set (match_operand:VI248_VLBW 0 "register_operand" "=v")
- (unspec:VI248_VLBW
- [(match_operand:VI248_VLBW 1 "register_operand" "v")
- (match_operand:VI248_VLBW 2 "nonimmediate_operand" "vm")
+ [(set (match_operand:VI248_AVX512VL 0 "register_operand" "=v")
+ (unspec:VI248_AVX512VL
+ [(match_operand:VI248_AVX512VL 1 "register_operand" "v")
+ (match_operand:VI248_AVX512VL 2 "nonimmediate_operand" "vm")
(match_operand:SI 3 "const_0_to_255_operand" "n")]
UNSPEC_VPSHRD))]
"TARGET_AVX512VBMI2"
@@ -20127,10 +20127,10 @@
[(set_attr ("prefix") ("evex"))])
(define_insn "vpshld_<mode><mask_name>"
- [(set (match_operand:VI248_VLBW 0 "register_operand" "=v")
- (unspec:VI248_VLBW
- [(match_operand:VI248_VLBW 1 "register_operand" "v")
- (match_operand:VI248_VLBW 2 "nonimmediate_operand" "vm")
+ [(set (match_operand:VI248_AVX512VL 0 "register_operand" "=v")
+ (unspec:VI248_AVX512VL
+ [(match_operand:VI248_AVX512VL 1 "register_operand" "v")
+ (match_operand:VI248_AVX512VL 2 "nonimmediate_operand" "vm")
(match_operand:SI 3 "const_0_to_255_operand" "n")]
UNSPEC_VPSHLD))]
"TARGET_AVX512VBMI2"
@@ -20138,11 +20138,11 @@
[(set_attr ("prefix") ("evex"))])
(define_insn "vpshrdv_<mode>"
- [(set (match_operand:VI248_VLBW 0 "register_operand" "=v")
- (unspec:VI248_VLBW
- [(match_operand:VI248_VLBW 1 "register_operand" "0")
- (match_operand:VI248_VLBW 2 "register_operand" "v")
- (match_operand:VI248_VLBW 3 "nonimmediate_operand" "vm")]
+ [(set (match_operand:VI248_AVX512VL 0 "register_operand" "=v")
+ (unspec:VI248_AVX512VL
+ [(match_operand:VI248_AVX512VL 1 "register_operand" "0")
+ (match_operand:VI248_AVX512VL 2 "register_operand" "v")
+ (match_operand:VI248_AVX512VL 3 "nonimmediate_operand" "vm")]
UNSPEC_VPSHRDV))]
"TARGET_AVX512VBMI2"
"vpshrdv<ssemodesuffix>\t{%3, %2, %0|%0, %2, %3 }"
@@ -20150,12 +20150,12 @@
(set_attr "mode" "<sseinsnmode>")])
(define_insn "vpshrdv_<mode>_mask"
- [(set (match_operand:VI248_VLBW 0 "register_operand" "=v")
- (vec_merge:VI248_VLBW
- (unspec:VI248_VLBW
- [(match_operand:VI248_VLBW 1 "register_operand" "0")
- (match_operand:VI248_VLBW 2 "register_operand" "v")
- (match_operand:VI248_VLBW 3 "nonimmediate_operand" "vm")]
+ [(set (match_operand:VI248_AVX512VL 0 "register_operand" "=v")
+ (vec_merge:VI248_AVX512VL
+ (unspec:VI248_AVX512VL
+ [(match_operand:VI248_AVX512VL 1 "register_operand" "0")
+ (match_operand:VI248_AVX512VL 2 "register_operand" "v")
+ (match_operand:VI248_AVX512VL 3 "nonimmediate_operand" "vm")]
UNSPEC_VPSHRDV)
(match_dup 1)
(match_operand:<avx512fmaskmode> 4 "register_operand" "Yk")))]
@@ -20165,10 +20165,10 @@
(set_attr "mode" "<sseinsnmode>")])
(define_expand "vpshrdv_<mode>_maskz"
- [(match_operand:VI248_VLBW 0 "register_operand")
- (match_operand:VI248_VLBW 1 "register_operand")
- (match_operand:VI248_VLBW 2 "register_operand")
- (match_operand:VI248_VLBW 3 "nonimmediate_operand")
+ [(match_operand:VI248_AVX512VL 0 "register_operand")
+ (match_operand:VI248_AVX512VL 1 "register_operand")
+ (match_operand:VI248_AVX512VL 2 "register_operand")
+ (match_operand:VI248_AVX512VL 3 "nonimmediate_operand")
(match_operand:<avx512fmaskmode> 4 "register_operand")]
"TARGET_AVX512VBMI2"
{
@@ -20180,14 +20180,14 @@
})
(define_insn "vpshrdv_<mode>_maskz_1"
- [(set (match_operand:VI248_VLBW 0 "register_operand" "=v")
- (vec_merge:VI248_VLBW
- (unspec:VI248_VLBW
- [(match_operand:VI248_VLBW 1 "register_operand" "0")
- (match_operand:VI248_VLBW 2 "register_operand" "v")
- (match_operand:VI248_VLBW 3 "nonimmediate_operand" "vm")]
+ [(set (match_operand:VI248_AVX512VL 0 "register_operand" "=v")
+ (vec_merge:VI248_AVX512VL
+ (unspec:VI248_AVX512VL
+ [(match_operand:VI248_AVX512VL 1 "register_operand" "0")
+ (match_operand:VI248_AVX512VL 2 "register_operand" "v")
+ (match_operand:VI248_AVX512VL 3 "nonimmediate_operand" "vm")]
UNSPEC_VPSHRDV)
- (match_operand:VI248_VLBW 4 "const0_operand" "C")
+ (match_operand:VI248_AVX512VL 4 "const0_operand" "C")
(match_operand:<avx512fmaskmode> 5 "register_operand" "Yk")))]
"TARGET_AVX512VBMI2"
"vpshrdv<ssemodesuffix>\t{%3, %2, %0%{%5%}%{z%}|%0%{%5%}%{z%}, %2, %3 }"
@@ -20195,11 +20195,11 @@
(set_attr "mode" "<sseinsnmode>")])
(define_insn "vpshldv_<mode>"
- [(set (match_operand:VI248_VLBW 0 "register_operand" "=v")
- (unspec:VI248_VLBW
- [(match_operand:VI248_VLBW 1 "register_operand" "0")
- (match_operand:VI248_VLBW 2 "register_operand" "v")
- (match_operand:VI248_VLBW 3 "nonimmediate_operand" "vm")]
+ [(set (match_operand:VI248_AVX512VL 0 "register_operand" "=v")
+ (unspec:VI248_AVX512VL
+ [(match_operand:VI248_AVX512VL 1 "register_operand" "0")
+ (match_operand:VI248_AVX512VL 2 "register_operand" "v")
+ (match_operand:VI248_AVX512VL 3 "nonimmediate_operand" "vm")]
UNSPEC_VPSHLDV))]
"TARGET_AVX512VBMI2"
"vpshldv<ssemodesuffix>\t{%3, %2, %0|%0, %2, %3 }"
@@ -20207,12 +20207,12 @@
(set_attr "mode" "<sseinsnmode>")])
(define_insn "vpshldv_<mode>_mask"
- [(set (match_operand:VI248_VLBW 0 "register_operand" "=v")
- (vec_merge:VI248_VLBW
- (unspec:VI248_VLBW
- [(match_operand:VI248_VLBW 1 "register_operand" "0")
- (match_operand:VI248_VLBW 2 "register_operand" "v")
- (match_operand:VI248_VLBW 3 "nonimmediate_operand" "vm")]
+ [(set (match_operand:VI248_AVX512VL 0 "register_operand" "=v")
+ (vec_merge:VI248_AVX512VL
+ (unspec:VI248_AVX512VL
+ [(match_operand:VI248_AVX512VL 1 "register_operand" "0")
+ (match_operand:VI248_AVX512VL 2 "register_operand" "v")
+ (match_operand:VI248_AVX512VL 3 "nonimmediate_operand" "vm")]
UNSPEC_VPSHLDV)
(match_dup 1)
(match_operand:<avx512fmaskmode> 4 "register_operand" "Yk")))]
@@ -20222,10 +20222,10 @@
(set_attr "mode" "<sseinsnmode>")])
(define_expand "vpshldv_<mode>_maskz"
- [(match_operand:VI248_VLBW 0 "register_operand")
- (match_operand:VI248_VLBW 1 "register_operand")
- (match_operand:VI248_VLBW 2 "register_operand")
- (match_operand:VI248_VLBW 3 "nonimmediate_operand")
+ [(match_operand:VI248_AVX512VL 0 "register_operand")
+ (match_operand:VI248_AVX512VL 1 "register_operand")
+ (match_operand:VI248_AVX512VL 2 "register_operand")
+ (match_operand:VI248_AVX512VL 3 "nonimmediate_operand")
(match_operand:<avx512fmaskmode> 4 "register_operand")]
"TARGET_AVX512VBMI2"
{
@@ -20237,14 +20237,14 @@
})
(define_insn "vpshldv_<mode>_maskz_1"
- [(set (match_operand:VI248_VLBW 0 "register_operand" "=v")
- (vec_merge:VI248_VLBW
- (unspec:VI248_VLBW
- [(match_operand:VI248_VLBW 1 "register_operand" "0")
- (match_operand:VI248_VLBW 2 "register_operand" "v")
- (match_operand:VI248_VLBW 3 "nonimmediate_operand" "vm")]
+ [(set (match_operand:VI248_AVX512VL 0 "register_operand" "=v")
+ (vec_merge:VI248_AVX512VL
+ (unspec:VI248_AVX512VL
+ [(match_operand:VI248_AVX512VL 1 "register_operand" "0")
+ (match_operand:VI248_AVX512VL 2 "register_operand" "v")
+ (match_operand:VI248_AVX512VL 3 "nonimmediate_operand" "vm")]
UNSPEC_VPSHLDV)
- (match_operand:VI248_VLBW 4 "const0_operand" "C")
+ (match_operand:VI248_AVX512VL 4 "const0_operand" "C")
(match_operand:<avx512fmaskmode> 5 "register_operand" "Yk")))]
"TARGET_AVX512VBMI2"
"vpshldv<ssemodesuffix>\t{%3, %2, %0%{%5%}%{z%}|%0%{%5%}%{z%}, %2, %3 }"
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2a18e22131f..685298befd2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/83604
+ * gcc.target/i386/pr83604.c: New test.
+
2018-01-05 Richard Sandiford <richard.sandiford@linaro.org>
* gcc.dg/vect/vect-align-4.c: New test.
diff --git a/gcc/testsuite/gcc.target/i386/pr83604.c b/gcc/testsuite/gcc.target/i386/pr83604.c
new file mode 100644
index 00000000000..c6ff2a406f5
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr83604.c
@@ -0,0 +1,11 @@
+/* PR target/83604 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mno-avx" } */
+
+typedef short V __attribute__((__vector_size__(64)));
+
+__attribute__((target ("avx512vbmi2"))) V
+foo (V x, V y, V z)
+{
+ return __builtin_ia32_vpshrdv_v32hi (x, y, z);
+}