This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Improve vec_concatv?sf*
- From: Kirill Yukhin <kirill dot yukhin at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Uros Bizjak <ubizjak at gmail dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 12 May 2016 16:39:52 +0300
- Subject: Re: [PATCH] Improve vec_concatv?sf*
- Authentication-results: sourceware.org; auth=none
- References: <20160504194402 dot GP26501 at tucnak dot zalov dot cz>
Hi Jakub,
On 04 May 21:44, Jakub Jelinek wrote:
> Hi!
>
> Another pair of define_insns.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2016-05-04 Jakub Jelinek <jakub@redhat.com>
>
> * config/i386/sse.md (*vec_concatv2sf_sse4_1, *vec_concatv4sf): Use
> v instead of x in vex or maybe_vex alternatives, use
> maybe_evex instead of vex in prefix.
>
> --- gcc/config/i386/sse.md.jj 2016-05-04 14:36:08.000000000 +0200
> +++ gcc/config/i386/sse.md 2016-05-04 15:16:44.180894303 +0200
> @@ -6415,12 +6415,12 @@ (define_insn "avx512f_vec_dup<mode>_1"
> ;; unpcklps with register source since it is shorter.
> (define_insn "*vec_concatv2sf_sse4_1"
> [(set (match_operand:V2SF 0 "register_operand"
> - "=Yr,*x,x,Yr,*x,x,x,*y ,*y")
> + "=Yr,*x,v,Yr,*x,v,v,*y ,*y")
> (vec_concat:V2SF
> (match_operand:SF 1 "nonimmediate_operand"
> - " 0, 0,x, 0,0, x,m, 0 , m")
> + " 0, 0,v, 0,0, v,m, 0 , m")
> (match_operand:SF 2 "vector_move_operand"
> - " Yr,*x,x, m,m, m,C,*ym, C")))]
> + " Yr,*x,v, m,m, m,C,*ym, C")))]
> "TARGET_SSE4_1 && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
> "@
> unpcklps\t{%2, %0|%0, %2}
Looks like we were wrong here.
We need to use Yv constraint for vunpcklps since this
insn is available for AVX-512VL only.
Like this:
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index d77227a..7d71640 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -6546,12 +6546,12 @@
;; unpcklps with register source since it is shorter.
(define_insn "*vec_concatv2sf_sse4_1"
[(set (match_operand:V2SF 0 "register_operand"
- "=Yr,*x,v,Yr,*x,v,v,*y ,*y")
+ "=Yr,*x,Yv,Yr,*x,v,v,*y ,*y")
(vec_concat:V2SF
(match_operand:SF 1 "nonimmediate_operand"
- " 0, 0,v, 0,0, v,m, 0 , m")
+ " 0, 0,Yv, 0,0, v,m, 0 , m")
(match_operand:SF 2 "vector_move_operand"
- " Yr,*x,v, m,m, m,C,*ym, C")))]
+ " Yr,*x,Yv, m,m, m,C,*ym, C")))]
"TARGET_SSE4_1 && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
"@
unpcklps\t{%2, %0|%0, %2}
Will check in to main trunk after bootstrap/regtest.
--
Thanks, K