From: Joern Rennecke Date: Fri, 11 Apr 2014 18:29:30 +0000 (+0000) Subject: epiphany.c (epiphany_rtx_cost): Compare with CC_N_NE / CC_C_LTU / CC_C_GTU carries... X-Git-Tag: releases/gcc-5.1.0~8172 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5d0ecea7981806ffb1277f3087b242104722d36;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 32ed05f44522..a9ecf69ac3cb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-04-11 Joern Rennecke + + * 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 PR rtl-optimization/60651 diff --git a/gcc/config/epiphany/epiphany.c b/gcc/config/epiphany/epiphany.c index 59b24107a689..8e45ea756d22 100644 --- a/gcc/config/epiphany/epiphany.c +++ b/gcc/config/epiphany/epiphany.c @@ -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; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e7f800a1cb1a..9c3c3e4bfcd0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2014-04-11 Joern Rennecke + + * gcc.target/epiphany/btst-1.c: New test. + 2014-04-11 Joern Rennecke PR rtl-optimization/60651 diff --git a/gcc/testsuite/gcc.target/epiphany/btst-1.c b/gcc/testsuite/gcc.target/epiphany/btst-1.c new file mode 100644 index 000000000000..b5667cce74c9 --- /dev/null +++ b/gcc/testsuite/gcc.target/epiphany/btst-1.c @@ -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; +}