summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.8/0036-PR-target-56102.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.8/0036-PR-target-56102.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.8/0036-PR-target-56102.patch83
1 files changed, 83 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0036-PR-target-56102.patch b/meta/recipes-devtools/gcc/gcc-4.8/0036-PR-target-56102.patch
new file mode 100644
index 0000000000..a9498fcb7e
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0036-PR-target-56102.patch
@@ -0,0 +1,83 @@
1From fa049b3584a1cc36c250205e3d5841e6a40ff677 Mon Sep 17 00:00:00 2001
2From: amker <amker@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Wed, 27 Mar 2013 08:16:54 +0000
4Subject: [PATCH] PR target/56102
5
6* config/arm/arm.c (thumb1_rtx_costs, thumb1_size_rtx_costs): Fix rtx costs for SET/ASHIFT/ASHIFTRT/LSHIFTRT/ROTATERT patterns with mult-word mode.
7
8git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197155 138bc75d-0d04-0410-961f-82ee72b054a4
9
10Upstream-Status: Backport
11http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57329
12
13Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
14---
15 gcc/config/arm/arm.c | 17 ++++++++++++++---
16 1 file changed, 14 insertions(+), 3 deletions(-)
17
18diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
19index 460d333..edf850d 100644
20--- a/gcc/config/arm/arm.c
21+++ b/gcc/config/arm/arm.c
22@@ -7094,7 +7094,7 @@ static inline int
23 thumb1_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
24 {
25 enum machine_mode mode = GET_MODE (x);
26- int total;
27+ int total, words;
28
29 switch (code)
30 {
31@@ -7102,6 +7102,8 @@ thumb1_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
32 case ASHIFTRT:
33 case LSHIFTRT:
34 case ROTATERT:
35+ return (mode == SImode) ? COSTS_N_INSNS (1) : COSTS_N_INSNS (2);
36+
37 case PLUS:
38 case MINUS:
39 case COMPARE:
40@@ -7125,7 +7127,10 @@ thumb1_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
41 return COSTS_N_INSNS (1) + 16;
42
43 case SET:
44- return (COSTS_N_INSNS (1)
45+ /* A SET doesn't have a mode, so let's look at the SET_DEST to get
46+ the mode. */
47+ words = ARM_NUM_INTS (GET_MODE_SIZE (GET_MODE (SET_DEST (x))));
48+ return (COSTS_N_INSNS (words)
49 + 4 * ((MEM_P (SET_SRC (x)))
50 + MEM_P (SET_DEST (x))));
51
52@@ -7822,6 +7827,7 @@ static inline int
53 thumb1_size_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
54 {
55 enum machine_mode mode = GET_MODE (x);
56+ int words;
57
58 switch (code)
59 {
60@@ -7829,6 +7835,8 @@ thumb1_size_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
61 case ASHIFTRT:
62 case LSHIFTRT:
63 case ROTATERT:
64+ return (mode == SImode) ? COSTS_N_INSNS (1) : COSTS_N_INSNS (2);
65+
66 case PLUS:
67 case MINUS:
68 case COMPARE:
69@@ -7847,7 +7855,10 @@ thumb1_size_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
70 return COSTS_N_INSNS (1);
71
72 case SET:
73- return (COSTS_N_INSNS (1)
74+ /* A SET doesn't have a mode, so let's look at the SET_DEST to get
75+ the mode. */
76+ words = ARM_NUM_INTS (GET_MODE_SIZE (GET_MODE (SET_DEST (x))));
77+ return (COSTS_N_INSNS (words)
78 + 4 * ((MEM_P (SET_SRC (x)))
79 + MEM_P (SET_DEST (x))));
80
81--
821.8.2.1
83