From: Alexander Ivchenko Date: Tue, 23 Sep 2014 07:21:32 +0000 (+0000) Subject: AVX-512. Add vshufpd insn patterns. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b2d623e53b698df2e559bde5c6fc88718b389138;p=gcc.git AVX-512. Add vshufpd insn patterns. gcc/ * config/i386/sse.md (define_expand "avx_shufpd256"): Add masking. (define_insn "avx_shufpd256_1"): Ditto. (define_expand "sse2_shufpd"): Ditto. (define_insn "sse2_shufpd_v2df_mask"): New. Co-Authored-By: Andrey Turetskiy Co-Authored-By: Anna Tikhonova Co-Authored-By: Ilya Tocar Co-Authored-By: Ilya Verbin Co-Authored-By: Kirill Yukhin Co-Authored-By: Maxim Kuznetsov Co-Authored-By: Michael Zolotukhin From-SVN: r215496 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 090a9877e40..ca76b175044 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2014-09-23 Alexander Ivchenko + Maxim Kuznetsov + Anna Tikhonova + Ilya Tocar + Andrey Turetskiy + Ilya Verbin + Kirill Yukhin + Michael Zolotukhin + + * config/i386/sse.md + (define_expand "avx_shufpd256"): Add masking. + (define_insn "avx_shufpd256_1"): Ditto. + (define_expand "sse2_shufpd"): Ditto. + (define_insn "sse2_shufpd_v2df_mask"): New. + 2014-09-23 Alexander Ivchenko Maxim Kuznetsov Anna Tikhonova diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 9151063c4ba..9e0c0e82b43 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -7790,7 +7790,7 @@ (set_attr "prefix" "evex") (set_attr "mode" "V8DF")]) -(define_expand "avx_shufpd256" +(define_expand "avx_shufpd256" [(match_operand:V4DF 0 "register_operand") (match_operand:V4DF 1 "register_operand") (match_operand:V4DF 2 "nonimmediate_operand") @@ -7798,25 +7798,28 @@ "TARGET_AVX" { int mask = INTVAL (operands[3]); - emit_insn (gen_avx_shufpd256_1 (operands[0], operands[1], operands[2], - GEN_INT (mask & 1), - GEN_INT (mask & 2 ? 5 : 4), - GEN_INT (mask & 4 ? 3 : 2), - GEN_INT (mask & 8 ? 7 : 6))); + emit_insn (gen_avx_shufpd256_1 (operands[0], + operands[1], + operands[2], + GEN_INT (mask & 1), + GEN_INT (mask & 2 ? 5 : 4), + GEN_INT (mask & 4 ? 3 : 2), + GEN_INT (mask & 8 ? 7 : 6) + )); DONE; }) -(define_insn "avx_shufpd256_1" - [(set (match_operand:V4DF 0 "register_operand" "=x") +(define_insn "avx_shufpd256_1" + [(set (match_operand:V4DF 0 "register_operand" "=v") (vec_select:V4DF (vec_concat:V8DF - (match_operand:V4DF 1 "register_operand" "x") - (match_operand:V4DF 2 "nonimmediate_operand" "xm")) + (match_operand:V4DF 1 "register_operand" "v") + (match_operand:V4DF 2 "nonimmediate_operand" "vm")) (parallel [(match_operand 3 "const_0_to_1_operand") (match_operand 4 "const_4_to_5_operand") (match_operand 5 "const_2_to_3_operand") (match_operand 6 "const_6_to_7_operand")])))] - "TARGET_AVX" + "TARGET_AVX && " { int mask; mask = INTVAL (operands[3]); @@ -7825,14 +7828,14 @@ mask |= (INTVAL (operands[6]) - 6) << 3; operands[3] = GEN_INT (mask); - return "vshufpd\t{%3, %2, %1, %0|%0, %1, %2, %3}"; + return "vshufpd\t{%3, %2, %1, %0|%0, %1, %2, %3}"; } [(set_attr "type" "sseshuf") (set_attr "length_immediate" "1") (set_attr "prefix" "vex") (set_attr "mode" "V4DF")]) -(define_expand "sse2_shufpd" +(define_expand "sse2_shufpd" [(match_operand:V2DF 0 "register_operand") (match_operand:V2DF 1 "register_operand") (match_operand:V2DF 2 "nonimmediate_operand") @@ -7840,12 +7843,38 @@ "TARGET_SSE2" { int mask = INTVAL (operands[3]); - emit_insn (gen_sse2_shufpd_v2df (operands[0], operands[1], operands[2], - GEN_INT (mask & 1), - GEN_INT (mask & 2 ? 3 : 2))); + emit_insn (gen_sse2_shufpd_v2df (operands[0], operands[1], + operands[2], GEN_INT (mask & 1), + GEN_INT (mask & 2 ? 3 : 2) + )); DONE; }) +(define_insn "sse2_shufpd_v2df_mask" + [(set (match_operand:V2DF 0 "register_operand" "=v") + (vec_merge:V2DF + (vec_select:V2DF + (vec_concat:V4DF + (match_operand:V2DF 1 "register_operand" "v") + (match_operand:V2DF 2 "nonimmediate_operand" "vm")) + (parallel [(match_operand 3 "const_0_to_1_operand") + (match_operand 4 "const_2_to_3_operand")])) + (match_operand:V2DF 5 "vector_move_operand" "0C") + (match_operand:QI 6 "register_operand" "Yk")))] + "TARGET_AVX512VL" +{ + int mask; + mask = INTVAL (operands[3]); + mask |= (INTVAL (operands[4]) - 2) << 1; + operands[3] = GEN_INT (mask); + + return "vshufpd\t{%3, %2, %1, %0%{%6%}%N5|%0%{6%}%N5, %1, %2, %3}"; +} + [(set_attr "type" "sseshuf") + (set_attr "length_immediate" "1") + (set_attr "prefix" "evex") + (set_attr "mode" "V2DF")]) + ;; punpcklqdq and punpckhqdq are shorter than shufpd. (define_insn "avx2_interleave_highv4di" [(set (match_operand:V4DI 0 "register_operand" "=v")