epiphany.c (epiphany_rtx_cost): Compare with CC_N_NE / CC_C_LTU / CC_C_GTU carries no extra cost for its operands.

gcc:
            * config/epiphany/epiphany.c (epiphany_rtx_cost): Compare
            with CC_N_NE / CC_C_LTU / CC_C_GTU carries no extra cost for
            its operands.
    gcc/testsuite:
            * gcc.target/epiphany/btst-1.c: New test.

From-SVN: r209319
This commit is contained in:
Joern Rennecke 2014-04-11 18:29:30 +00:00 committed by Joern Rennecke
parent 2a55e33d25
commit b5d0ecea79
4 changed files with 34 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2014-04-11 Joern Rennecke <joern.rennecke@embecosm.com>
* config/epiphany/epiphany.c (epiphany_rtx_cost): Compare
with CC_N_NE / CC_C_LTU / CC_C_GTU carries no extra cost for
its operands.
2014-04-11 Joern Rennecke <joern.rennecke@embecosm.com>
PR rtl-optimization/60651

View File

@ -763,6 +763,19 @@ epiphany_rtx_costs (rtx x, int code, int outer_code, int opno ATTRIBUTE_UNUSED,
*total = COSTS_N_INSNS (1);
return true;
case COMPARE:
switch (GET_MODE (x))
{
/* There are a number of single-insn combiner patterns that use
the flag side effects of arithmetic. */
case CC_N_NEmode:
case CC_C_LTUmode:
case CC_C_GTUmode:
return true;
default:
return false;
}
default:
return false;
}

View File

@ -1,3 +1,7 @@
2014-04-11 Joern Rennecke <joern.rennecke@embecosm.com>
* gcc.target/epiphany/btst-1.c: New test.
2014-04-11 Joern Rennecke <joern.rennecke@embecosm.com>
PR rtl-optimization/60651

View File

@ -0,0 +1,11 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fno-common" } */
/* { dg-final { scan-assembler-not "movt" } } */
/* { dg-final { scan-assembler-not "and" } } */
/* { dg-final { scan-assembler "lsl" } } */
int
tst (int i)
{
return (i & (1<<21)) ? 6 : 9;
}