re PR target/70322 (STV doesn't optimize andn)

PR target/70322
	* config/i386/i386.c (dimode_scalar_to_vector_candidate_p): Handle NEG.
	(dimode_scalar_chain::compute_convert_gain): Ditto.
	(dimode_scalar_chain::convert_insn): Ditto.

testsuite/ChangeLog:

	PR target/70322
	* gcc.target/i386/pr70322-4.c: New test.

From-SVN: r243228
This commit is contained in:
Uros Bizjak 2016-12-04 15:38:05 +01:00
parent c818397a98
commit 6b7d845323
4 changed files with 39 additions and 3 deletions

View File

@ -1,10 +1,17 @@
2016-12-04 Uros Bizjak <ubizjak@gmail.com>
PR target/70322
* config/i386/i386.c (dimode_scalar_to_vector_candidate_p): Handle NEG.
(dimode_scalar_chain::compute_convert_gain): Ditto.
(dimode_scalar_chain::convert_insn): Ditto.
2016-12-03 Eric Botcazou <ebotcazou@adacore.com>
* lra-constraints.c (emit_spill_move): Use gen_lowpart_SUBREG in all
cases to build a lowpart SUBREG.
2016-12-03 Eric Botcazou <ebotcazou@adacore.com>
David S. Miller <davem@davemloft.net>
David S. Miller <davem@davemloft.net>
* config/sparc/constraints.md (U): Adjust comment.
* config/sparc/sparc.md (lra): New attribute.

View File

@ -2826,6 +2826,7 @@ dimode_scalar_to_vector_candidate_p (rtx_insn *insn)
return false;
break;
case NEG:
case NOT:
break;
@ -2851,7 +2852,8 @@ dimode_scalar_to_vector_candidate_p (rtx_insn *insn)
if ((GET_MODE (XEXP (src, 0)) != DImode
&& !CONST_INT_P (XEXP (src, 0)))
|| (GET_CODE (src) != NOT
|| (GET_CODE (src) != NEG
&& GET_CODE (src) != NOT
&& GET_MODE (XEXP (src, 1)) != DImode
&& !CONST_INT_P (XEXP (src, 1))))
return false;
@ -3419,7 +3421,8 @@ dimode_scalar_chain::compute_convert_gain ()
if (CONST_INT_P (XEXP (src, 1)))
gain -= vector_const_cost (XEXP (src, 1));
}
else if (GET_CODE (src) == NOT)
else if (GET_CODE (src) == NEG
|| GET_CODE (src) == NOT)
gain += ix86_cost->add - COSTS_N_INSNS (1);
else if (GET_CODE (src) == COMPARE)
{
@ -3776,6 +3779,14 @@ dimode_scalar_chain::convert_insn (rtx_insn *insn)
PUT_MODE (src, V2DImode);
break;
case NEG:
src = XEXP (src, 0);
convert_op (&src, insn);
subreg = gen_reg_rtx (V2DImode);
emit_insn_before (gen_move_insn (subreg, CONST0_RTX (V2DImode)), insn);
src = gen_rtx_MINUS (V2DImode, subreg, src);
break;
case NOT:
src = XEXP (src, 0);
convert_op (&src, insn);

View File

@ -1,3 +1,8 @@
2016-12-04 Uros Bizjak <ubizjak@gmail.com>
PR target/70322
* gcc.target/i386/pr70322-4.c: New test.
2016-12-03 Janus Weil <janus@gcc.gnu.org>
PR fortran/43207

View File

@ -0,0 +1,13 @@
/* PR target/70322 */
/* { dg-do compile { target ia32 } } */
/* { dg-options "-O2 -msse2 -mstv" } */
/* { dg-final { scan-assembler "psub" } } */
/* { dg-final { scan-assembler "por" } } */
extern long long z;
void
foo (long long x, long long y)
{
z = -x | y;
}