@@ -23132,9 +23132,10 @@ ix86_expand_vecop_qihi2 (enum rtx_code code, rtx dest, rtx op1, rtx op2)
/* vpmovwb only available under AVX512BW. */
if (!TARGET_AVX512BW)
return false;
- if ((qimode == V8QImode || qimode == V16QImode)
- && !TARGET_AVX512VL)
+
+ if (qimode == V16QImode && !TARGET_AVX512VL)
return false;
+
/* Do not generate ymm/zmm instructions when
target prefers 128/256 bit vector width. */
if ((qimode == V16QImode && TARGET_PREFER_AVX128)
@@ -23143,10 +23144,6 @@ ix86_expand_vecop_qihi2 (enum rtx_code code, rtx dest, rtx op1, rtx op2)
switch (qimode)
{
- case E_V8QImode:
- himode = V8HImode;
- gen_truncate = gen_truncv8hiv8qi2;
- break;
case E_V16QImode:
himode = V16HImode;
gen_truncate = gen_truncv16hiv16qi2;
@@ -2734,6 +2734,30 @@ (define_insn_and_split "<insn>v2qi3"
[(set_attr "type" "multi")
(set_attr "mode" "QI")])
+(define_expand "v<insn>v8qi3"
+ [(set (match_operand:V8QI 0 "register_operand")
+ (any_shift:V8QI
+ (match_operand:V8QI 1 "register_operand")
+ (match_operand:V8QI 2 "register_operand")))]
+ "TARGET_AVX512BW && TARGET_AVX512VL && TARGET_MMX_WITH_SSE"
+{
+ ix86_expand_vecop_qihi_partial (<CODE>, operands[0],
+ operands[1], operands[2]);
+ DONE;
+})
+
+(define_expand "v<insn>v4qi3"
+ [(set (match_operand:V4QI 0 "register_operand")
+ (any_shift:V4QI
+ (match_operand:V4QI 1 "register_operand")
+ (match_operand:V4QI 2 "register_operand")))]
+ "TARGET_AVX512BW && TARGET_AVX512VL"
+{
+ ix86_expand_vecop_qihi_partial (<CODE>, operands[0],
+ operands[1], operands[2]);
+ DONE;
+})
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Parallel integral comparisons
@@ -24564,17 +24564,6 @@ (define_expand "v<insn><mode>3"
}
})
-(define_expand "v<insn>v8qi3"
- [(set (match_operand:V8QI 0 "register_operand")
- (any_shift:V8QI
- (match_operand:V8QI 1 "register_operand")
- (match_operand:V8QI 2 "nonimmediate_operand")))]
- "TARGET_AVX512BW && TARGET_AVX512VL && TARGET_64BIT"
-{
- ix86_expand_vecop_qihi (<CODE>, operands[0], operands[1], operands[2]);
- DONE;
-})
-
(define_expand "vlshr<mode>3"
[(set (match_operand:VI48_512 0 "register_operand")
(lshiftrt:VI48_512
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize -msse2" } */
+/* { dg-options "-O2 -msse2" } */
#define N 4
@@ -1,5 +1,5 @@
/* { dg-do compile { target { ! ia32 } } } */
-/* { dg-options "-O2 -ftree-vectorize -msse2" } */
+/* { dg-options "-O2 -msse2" } */
#define N 8
new file mode 100644
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mavx512bw -mavx512vl" } */
+
+#define N 4
+
+typedef unsigned char __vu __attribute__ ((__vector_size__ (N)));
+typedef signed char __vi __attribute__ ((__vector_size__ (N)));
+
+__vu sllv (__vu a, __vu b)
+{
+ return a << b;
+}
+
+/* { dg-final { scan-assembler-times "vpsllvw" 1 } } */
+
+__vu srlv (__vu a, __vu b)
+{
+ return a >> b;
+}
+
+/* { dg-final { scan-assembler-times "vpsrlvw" 1 } } */
+
+__vi srav (__vi a, __vi b)
+{
+ return a >> b;
+}
+
+/* { dg-final { scan-assembler-times "vpsravw" 1 } } */
new file mode 100644
@@ -0,0 +1,28 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O2 -mavx512bw -mavx512vl" } */
+
+#define N 8
+
+typedef unsigned char __vu __attribute__ ((__vector_size__ (N)));
+typedef signed char __vi __attribute__ ((__vector_size__ (N)));
+
+__vu vsll (__vu a, __vu b)
+{
+ return a << b;
+}
+
+/* { dg-final { scan-assembler-times "vpsllvw" 1 } } */
+
+__vu vsrl (__vu a, __vu b)
+{
+ return a >> b;
+}
+
+/* { dg-final { scan-assembler-times "vpsrlvw" 1 } } */
+
+__vi vsra (__vi a, __vi b)
+{
+ return a >> b;
+}
+
+/* { dg-final { scan-assembler-times "vpsravw" 1 } } */