From: Thomas Preud'homme Date: Tue, 4 Apr 2017 16:24:18 +0000 (+0000) Subject: [ARM] Fix small multiply feature X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a1527a93a6a7dcc031b917db1e6ff7efa8916c4a;p=gcc.git [ARM] Fix small multiply feature 2017-04-03 Thomas Preud'homme gcc/ PR target/80307 * config/arm/arm.c (thumb1_rtx_costs): Give a cost of 32 instructions for small multiply cores. gcc/testsuite/ PR target/80307 * gcc.target/arm/small-multiply-m0-1.c: Do not skip test if not targeting any CPU or architecture. * gcc.target/arm/small-multiply-m0-2.c: Likewise. * gcc.target/arm/small-multiply-m0-3.c: Likewise. * gcc.target/arm/small-multiply-m0plus-1.c: Likewise. * gcc.target/arm/small-multiply-m0plus-2.c: Likewise. * gcc.target/arm/small-multiply-m0plus-3.c: Likewise. * gcc.target/arm/small-multiply-m1-1.c: Likewise. * gcc.target/arm/small-multiply-m1-2.c: Likewise. * gcc.target/arm/small-multiply-m1-3.c: Likewise. From-SVN: r246682 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c2075882484..4136a2922b9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,10 +1,16 @@ +2017-04-04 Thomas Preud'homme + + PR target/80307 + * config/arm/arm.c (thumb1_rtx_costs): Give a cost of 32 + instructions for small multiply cores. + 2017-04-04 Jeff Law * config/mips/mips.c (mips_multi_add): Zero initialize the newly added member. (mips_expand_vec_perm_const): Initialize elements in orig_perm that are not set by the loop over the elements. - + 2017-04-04 Jakub Jelinek PR target/80286 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index bc1e607c42c..931c72d46f5 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -8727,6 +8727,9 @@ thumb1_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer) return COSTS_N_INSNS (1); case MULT: + if (arm_arch6m && arm_m_profile_small_mul) + return COSTS_N_INSNS (32); + if (CONST_INT_P (XEXP (x, 1))) { int cycles = 0; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2d5f91aa81e..0d5f12853d9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,17 @@ +2017-04-04 Thomas Preud'homme + + PR target/80307 + * gcc.target/arm/small-multiply-m0-1.c: Do not skip test if not + targeting any CPU or architecture. + * gcc.target/arm/small-multiply-m0-2.c: Likewise. + * gcc.target/arm/small-multiply-m0-3.c: Likewise. + * gcc.target/arm/small-multiply-m0plus-1.c: Likewise. + * gcc.target/arm/small-multiply-m0plus-2.c: Likewise. + * gcc.target/arm/small-multiply-m0plus-3.c: Likewise. + * gcc.target/arm/small-multiply-m1-1.c: Likewise. + * gcc.target/arm/small-multiply-m1-2.c: Likewise. + * gcc.target/arm/small-multiply-m1-3.c: Likewise. + 2017-04-04 Nicolas Koenig PR fortran/69498 diff --git a/gcc/testsuite/gcc.target/arm/small-multiply-m0-1.c b/gcc/testsuite/gcc.target/arm/small-multiply-m0-1.c index 49132e3e83d..52c652c1cba 100644 --- a/gcc/testsuite/gcc.target/arm/small-multiply-m0-1.c +++ b/gcc/testsuite/gcc.target/arm/small-multiply-m0-1.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_thumb1_ok } */ -/* { dg-skip-if "Test is specific to cortex-m0.small-multiply" { arm*-*-* } { "*" } { "-mcpu=cortex-m0.small-multiply" } } */ +/* { dg-skip-if "do not override -mcpu" { *-*-* } { "-mcpu=*" "-march=*" } { "-mcpu=cortex-m0.small-multiply" } } */ /* { dg-options "-mcpu=cortex-m0.small-multiply -mthumb -O2" } */ int diff --git a/gcc/testsuite/gcc.target/arm/small-multiply-m0-2.c b/gcc/testsuite/gcc.target/arm/small-multiply-m0-2.c index 7f1bf7bd604..10d49e9eace 100644 --- a/gcc/testsuite/gcc.target/arm/small-multiply-m0-2.c +++ b/gcc/testsuite/gcc.target/arm/small-multiply-m0-2.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_thumb1_ok } */ -/* { dg-skip-if "Test is specific to cortex-m0.small-multiply" { arm*-*-* } { "*" } { "-mcpu=cortex-m0.small-multiply" } } */ +/* { dg-skip-if "do not override -mcpu" { *-*-* } { "-mcpu=*" "-march=*" } { "-mcpu=cortex-m0.small-multiply" } } */ /* { dg-options "-mcpu=cortex-m0.small-multiply -mthumb -Os" } */ int diff --git a/gcc/testsuite/gcc.target/arm/small-multiply-m0-3.c b/gcc/testsuite/gcc.target/arm/small-multiply-m0-3.c index aca39d746dc..b4af511af86 100644 --- a/gcc/testsuite/gcc.target/arm/small-multiply-m0-3.c +++ b/gcc/testsuite/gcc.target/arm/small-multiply-m0-3.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_thumb1_ok } */ -/* { dg-skip-if "Test is specific to cortex-m0.small-multiply" { arm*-*-* } { "*" } { "-mcpu=cortex-m0.small-multiply" } } */ +/* { dg-skip-if "do not override -mcpu" { *-*-* } { "-mcpu=*" "-march=*" } { "-mcpu=cortex-m0.small-multiply" } } */ /* { dg-options "-mcpu=cortex-m0.small-multiply -mthumb -Os" } */ int diff --git a/gcc/testsuite/gcc.target/arm/small-multiply-m0plus-1.c b/gcc/testsuite/gcc.target/arm/small-multiply-m0plus-1.c index 12e8839753c..59dba7cf4ab 100644 --- a/gcc/testsuite/gcc.target/arm/small-multiply-m0plus-1.c +++ b/gcc/testsuite/gcc.target/arm/small-multiply-m0plus-1.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_thumb1_ok } */ -/* { dg-skip-if "Test is specific to cortex-m0plus.small-multiply" { arm*-*-* } { "*" } { "-mcpu=cortex-m0plus.small-multiply" } } */ +/* { dg-skip-if "do not override -mcpu" { *-*-* } { "-mcpu=*" "-march=*" } { "-mcpu=cortex-m0plus.small-multiply" } } */ /* { dg-options "-mcpu=cortex-m0plus.small-multiply -mthumb -O2" } */ int diff --git a/gcc/testsuite/gcc.target/arm/small-multiply-m0plus-2.c b/gcc/testsuite/gcc.target/arm/small-multiply-m0plus-2.c index 3e3c9b26e3c..685ef440776 100644 --- a/gcc/testsuite/gcc.target/arm/small-multiply-m0plus-2.c +++ b/gcc/testsuite/gcc.target/arm/small-multiply-m0plus-2.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_thumb1_ok } */ -/* { dg-skip-if "Test is specific to cortex-m0plus.small-multiply" { arm*-*-* } { "*" } { "-mcpu=cortex-m0plus.small-multiply" } } */ +/* { dg-skip-if "do not override -mcpu" { *-*-* } { "-mcpu=*" "-march=*" } { "-mcpu=cortex-m0plus.small-multiply" } } */ /* { dg-options "-mcpu=cortex-m0plus.small-multiply -mthumb -Os" } */ int diff --git a/gcc/testsuite/gcc.target/arm/small-multiply-m0plus-3.c b/gcc/testsuite/gcc.target/arm/small-multiply-m0plus-3.c index 75e34321ec2..d24e720fe67 100644 --- a/gcc/testsuite/gcc.target/arm/small-multiply-m0plus-3.c +++ b/gcc/testsuite/gcc.target/arm/small-multiply-m0plus-3.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_thumb1_ok } */ -/* { dg-skip-if "Test is specific to cortex-m0plus.small-multiply" { arm*-*-* } { "*" } { "-mcpu=cortex-m0plus.small-multiply" } } */ +/* { dg-skip-if "do not override -mcpu" { *-*-* } { "-mcpu=*" "-march=*" } { "-mcpu=cortex-m0plus.small-multiply" } } */ /* { dg-options "-mcpu=cortex-m0plus.small-multiply -mthumb -Os" } */ int diff --git a/gcc/testsuite/gcc.target/arm/small-multiply-m1-1.c b/gcc/testsuite/gcc.target/arm/small-multiply-m1-1.c index fbe90cc4a54..d966ae955ce 100644 --- a/gcc/testsuite/gcc.target/arm/small-multiply-m1-1.c +++ b/gcc/testsuite/gcc.target/arm/small-multiply-m1-1.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_thumb1_ok } */ -/* { dg-skip-if "Test is specific to cortex-m1.small-multiply" { arm*-*-* } { "*" } { "-mcpu=cortex-m1.small-multiply" } } */ +/* { dg-skip-if "do not override -mcpu" { *-*-* } { "-mcpu=*" "-march=*" } { "-mcpu=cortex-m1.small-multiply" } } */ /* { dg-options "-mcpu=cortex-m1.small-multiply -mthumb -O2" } */ int diff --git a/gcc/testsuite/gcc.target/arm/small-multiply-m1-2.c b/gcc/testsuite/gcc.target/arm/small-multiply-m1-2.c index 6fca40564ee..60576bb9ed1 100644 --- a/gcc/testsuite/gcc.target/arm/small-multiply-m1-2.c +++ b/gcc/testsuite/gcc.target/arm/small-multiply-m1-2.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_thumb1_ok } */ -/* { dg-skip-if "Test is specific to cortex-m1.small-multiply" { arm*-*-* } { "*" } { "-mcpu=cortex-m1.small-multiply" } } */ +/* { dg-skip-if "do not override -mcpu" { *-*-* } { "-mcpu=*" "-march=*" } { "-mcpu=cortex-m1.small-multiply" } } */ /* { dg-options "-mcpu=cortex-m1.small-multiply -mthumb -Os" } */ int diff --git a/gcc/testsuite/gcc.target/arm/small-multiply-m1-3.c b/gcc/testsuite/gcc.target/arm/small-multiply-m1-3.c index bc732c32346..c56479d1897 100644 --- a/gcc/testsuite/gcc.target/arm/small-multiply-m1-3.c +++ b/gcc/testsuite/gcc.target/arm/small-multiply-m1-3.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_thumb1_ok } */ -/* { dg-skip-if "Test is specific to cortex-m1.small-multiply" { arm*-*-* } { "*" } { "-mcpu=cortex-m1.small-multiply" } } */ +/* { dg-skip-if "do not override -mcpu" { *-*-* } { "-mcpu=*" "-march=*" } { "-mcpu=cortex-m1.small-multiply" } } */ /* { dg-options "-mcpu=cortex-m1.small-multiply -mthumb -Os" } */ int