re PR rtl-optimization/91154 (456.hmmer regression on Haswell caused by r272922)
authorRichard Biener <rguenther@suse.de>
Wed, 14 Aug 2019 12:04:05 +0000 (12:04 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 14 Aug 2019 12:04:05 +0000 (12:04 +0000)
commit93cf5515729f526761489ec3892c6f0ea0d7105b
tree4776032dfeba22334b1afe3a5c6ae1558ef7d899
parent1b187f36ec16d43d0227805955d8fae51af26970
re PR rtl-optimization/91154 (456.hmmer regression on Haswell caused by r272922)

2019-08-14  Richard Biener  <rguenther@suse.de>
        Uroš Bizjak  <ubizjak@gmail.com>

PR target/91154
* config/i386/i386-features.h (scalar_chain::scalar_chain): Add
mode arguments.
(scalar_chain::smode): New member.
(scalar_chain::vmode): Likewise.
(dimode_scalar_chain): Rename to...
(general_scalar_chain): ... this.
(general_scalar_chain::general_scalar_chain): Take mode arguments.
(timode_scalar_chain::timode_scalar_chain): Initialize scalar_chain
base with TImode and V1TImode.
* config/i386/i386-features.c (scalar_chain::scalar_chain): Adjust.
(general_scalar_chain::vector_const_cost): Adjust for SImode
chains.
(general_scalar_chain::compute_convert_gain): Likewise.  Add
{S,U}{MIN,MAX} support.
(general_scalar_chain::replace_with_subreg): Use vmode/smode.
(general_scalar_chain::make_vector_copies): Likewise.  Handle
non-DImode chains appropriately.
(general_scalar_chain::convert_reg): Likewise.
(general_scalar_chain::convert_op): Likewise.
(general_scalar_chain::convert_insn): Likewise.  Add
fatal_insn_not_found if the result is not recognized.
(convertible_comparison_p): Pass in the scalar mode and use that.
(general_scalar_to_vector_candidate_p): Likewise.  Rename from
dimode_scalar_to_vector_candidate_p.  Add {S,U}{MIN,MAX} support.
(scalar_to_vector_candidate_p): Remove by inlining into single
caller.
(general_remove_non_convertible_regs): Rename from
dimode_remove_non_convertible_regs.
(remove_non_convertible_regs): Remove by inlining into single caller.
(convert_scalars_to_vector): Handle SImode and DImode chains
in addition to TImode chains.
* config/i386/i386.md (<maxmin><MAXMIN_IMODE>3): New expander.
(*<maxmin><MAXMIN_IMODE>3_1): New insn-and-split.
(*<maxmin>di3_doubleword): Likewise.

* gcc.target/i386/pr91154.c: New testcase.
* gcc.target/i386/minmax-3.c: Likewise.
* gcc.target/i386/minmax-4.c: Likewise.
* gcc.target/i386/minmax-5.c: Likewise.
* gcc.target/i386/minmax-6.c: Likewise.
* gcc.target/i386/minmax-1.c: Add -mno-stv.
* gcc.target/i386/minmax-2.c: Likewise.

Co-Authored-By: Uros Bizjak <ubizjak@gmail.com>
From-SVN: r274481
12 files changed:
gcc/ChangeLog
gcc/config/i386/i386-features.c
gcc/config/i386/i386-features.h
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/minmax-1.c
gcc/testsuite/gcc.target/i386/minmax-2.c
gcc/testsuite/gcc.target/i386/minmax-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/minmax-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/minmax-5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/minmax-6.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr91154.c [new file with mode: 0644]