diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2017-04-07 11:13:10 +0000 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@linaro.org> | 2017-04-07 11:13:10 +0000 |
commit | 4e405f1849587a25f5b44f4f99bb12e41669645d (patch) | |
tree | 24f75d220b87fdade92693bed4fb5779bc680f5f | |
parent | 8888e7889696a6323bf711c5cae0815d5856450a (diff) |
gcc/
Backport from trunk r246682.
2017-04-04 Thomas Preud'homme <thomas.preudhomme@arm.com>
PR target/80307
* config/arm/arm.c (thumb1_rtx_costs): Give a cost of 32
instructions for small multiply cores.
gcc/testsuite/
Backport from trunk r246682.
2017-04-04 Thomas Preud'homme <thomas.preudhomme@arm.com>
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.
Change-Id: I6916d48a0f747ff2efe0b907a966e5b7638c1c85
10 files changed, 12 insertions, 9 deletions
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 10897264227..fe1ffe1e0b0 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -8557,6 +8557,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/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 |