From c883e5fb6a12718325cebeb653a4ccf4668a723c Mon Sep 17 00:00:00 2001 From: Alexander Ivchenko Date: Thu, 11 Sep 2014 06:52:30 +0000 Subject: [PATCH] AVX-512. Add vperm[it]2 insns support. gcc/ * config/i386/sse.md (define_expand "_vpermi2var3_maskz"): Rename from "avx512f_vpermi2var3_maskz" and update mode iterator. (define_expand "_vpermi2var3_maskz"): New. (define_insn "_vpermi2var3"): Rename from "avx512f_vpermi2var3" and update mode iterator. (define_insn "_vpermi2var3"): New. (define_insn "_vpermi2var3_mask"): Rename from "avx512f_vpermi2var3_mask" and update mode iterator. (define_insn "_vpermi2var3_mask"): New. (define_expand "_vpermt2var3_maskz"): Rename from "avx512f_vpermt2var3_maskz" and update mode iterator. (define_expand "_vpermt2var3_maskz"): New. (define_insn "_vpermt2var3"): Rename from "avx512f_vpermt2var3" and update mode iterator. (define_insn "_vpermt2var3"): New. (define_insn "_vpermt2var3_mask"): Rename from "avx512f_vpermt2var3_mask" and update mode iterator. (define_insn "_vpermt2var3_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: r215151 --- gcc/ChangeLog | 34 ++++++++++ gcc/config/i386/sse.md | 150 ++++++++++++++++++++++++++++++++--------- 2 files changed, 152 insertions(+), 32 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 40f912ab9d2..747dbfcb28a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,37 @@ +2014-09-11 Alexander Ivchenko + Maxim Kuznetsov + Anna Tikhonova + Ilya Tocar + Andrey Turetskiy + Ilya Verbin + Kirill Yukhin + Michael Zolotukhin + + * config/i386/sse.md + (define_expand "_vpermi2var3_maskz"): Rename from + "avx512f_vpermi2var3_maskz" and update mode iterator. + (define_expand "_vpermi2var3_maskz"): + New. + (define_insn "_vpermi2var3"): Rename + from "avx512f_vpermi2var3" and update mode + iterator. + (define_insn "_vpermi2var3"): + New. + (define_insn "_vpermi2var3_mask"): Rename from + "avx512f_vpermi2var3_mask" and update mode iterator. + (define_insn "_vpermi2var3_mask"): New. + (define_expand "_vpermt2var3_maskz"): Rename from + "avx512f_vpermt2var3_maskz" and update mode iterator. + (define_expand "_vpermt2var3_maskz"): New. + (define_insn "_vpermt2var3"): Rename + from "avx512f_vpermt2var3" and update mode + iterator. + (define_insn "_vpermt2var3"): + New. + (define_insn "_vpermt2var3_mask"): Rename from + "avx512f_vpermt2var3_mask" and update mode iterator. + (define_insn "_vpermt2var3_mask"): New. + 2014-09-10 Jan Hubicka * varpool.c (varpool_node::ctor_useable_for_folding_p): Do not try diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 91ec8fdfa54..e182582bc84 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -15662,26 +15662,40 @@ (set_attr "prefix" "") (set_attr "mode" "")]) -(define_expand "avx512f_vpermi2var3_maskz" - [(match_operand:VI48F_512 0 "register_operand" "=v") - (match_operand:VI48F_512 1 "register_operand" "v") +(define_expand "_vpermi2var3_maskz" + [(match_operand:VI48F 0 "register_operand" "=v") + (match_operand:VI48F 1 "register_operand" "v") (match_operand: 2 "register_operand" "0") - (match_operand:VI48F_512 3 "nonimmediate_operand" "vm") + (match_operand:VI48F 3 "nonimmediate_operand" "vm") (match_operand: 4 "register_operand" "Yk")] "TARGET_AVX512F" { - emit_insn (gen_avx512f_vpermi2var3_maskz_1 ( + emit_insn (gen__vpermi2var3_maskz_1 ( operands[0], operands[1], operands[2], operands[3], CONST0_RTX (mode), operands[4])); DONE; }) -(define_insn "avx512f_vpermi2var3" - [(set (match_operand:VI48F_512 0 "register_operand" "=v") - (unspec:VI48F_512 - [(match_operand:VI48F_512 1 "register_operand" "v") +(define_expand "_vpermi2var3_maskz" + [(match_operand:VI2_AVX512VL 0 "register_operand" "=v") + (match_operand:VI2_AVX512VL 1 "register_operand" "v") + (match_operand: 2 "register_operand" "0") + (match_operand:VI2_AVX512VL 3 "nonimmediate_operand" "vm") + (match_operand: 4 "register_operand" "Yk")] + "TARGET_AVX512BW" +{ + emit_insn (gen__vpermi2var3_maskz_1 ( + operands[0], operands[1], operands[2], operands[3], + CONST0_RTX (mode), operands[4])); + DONE; +}) + +(define_insn "_vpermi2var3" + [(set (match_operand:VI48F 0 "register_operand" "=v") + (unspec:VI48F + [(match_operand:VI48F 1 "register_operand" "v") (match_operand: 2 "register_operand" "0") - (match_operand:VI48F_512 3 "nonimmediate_operand" "vm")] + (match_operand:VI48F 3 "nonimmediate_operand" "vm")] UNSPEC_VPERMI2))] "TARGET_AVX512F" "vpermi2\t{%3, %1, %0|%0, %1, %3}" @@ -15689,13 +15703,26 @@ (set_attr "prefix" "evex") (set_attr "mode" "")]) -(define_insn "avx512f_vpermi2var3_mask" - [(set (match_operand:VI48F_512 0 "register_operand" "=v") - (vec_merge:VI48F_512 - (unspec:VI48F_512 - [(match_operand:VI48F_512 1 "register_operand" "v") +(define_insn "_vpermi2var3" + [(set (match_operand:VI2_AVX512VL 0 "register_operand" "=v") + (unspec:VI2_AVX512VL + [(match_operand:VI2_AVX512VL 1 "register_operand" "v") + (match_operand: 2 "register_operand" "0") + (match_operand:VI2_AVX512VL 3 "nonimmediate_operand" "vm")] + UNSPEC_VPERMI2))] + "TARGET_AVX512BW" + "vpermi2\t{%3, %1, %0|%0, %1, %3}" + [(set_attr "type" "sselog") + (set_attr "prefix" "evex") + (set_attr "mode" "")]) + +(define_insn "_vpermi2var3_mask" + [(set (match_operand:VI48F 0 "register_operand" "=v") + (vec_merge:VI48F + (unspec:VI48F + [(match_operand:VI48F 1 "register_operand" "v") (match_operand: 2 "register_operand" "0") - (match_operand:VI48F_512 3 "nonimmediate_operand" "vm")] + (match_operand:VI48F 3 "nonimmediate_operand" "vm")] UNSPEC_VPERMI2_MASK) (match_dup 0) (match_operand: 4 "register_operand" "Yk")))] @@ -15705,26 +15732,56 @@ (set_attr "prefix" "evex") (set_attr "mode" "")]) -(define_expand "avx512f_vpermt2var3_maskz" - [(match_operand:VI48F_512 0 "register_operand" "=v") +(define_insn "_vpermi2var3_mask" + [(set (match_operand:VI2_AVX512VL 0 "register_operand" "=v") + (vec_merge:VI2_AVX512VL + (unspec:VI2_AVX512VL + [(match_operand:VI2_AVX512VL 1 "register_operand" "v") + (match_operand: 2 "register_operand" "0") + (match_operand:VI2_AVX512VL 3 "nonimmediate_operand" "vm")] + UNSPEC_VPERMI2_MASK) + (match_dup 0) + (match_operand: 4 "register_operand" "Yk")))] + "TARGET_AVX512BW" + "vpermi2\t{%3, %1, %0%{%4%}|%0%{%4%}, %1, %3}" + [(set_attr "type" "sselog") + (set_attr "prefix" "evex") + (set_attr "mode" "")]) + +(define_expand "_vpermt2var3_maskz" + [(match_operand:VI48F 0 "register_operand" "=v") (match_operand: 1 "register_operand" "v") - (match_operand:VI48F_512 2 "register_operand" "0") - (match_operand:VI48F_512 3 "nonimmediate_operand" "vm") + (match_operand:VI48F 2 "register_operand" "0") + (match_operand:VI48F 3 "nonimmediate_operand" "vm") (match_operand: 4 "register_operand" "Yk")] "TARGET_AVX512F" { - emit_insn (gen_avx512f_vpermt2var3_maskz_1 ( + emit_insn (gen__vpermt2var3_maskz_1 ( operands[0], operands[1], operands[2], operands[3], CONST0_RTX (mode), operands[4])); DONE; }) -(define_insn "avx512f_vpermt2var3" - [(set (match_operand:VI48F_512 0 "register_operand" "=v") - (unspec:VI48F_512 +(define_expand "_vpermt2var3_maskz" + [(match_operand:VI2_AVX512VL 0 "register_operand" "=v") + (match_operand: 1 "register_operand" "v") + (match_operand:VI2_AVX512VL 2 "register_operand" "0") + (match_operand:VI2_AVX512VL 3 "nonimmediate_operand" "vm") + (match_operand: 4 "register_operand" "Yk")] + "TARGET_AVX512BW" +{ + emit_insn (gen__vpermt2var3_maskz_1 ( + operands[0], operands[1], operands[2], operands[3], + CONST0_RTX (mode), operands[4])); + DONE; +}) + +(define_insn "_vpermt2var3" + [(set (match_operand:VI48F 0 "register_operand" "=v") + (unspec:VI48F [(match_operand: 1 "register_operand" "v") - (match_operand:VI48F_512 2 "register_operand" "0") - (match_operand:VI48F_512 3 "nonimmediate_operand" "vm")] + (match_operand:VI48F 2 "register_operand" "0") + (match_operand:VI48F 3 "nonimmediate_operand" "vm")] UNSPEC_VPERMT2))] "TARGET_AVX512F" "vpermt2\t{%3, %1, %0|%0, %1, %3}" @@ -15732,13 +15789,26 @@ (set_attr "prefix" "evex") (set_attr "mode" "")]) -(define_insn "avx512f_vpermt2var3_mask" - [(set (match_operand:VI48F_512 0 "register_operand" "=v") - (vec_merge:VI48F_512 - (unspec:VI48F_512 +(define_insn "_vpermt2var3" + [(set (match_operand:VI2_AVX512VL 0 "register_operand" "=v") + (unspec:VI2_AVX512VL + [(match_operand: 1 "register_operand" "v") + (match_operand:VI2_AVX512VL 2 "register_operand" "0") + (match_operand:VI2_AVX512VL 3 "nonimmediate_operand" "vm")] + UNSPEC_VPERMT2))] + "TARGET_AVX512BW" + "vpermt2\t{%3, %1, %0|%0, %1, %3}" + [(set_attr "type" "sselog") + (set_attr "prefix" "evex") + (set_attr "mode" "")]) + +(define_insn "_vpermt2var3_mask" + [(set (match_operand:VI48F 0 "register_operand" "=v") + (vec_merge:VI48F + (unspec:VI48F [(match_operand: 1 "register_operand" "v") - (match_operand:VI48F_512 2 "register_operand" "0") - (match_operand:VI48F_512 3 "nonimmediate_operand" "vm")] + (match_operand:VI48F 2 "register_operand" "0") + (match_operand:VI48F 3 "nonimmediate_operand" "vm")] UNSPEC_VPERMT2) (match_dup 2) (match_operand: 4 "register_operand" "Yk")))] @@ -15748,6 +15818,22 @@ (set_attr "prefix" "evex") (set_attr "mode" "")]) +(define_insn "_vpermt2var3_mask" + [(set (match_operand:VI2_AVX512VL 0 "register_operand" "=v") + (vec_merge:VI2_AVX512VL + (unspec:VI2_AVX512VL + [(match_operand: 1 "register_operand" "v") + (match_operand:VI2_AVX512VL 2 "register_operand" "0") + (match_operand:VI2_AVX512VL 3 "nonimmediate_operand" "vm")] + UNSPEC_VPERMT2) + (match_dup 2) + (match_operand: 4 "register_operand" "Yk")))] + "TARGET_AVX512BW" + "vpermt2\t{%3, %1, %0%{%4%}|%0%{%4%}, %1, %3}" + [(set_attr "type" "sselog") + (set_attr "prefix" "evex") + (set_attr "mode" "")]) + (define_expand "avx_vperm2f1283" [(set (match_operand:AVX256MODE2P 0 "register_operand") (unspec:AVX256MODE2P -- 2.30.2