From: Alexander Ivchenko Date: Wed, 10 Sep 2014 06:51:20 +0000 (+0000) Subject: AVX-512. Update float unspecs: storeu, rcp14, rsqrt14, scalef, getexp, fixupimm,... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b040ded3c6aacdac0218328a9e7245ea1352e3ec;p=gcc.git AVX-512. Update float unspecs: storeu, rcp14, rsqrt14, scalef, getexp, fixupimm, rndscale, getmant. gcc/ * config/i386/i386.c (avx512f_vgetmantv2df_round): Rename from "avx512f_getmantv2df_round". (avx512f_vgetmantv4sf_round): Rename from "avx512f_vgetmantv4sf_round". (ix86_expand_args_builtin): Handle avx512vl_getmantv8sf_mask, avx512vl_getmantv4df_mask, avx512vl_getmantv4sf_mask, avx512vl_getmantv2df_mask. (ix86_expand_round_builtin): Handle avx512f_vgetmantv2df_round, avx512f_vgetmantv4sf_round. * config/i386/sse.md (define_insn "_storeu_mask"): Rename from "avx512f_storeu512_mask" and update mode iterator. (define_insn "rcp14"): Use VF_AVX512VL. (define_insn "rsqrt14"): Ditto. (define_insn "_scalef"): Rename from "avx512f_scalef" and update mode iterator.. (define_insn "_getexp"): Rename from "avx512f_getexp" and update mode iterator. (define_expand "_fixupimm_maskz"): Rename from "avx512f_fixupimm_maskz" and update mode iterator. (define_insn "_fixupimm"): Rename from "avx512f_fixupimm" and update mode iterator. (define_insn "_fixupimm_mask"): Rename from "avx512f_fixupimm_mask" and update mode iterator.. (define_insn "_rndscale"): rename from "avx512f_rndscale" and update mode iterator.. (define_insn "_getmant"): Rename from "avx512f_getmant" and update mode iterator. (define_insn "avx512f_vgetmant"): Rename from "avx512f_getmant". 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: r215106 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 71d0700678a..5145acab20a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,53 @@ +2014-09-10 Alexander Ivchenko + Maxim Kuznetsov + Anna Tikhonova + Ilya Tocar + Andrey Turetskiy + Ilya Verbin + Kirill Yukhin + Michael Zolotukhin + + * config/i386/i386.c + (avx512f_vgetmantv2df_round): Rename from "avx512f_getmantv2df_round". + (avx512f_vgetmantv4sf_round): Rename from "avx512f_vgetmantv4sf_round". + (ix86_expand_args_builtin): Handle avx512vl_getmantv8sf_mask, + avx512vl_getmantv4df_mask, avx512vl_getmantv4sf_mask, + avx512vl_getmantv2df_mask. + (ix86_expand_round_builtin): Handle avx512f_vgetmantv2df_round, + avx512f_vgetmantv4sf_round. + * config/i386/sse.md + (define_insn "_storeu_mask"): + Rename from "avx512f_storeu512_mask" and update + mode iterator. + (define_insn "rcp14"): Use VF_AVX512VL. + (define_insn "rsqrt14"): Ditto. + (define_insn "_scalef"): Rename + from "avx512f_scalef" and update mode + iterator.. + (define_insn "_getexp"): + Rename from "avx512f_getexp" and + update mode iterator. + (define_expand + "_fixupimm_maskz"): Rename from + "avx512f_fixupimm_maskz" and update + mode iterator. + (define_insn + "_fixupimm"): Rename + from "avx512f_fixupimm" and + update mode iterator. + (define_insn "_fixupimm_mask"): Rename + from "avx512f_fixupimm_mask" and update mode + iterator.. + (define_insn + "_rndscale"): rename from + "avx512f_rndscale" and update + mode iterator.. + (define_insn "_getmant"): + Rename from "avx512f_getmant" and + update mode iterator. + (define_insn "avx512f_vgetmant"): Rename from + "avx512f_getmant". + 2014-09-10 Jan Hubicka PR ipa/63166 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 5f796bc6bae..844908939df 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -30285,8 +30285,8 @@ static const struct builtin_description bdesc_round_args[] = { OPTION_MASK_ISA_AVX512F, CODE_FOR_avx512f_sgetexpv4sf_round, "__builtin_ia32_getexpss128_round", IX86_BUILTIN_GETEXPSS128, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF_INT }, { OPTION_MASK_ISA_AVX512F, CODE_FOR_avx512f_getmantv8df_mask_round, "__builtin_ia32_getmantpd512_mask", IX86_BUILTIN_GETMANTPD512, UNKNOWN, (int) V8DF_FTYPE_V8DF_INT_V8DF_QI_INT }, { OPTION_MASK_ISA_AVX512F, CODE_FOR_avx512f_getmantv16sf_mask_round, "__builtin_ia32_getmantps512_mask", IX86_BUILTIN_GETMANTPS512, UNKNOWN, (int) V16SF_FTYPE_V16SF_INT_V16SF_HI_INT }, - { OPTION_MASK_ISA_AVX512F, CODE_FOR_avx512f_getmantv2df_round, "__builtin_ia32_getmantsd_round", IX86_BUILTIN_GETMANTSD128, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF_INT_INT }, - { OPTION_MASK_ISA_AVX512F, CODE_FOR_avx512f_getmantv4sf_round, "__builtin_ia32_getmantss_round", IX86_BUILTIN_GETMANTSS128, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF_INT_INT }, + { OPTION_MASK_ISA_AVX512F, CODE_FOR_avx512f_vgetmantv2df_round, "__builtin_ia32_getmantsd_round", IX86_BUILTIN_GETMANTSD128, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF_INT_INT }, + { OPTION_MASK_ISA_AVX512F, CODE_FOR_avx512f_vgetmantv4sf_round, "__builtin_ia32_getmantss_round", IX86_BUILTIN_GETMANTSS128, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF_INT_INT }, { OPTION_MASK_ISA_AVX512F, CODE_FOR_smaxv8df3_mask_round, "__builtin_ia32_maxpd512_mask", IX86_BUILTIN_MAXPD512, UNKNOWN, (int) V8DF_FTYPE_V8DF_V8DF_V8DF_QI_INT }, { OPTION_MASK_ISA_AVX512F, CODE_FOR_smaxv16sf3_mask_round, "__builtin_ia32_maxps512_mask", IX86_BUILTIN_MAXPS512, UNKNOWN, (int) V16SF_FTYPE_V16SF_V16SF_V16SF_HI_INT }, { OPTION_MASK_ISA_AVX512F, CODE_FOR_sse2_vmsmaxv2df3_round, "__builtin_ia32_maxsd_round", IX86_BUILTIN_MAXSD_ROUND, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF_INT }, @@ -34086,6 +34086,10 @@ ix86_expand_args_builtin (const struct builtin_description *d, case CODE_FOR_avx_vpermilv4df: case CODE_FOR_avx512f_getmantv8df_mask: case CODE_FOR_avx512f_getmantv16sf_mask: + case CODE_FOR_avx512vl_getmantv8sf_mask: + case CODE_FOR_avx512vl_getmantv4df_mask: + case CODE_FOR_avx512vl_getmantv4sf_mask: + case CODE_FOR_avx512vl_getmantv2df_mask: error ("the last argument must be a 4-bit immediate"); return const0_rtx; @@ -34492,8 +34496,8 @@ ix86_expand_round_builtin (const struct builtin_description *d, { case CODE_FOR_avx512f_getmantv8df_mask_round: case CODE_FOR_avx512f_getmantv16sf_mask_round: - case CODE_FOR_avx512f_getmantv2df_round: - case CODE_FOR_avx512f_getmantv4sf_round: + case CODE_FOR_avx512f_vgetmantv2df_round: + case CODE_FOR_avx512f_vgetmantv4sf_round: error ("the immediate argument must be a 4-bit immediate"); return const0_rtx; case CODE_FOR_avx512f_cmpv8df3_mask_round: diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 604c0dc1c55..1706e4ca1ca 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -1170,11 +1170,11 @@ ] (const_string "")))]) -(define_insn "avx512f_storeu512_mask" - [(set (match_operand:VF_512 0 "memory_operand" "=m") - (vec_merge:VF_512 - (unspec:VF_512 - [(match_operand:VF_512 1 "register_operand" "v")] +(define_insn "_storeu_mask" + [(set (match_operand:VF_AVX512VL 0 "memory_operand" "=m") + (vec_merge:VF_AVX512VL + (unspec:VF_AVX512VL + [(match_operand:VF_AVX512VL 1 "register_operand" "v")] UNSPEC_STOREU) (match_dup 0) (match_operand: 2 "register_operand" "Yk")))] @@ -1183,6 +1183,8 @@ switch (get_attr_mode (insn)) { case MODE_V16SF: + case MODE_V8SF: + case MODE_V4SF: return "vmovups\t{%1, %0%{%2%}|%0%{%2%}, %1}"; default: return "vmovu\t{%1, %0%{%2%}|%0%{%2%}, %1}"; @@ -1702,9 +1704,9 @@ (set_attr "mode" "SF")]) (define_insn "rcp14" - [(set (match_operand:VF_512 0 "register_operand" "=v") - (unspec:VF_512 - [(match_operand:VF_512 1 "nonimmediate_operand" "vm")] + [(set (match_operand:VF_AVX512VL 0 "register_operand" "=v") + (unspec:VF_AVX512VL + [(match_operand:VF_AVX512VL 1 "nonimmediate_operand" "vm")] UNSPEC_RCP14))] "TARGET_AVX512F" "vrcp14\t{%1, %0|%0, %1}" @@ -1797,9 +1799,9 @@ (set_attr "mode" "")]) (define_insn "rsqrt14" - [(set (match_operand:VF_512 0 "register_operand" "=v") - (unspec:VF_512 - [(match_operand:VF_512 1 "nonimmediate_operand" "vm")] + [(set (match_operand:VF_AVX512VL 0 "register_operand" "=v") + (unspec:VF_AVX512VL + [(match_operand:VF_AVX512VL 1 "nonimmediate_operand" "vm")] UNSPEC_RSQRT14))] "TARGET_AVX512F" "vrsqrt14\t{%1, %0|%0, %1}" @@ -7104,11 +7106,11 @@ [(set_attr "prefix" "evex") (set_attr "mode" "")]) -(define_insn "avx512f_scalef" - [(set (match_operand:VF_512 0 "register_operand" "=v") - (unspec:VF_512 - [(match_operand:VF_512 1 "register_operand" "v") - (match_operand:VF_512 2 "" "")] +(define_insn "_scalef" + [(set (match_operand:VF_AVX512VL 0 "register_operand" "=v") + (unspec:VF_AVX512VL + [(match_operand:VF_AVX512VL 1 "register_operand" "v") + (match_operand:VF_AVX512VL 2 "nonimmediate_operand" "")] UNSPEC_SCALEF))] "TARGET_AVX512F" "vscalef\t{%2, %1, %0|%0, %1, %2}" @@ -7161,9 +7163,9 @@ (set_attr "prefix" "evex") (set_attr "mode" "")]) -(define_insn "avx512f_getexp" - [(set (match_operand:VF_512 0 "register_operand" "=v") - (unspec:VF_512 [(match_operand:VF_512 1 "" "")] +(define_insn "_getexp" + [(set (match_operand:VF_AVX512VL 0 "register_operand" "=v") + (unspec:VF_AVX512VL [(match_operand:VF_AVX512VL 1 "" "")] UNSPEC_GETEXP))] "TARGET_AVX512F" "vgetexp\t{%1, %0|%0, %1}"; @@ -7227,28 +7229,28 @@ }) -(define_expand "avx512f_fixupimm_maskz" - [(match_operand:VF_512 0 "register_operand") - (match_operand:VF_512 1 "register_operand") - (match_operand:VF_512 2 "register_operand") +(define_expand "_fixupimm_maskz" + [(match_operand:VF_AVX512VL 0 "register_operand") + (match_operand:VF_AVX512VL 1 "register_operand") + (match_operand:VF_AVX512VL 2 "register_operand") (match_operand: 3 "") (match_operand:SI 4 "const_0_to_255_operand") (match_operand: 5 "register_operand")] "TARGET_AVX512F" { - emit_insn (gen_avx512f_fixupimm_maskz_1 ( + emit_insn (gen__fixupimm_maskz_1 ( operands[0], operands[1], operands[2], operands[3], operands[4], CONST0_RTX (mode), operands[5] )); DONE; }) -(define_insn "avx512f_fixupimm" - [(set (match_operand:VF_512 0 "register_operand" "=v") - (unspec:VF_512 - [(match_operand:VF_512 1 "register_operand" "0") - (match_operand:VF_512 2 "register_operand" "v") - (match_operand: 3 "" "") +(define_insn "_fixupimm" + [(set (match_operand:VF_AVX512VL 0 "register_operand" "=v") + (unspec:VF_AVX512VL + [(match_operand:VF_AVX512VL 1 "register_operand" "0") + (match_operand:VF_AVX512VL 2 "register_operand" "v") + (match_operand: 3 "nonimmediate_operand" "") (match_operand:SI 4 "const_0_to_255_operand")] UNSPEC_FIXUPIMM))] "TARGET_AVX512F" @@ -7256,13 +7258,13 @@ [(set_attr "prefix" "evex") (set_attr "mode" "")]) -(define_insn "avx512f_fixupimm_mask" - [(set (match_operand:VF_512 0 "register_operand" "=v") - (vec_merge:VF_512 - (unspec:VF_512 - [(match_operand:VF_512 1 "register_operand" "0") - (match_operand:VF_512 2 "register_operand" "v") - (match_operand: 3 "" "") +(define_insn "_fixupimm_mask" + [(set (match_operand:VF_AVX512VL 0 "register_operand" "=v") + (vec_merge:VF_AVX512VL + (unspec:VF_AVX512VL + [(match_operand:VF_AVX512VL 1 "register_operand" "0") + (match_operand:VF_AVX512VL 2 "register_operand" "v") + (match_operand: 3 "nonimmediate_operand" "") (match_operand:SI 4 "const_0_to_255_operand")] UNSPEC_FIXUPIMM) (match_dup 1) @@ -7323,10 +7325,10 @@ [(set_attr "prefix" "evex") (set_attr "mode" "")]) -(define_insn "avx512f_rndscale" - [(set (match_operand:VF_512 0 "register_operand" "=v") - (unspec:VF_512 - [(match_operand:VF_512 1 "" "") +(define_insn "_rndscale" + [(set (match_operand:VF_AVX512VL 0 "register_operand" "=v") + (unspec:VF_AVX512VL + [(match_operand:VF_AVX512VL 1 "nonimmediate_operand" "") (match_operand:SI 2 "const_0_to_255_operand")] UNSPEC_ROUND))] "TARGET_AVX512F" @@ -16752,10 +16754,10 @@ (set_attr "memory" "none,load") (set_attr "mode" "")]) -(define_insn "avx512f_getmant" - [(set (match_operand:VF_512 0 "register_operand" "=v") - (unspec:VF_512 - [(match_operand:VF_512 1 "" "") +(define_insn "_getmant" + [(set (match_operand:VF_AVX512VL 0 "register_operand" "=v") + (unspec:VF_AVX512VL + [(match_operand:VF_AVX512VL 1 "nonimmediate_operand" "") (match_operand:SI 2 "const_0_to_15_operand")] UNSPEC_GETMANT))] "TARGET_AVX512F" @@ -16763,7 +16765,7 @@ [(set_attr "prefix" "evex") (set_attr "mode" "")]) -(define_insn "avx512f_getmant" +(define_insn "avx512f_vgetmant" [(set (match_operand:VF_128 0 "register_operand" "=v") (vec_merge:VF_128 (unspec:VF_128