Commit dd3b6464 by Jakub Jelinek Committed by Jakub Jelinek

sse.md (<mask_codefor>ashr<mode>3<mask_name>): Move before the ashr<mode>3 pattern.

	* config/i386/sse.md (<mask_codefor>ashr<mode>3<mask_name>): Move
	before the ashr<mode>3 pattern.

	* gcc.target/i386/avx512bw-vpsraw-3.c: New test.
	* gcc.target/i386/avx512vl-vpsrad-3.c: New test.

From-SVN: r235972
parent 58ec1d0e
2016-05-06 Jakub Jelinek <jakub@redhat.com> 2016-05-06 Jakub Jelinek <jakub@redhat.com>
* config/i386/sse.md (<mask_codefor>ashr<mode>3<mask_name>): Move
before the ashr<mode>3 pattern.
* config/i386/sse.md (*avx2_pmaddwd, *sse2_pmaddwd): Use * config/i386/sse.md (*avx2_pmaddwd, *sse2_pmaddwd): Use
v instead of x in vex or maybe_vex alternatives, use v instead of x in vex or maybe_vex alternatives, use
maybe_evex instead of vex in prefix. maybe_evex instead of vex in prefix.
......
...@@ -10088,6 +10088,20 @@ ...@@ -10088,6 +10088,20 @@
DONE; DONE;
}) })
(define_insn "<mask_codefor>ashr<mode>3<mask_name>"
[(set (match_operand:VI24_AVX512BW_1 0 "register_operand" "=v,v")
(ashiftrt:VI24_AVX512BW_1
(match_operand:VI24_AVX512BW_1 1 "nonimmediate_operand" "v,vm")
(match_operand:SI 2 "nonmemory_operand" "v,N")))]
"TARGET_AVX512VL"
"vpsra<ssemodesuffix>\t{%2, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2}"
[(set_attr "type" "sseishft")
(set (attr "length_immediate")
(if_then_else (match_operand 2 "const_int_operand")
(const_string "1")
(const_string "0")))
(set_attr "mode" "<sseinsnmode>")])
(define_insn "ashr<mode>3" (define_insn "ashr<mode>3"
[(set (match_operand:VI24_AVX2 0 "register_operand" "=x,x") [(set (match_operand:VI24_AVX2 0 "register_operand" "=x,x")
(ashiftrt:VI24_AVX2 (ashiftrt:VI24_AVX2
...@@ -10107,20 +10121,6 @@ ...@@ -10107,20 +10121,6 @@
(set_attr "prefix" "orig,vex") (set_attr "prefix" "orig,vex")
(set_attr "mode" "<sseinsnmode>")]) (set_attr "mode" "<sseinsnmode>")])
(define_insn "<mask_codefor>ashr<mode>3<mask_name>"
[(set (match_operand:VI24_AVX512BW_1 0 "register_operand" "=v,v")
(ashiftrt:VI24_AVX512BW_1
(match_operand:VI24_AVX512BW_1 1 "nonimmediate_operand" "v,vm")
(match_operand:SI 2 "nonmemory_operand" "v,N")))]
"TARGET_AVX512VL"
"vpsra<ssemodesuffix>\t{%2, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2}"
[(set_attr "type" "sseishft")
(set (attr "length_immediate")
(if_then_else (match_operand 2 "const_int_operand")
(const_string "1")
(const_string "0")))
(set_attr "mode" "<sseinsnmode>")])
(define_insn "<mask_codefor>ashrv2di3<mask_name>" (define_insn "<mask_codefor>ashrv2di3<mask_name>"
[(set (match_operand:V2DI 0 "register_operand" "=v,v") [(set (match_operand:V2DI 0 "register_operand" "=v,v")
(ashiftrt:V2DI (ashiftrt:V2DI
......
2016-05-06 Jakub Jelinek <jakub@redhat.com> 2016-05-06 Jakub Jelinek <jakub@redhat.com>
* gcc.target/i386/avx512bw-vpsraw-3.c: New test.
* gcc.target/i386/avx512vl-vpsrad-3.c: New test.
* gcc.target/i386/avx512bw-vpmaddwd-3.c: New test. * gcc.target/i386/avx512bw-vpmaddwd-3.c: New test.
2016-05-06 Yuri Rumyantsev <ysrumyan@gmail.com> 2016-05-06 Yuri Rumyantsev <ysrumyan@gmail.com>
......
/* { dg-do assemble { target { avx512bw && { avx512vl && { ! ia32 } } } } } */
/* { dg-options "-O2 -mavx512bw -mavx512vl" } */
#include <x86intrin.h>
void
f1 (__m128i x, int y)
{
register __m128i a __asm ("xmm16");
a = x;
asm volatile ("" : "+v" (a));
a = _mm_srai_epi16 (a, y);
asm volatile ("" : "+v" (a));
}
void
f2 (__m128i x)
{
register __m128i a __asm ("xmm16");
a = x;
asm volatile ("" : "+v" (a));
a = _mm_srai_epi16 (a, 16);
asm volatile ("" : "+v" (a));
}
void
f3 (__m256i x, int y)
{
register __m256i a __asm ("xmm16");
a = x;
asm volatile ("" : "+v" (a));
a = _mm256_srai_epi16 (a, y);
asm volatile ("" : "+v" (a));
}
void
f4 (__m256i x)
{
register __m256i a __asm ("xmm16");
a = x;
asm volatile ("" : "+v" (a));
a = _mm256_srai_epi16 (a, 16);
asm volatile ("" : "+v" (a));
}
/* { dg-do assemble { target { avx512vl && { ! ia32 } } } } */
/* { dg-options "-O2 -mavx512vl" } */
#include <x86intrin.h>
void
f1 (__m128i x, int y)
{
register __m128i a __asm ("xmm16");
a = x;
asm volatile ("" : "+v" (a));
a = _mm_srai_epi32 (a, y);
asm volatile ("" : "+v" (a));
}
void
f2 (__m128i x)
{
register __m128i a __asm ("xmm16");
a = x;
asm volatile ("" : "+v" (a));
a = _mm_srai_epi32 (a, 16);
asm volatile ("" : "+v" (a));
}
void
f3 (__m256i x, int y)
{
register __m256i a __asm ("xmm16");
a = x;
asm volatile ("" : "+v" (a));
a = _mm256_srai_epi32 (a, y);
asm volatile ("" : "+v" (a));
}
void
f4 (__m256i x)
{
register __m256i a __asm ("xmm16");
a = x;
asm volatile ("" : "+v" (a));
a = _mm256_srai_epi32 (a, 16);
asm volatile ("" : "+v" (a));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment