Commit b8227739 by Jakub Jelinek Committed by Jakub Jelinek

re PR target/52568 (suboptimal __builtin_shuffle on cycles with AVX)

	PR target/52568
	* config/i386/sse.md (UNSPEC_VPERMDF): Remove.
	(avx2_permv4df): Remove.
	(avx2_permv4di): Macroize into...
	(avx2_perm<mode>): ... this using VI8F_256 iterator.
	(avx2_permv4di_1): Macroize into...
	(avx2_perm<mode>_1): ... this using VI8F_256 iterator.

From-SVN: r185446
parent 192b716b
2012-03-15 Jakub Jelinek <jakub@redhat.com>
PR target/52568
* config/i386/sse.md (UNSPEC_VPERMDF): Remove.
(avx2_permv4df): Remove.
(avx2_permv4di): Macroize into...
(avx2_perm<mode>): ... this using VI8F_256 iterator.
(avx2_permv4di_1): Macroize into...
(avx2_perm<mode>_1): ... this using VI8F_256 iterator.
2012-03-15 Ulrich Weigand <ulrich.weigand@linaro.org> 2012-03-15 Ulrich Weigand <ulrich.weigand@linaro.org>
* combine.c (apply_distributive_law): Do not distribute SUBREG. * combine.c (apply_distributive_law): Do not distribute SUBREG.
......
...@@ -80,7 +80,6 @@ ...@@ -80,7 +80,6 @@
;; For AVX2 support ;; For AVX2 support
UNSPEC_VPERMSI UNSPEC_VPERMSI
UNSPEC_VPERMDF
UNSPEC_VPERMSF UNSPEC_VPERMSF
UNSPEC_VPERMTI UNSPEC_VPERMTI
UNSPEC_GATHER UNSPEC_GATHER
...@@ -11889,19 +11888,6 @@ ...@@ -11889,19 +11888,6 @@
(set_attr "prefix" "vex") (set_attr "prefix" "vex")
(set_attr "mode" "OI")]) (set_attr "mode" "OI")])
(define_insn "avx2_permv4df"
[(set (match_operand:V4DF 0 "register_operand" "=x")
(unspec:V4DF
[(match_operand:V4DF 1 "register_operand" "xm")
(match_operand:SI 2 "const_0_to_255_operand" "n")]
UNSPEC_VPERMDF))]
"TARGET_AVX2"
"vpermpd\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
(set_attr "prefix" "vex")
(set_attr "mode" "OI")])
(define_insn "avx2_permvarv8sf" (define_insn "avx2_permvarv8sf"
[(set (match_operand:V8SF 0 "register_operand" "=x") [(set (match_operand:V8SF 0 "register_operand" "=x")
(unspec:V8SF (unspec:V8SF
...@@ -11914,14 +11900,14 @@ ...@@ -11914,14 +11900,14 @@
(set_attr "prefix" "vex") (set_attr "prefix" "vex")
(set_attr "mode" "OI")]) (set_attr "mode" "OI")])
(define_expand "avx2_permv4di" (define_expand "avx2_perm<mode>"
[(match_operand:V4DI 0 "register_operand" "") [(match_operand:VI8F_256 0 "register_operand" "")
(match_operand:V4DI 1 "nonimmediate_operand" "") (match_operand:VI8F_256 1 "nonimmediate_operand" "")
(match_operand:SI 2 "const_0_to_255_operand" "")] (match_operand:SI 2 "const_0_to_255_operand" "")]
"TARGET_AVX2" "TARGET_AVX2"
{ {
int mask = INTVAL (operands[2]); int mask = INTVAL (operands[2]);
emit_insn (gen_avx2_permv4di_1 (operands[0], operands[1], emit_insn (gen_avx2_perm<mode>_1 (operands[0], operands[1],
GEN_INT ((mask >> 0) & 3), GEN_INT ((mask >> 0) & 3),
GEN_INT ((mask >> 2) & 3), GEN_INT ((mask >> 2) & 3),
GEN_INT ((mask >> 4) & 3), GEN_INT ((mask >> 4) & 3),
...@@ -11929,10 +11915,10 @@ ...@@ -11929,10 +11915,10 @@
DONE; DONE;
}) })
(define_insn "avx2_permv4di_1" (define_insn "avx2_perm<mode>_1"
[(set (match_operand:V4DI 0 "register_operand" "=x") [(set (match_operand:VI8F_256 0 "register_operand" "=x")
(vec_select:V4DI (vec_select:VI8F_256
(match_operand:V4DI 1 "nonimmediate_operand" "xm") (match_operand:VI8F_256 1 "nonimmediate_operand" "xm")
(parallel [(match_operand 2 "const_0_to_3_operand" "") (parallel [(match_operand 2 "const_0_to_3_operand" "")
(match_operand 3 "const_0_to_3_operand" "") (match_operand 3 "const_0_to_3_operand" "")
(match_operand 4 "const_0_to_3_operand" "") (match_operand 4 "const_0_to_3_operand" "")
...@@ -11945,11 +11931,11 @@ ...@@ -11945,11 +11931,11 @@
mask |= INTVAL (operands[4]) << 4; mask |= INTVAL (operands[4]) << 4;
mask |= INTVAL (operands[5]) << 6; mask |= INTVAL (operands[5]) << 6;
operands[2] = GEN_INT (mask); operands[2] = GEN_INT (mask);
return "vpermq\t{%2, %1, %0|%0, %1, %2}"; return "vperm<ssemodesuffix>\t{%2, %1, %0|%0, %1, %2}";
} }
[(set_attr "type" "sselog") [(set_attr "type" "sselog")
(set_attr "prefix" "vex") (set_attr "prefix" "vex")
(set_attr "mode" "OI")]) (set_attr "mode" "<sseinsnmode>")])
(define_insn "avx2_permv2ti" (define_insn "avx2_permv2ti"
[(set (match_operand:V4DI 0 "register_operand" "=x") [(set (match_operand:V4DI 0 "register_operand" "=x")
......
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