From 6500d32987137853de9afc6ca9f88d90c0aba8ba Mon Sep 17 00:00:00 2001 From: kyukhin 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215151 138bc75d-0d04-0410-961f-82ee72b054a4 --- 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.11.4.GIT