summaryrefslogtreecommitdiffstats
path: root/meta/packages/gcc/gcc-4.2.3/arm-crunch-saveregs.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/gcc/gcc-4.2.3/arm-crunch-saveregs.patch')
-rw-r--r--meta/packages/gcc/gcc-4.2.3/arm-crunch-saveregs.patch153
1 files changed, 153 insertions, 0 deletions
diff --git a/meta/packages/gcc/gcc-4.2.3/arm-crunch-saveregs.patch b/meta/packages/gcc/gcc-4.2.3/arm-crunch-saveregs.patch
new file mode 100644
index 0000000000..531ae86610
--- /dev/null
+++ b/meta/packages/gcc/gcc-4.2.3/arm-crunch-saveregs.patch
@@ -0,0 +1,153 @@
1diff -ruN /home/hwilliams/openembedded/build/tmp/work/ep9312-angstrom-linux-gnueabi/gcc-cross-4.1.2-r0/gcc-4.1.2/gcc/config/arm/arm.c gcc-4.1.2/gcc/config/arm/arm.c
2--- /home/hwilliams/openembedded/build/tmp/work/ep9312-angstrom-linux-gnueabi/gcc-cross-4.1.2-r0/gcc-4.1.2/gcc/config/arm/arm.c 2007-05-09 16:32:29.000000000 +1000
3+++ gcc-4.1.2/gcc/config/arm/arm.c 2007-05-15 09:39:41.000000000 +1000
4@@ -426,7 +435,7 @@
5 #define FL_STRONG (1 << 8) /* StrongARM */
6 #define FL_ARCH5E (1 << 9) /* DSP extensions to v5 */
7 #define FL_XSCALE (1 << 10) /* XScale */
8-#define FL_CIRRUS (1 << 11) /* Cirrus/DSP. */
9+#define FL_CIRRUS (1 << 11) /* Cirrus Crunch coprocessor. */
10 #define FL_ARCH6 (1 << 12) /* Architecture rel 6. Adds
11 media instructions. */
12 #define FL_VFPV2 (1 << 13) /* Vector Floating Point V2. */
13@@ -490,7 +499,7 @@
14 /* Nonzero if this chip is a StrongARM. */
15 int arm_tune_strongarm = 0;
16
17-/* Nonzero if this chip is a Cirrus variant. */
18+/* Nonzero if this chip supports Cirrus Crunch coprocessor. */
19 int arm_arch_cirrus = 0;
20
21 /* Nonzero if this chip supports Intel Wireless MMX technology. */
22@@ -1184,7 +1193,8 @@
23 else
24 */
25 if (arm_arch_cirrus)
26- arm_fpu_arch = FPUTYPE_MAVERICK;
27+ /* Cirrus crunch coprocessor still requires soft-float division. */
28+ arm_fpu_arch = FPUTYPE_MAVERICK;
29 else
30 arm_fpu_arch = FPUTYPE_FPA_EMU2;
31 #endif
32@@ -1567,6 +1577,9 @@
33 if (regs_ever_live[regno] && !call_used_regs[regno])
34 return 0;
35
36+ if (TARGET_MAVERICK)
37+ return 0;
38+
39 if (TARGET_REALLY_IWMMXT)
40 for (regno = FIRST_IWMMXT_REGNUM; regno <= LAST_IWMMXT_REGNUM; regno++)
41 if (regs_ever_live[regno] && ! call_used_regs [regno])
42@@ -9775,7 +9886,19 @@
43 /* This variable is for the Virtual Frame Pointer, not VFP regs. */
44 int vfp_offset = offsets->frame;
45
46- if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
47+ if (arm_fpu_arch == FPUTYPE_MAVERICK)
48+ {
49+ for (reg = LAST_CIRRUS_FP_REGNUM; reg >= FIRST_CIRRUS_FP_REGNUM; reg--)
50+ if (regs_ever_live[reg] && !call_used_regs[reg])
51+ {
52+ floats_offset += 8; /* more problems - futaris? */
53+ /* if (TARGET_CIRRUS_D0 || TARGET_CIRRUS_D1) */
54+ asm_fprintf (f, "\tnop\n");
55+ asm_fprintf (f, "\tcfldrd\tmvd%d, [%r, #-%d]\n",
56+ reg - FIRST_CIRRUS_FP_REGNUM, FP_REGNUM, floats_offset - vfp_offset);
57+ }
58+ }
59+ else if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
60 {
61 for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--)
62 if (regs_ever_live[reg] && !call_used_regs[reg])
63@@ -9924,7 +10047,18 @@
64 output_add_immediate (operands);
65 }
66
67- if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
68+ if (arm_fpu_arch == FPUTYPE_MAVERICK)
69+ { /* order changed - futaris */
70+ for (reg = FIRST_CIRRUS_FP_REGNUM; reg <= LAST_CIRRUS_FP_REGNUM; reg++)
71+ if (regs_ever_live[reg] && !call_used_regs[reg])
72+ {
73+ /* if (TARGET_CIRRUS_D0 || TARGET_CIRRUS_D1) */
74+ asm_fprintf (f, "\tnop\n");
75+ asm_fprintf (f, "\tcfldrd\tmvd%u, [%r], #8\n",
76+ reg - FIRST_CIRRUS_FP_REGNUM, SP_REGNUM);
77+ } /* reg problems - futaris */
78+ }
79+ else if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
80 {
81 for (reg = FIRST_FPA_REGNUM; reg <= LAST_FPA_REGNUM; reg++)
82 if (regs_ever_live[reg] && !call_used_regs[reg])
83@@ -10429,9 +10563,19 @@
84 if (! IS_VOLATILE (func_type))
85 {
86+ /* Space for saved MAVERICK registers. */
87+ if (arm_fpu_arch == FPUTYPE_MAVERICK)
88+ {
89+ for (regno = FIRST_CIRRUS_FP_REGNUM; regno <= LAST_CIRRUS_FP_REGNUM; regno++)
90+ if (regs_ever_live[regno] && !call_used_regs[regno])
91+ saved += 8; // 8 in 3.4.3 patch - futaris;
92+ }
93+ else
94 /* Space for saved FPA registers. */
95+ {
96 for (regno = FIRST_FPA_REGNUM; regno <= LAST_FPA_REGNUM; regno++)
97 if (regs_ever_live[regno] && ! call_used_regs[regno])
98 saved += 12;
99+ }
100
101 /* Space for saved VFP registers. */
102 if (TARGET_HARD_FLOAT && TARGET_VFP)
103@@ -10739,7 +10882,19 @@
104
105 /* Save any floating point call-saved registers used by this
106 function. */
107- if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
108+ if (arm_fpu_arch == FPUTYPE_MAVERICK)
109+ {
110+ for (reg = LAST_CIRRUS_FP_REGNUM; reg >= FIRST_CIRRUS_FP_REGNUM; reg--)
111+ if (regs_ever_live[reg] && !call_used_regs[reg])
112+ {
113+ insn = gen_rtx_PRE_DEC (DFmode, stack_pointer_rtx); /* think these causes problems */
114+ insn = gen_rtx_MEM (DFmode, insn);
115+ insn = emit_insn (gen_rtx_SET (VOIDmode, insn,
116+ gen_rtx_REG (DFmode, reg)));
117+ RTX_FRAME_RELATED_P (insn) = 1; saved_regs += 8; /* added by futaris */
118+ }
119+ }
120+ else if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
121 {
122 for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--)
123 if (regs_ever_live[reg] && !call_used_regs[reg])
124@@ -15179,6 +15331,9 @@
125 if (IS_FPA_REGNUM (regno))
126 return (TARGET_AAPCS_BASED ? 96 : 16) + regno - FIRST_FPA_REGNUM;
127
128+ if (IS_CIRRUS_REGNUM (regno))
129+ return 28 + regno - FIRST_CIRRUS_FP_REGNUM;
130+
131 if (IS_VFP_REGNUM (regno))
132 return 64 + regno - FIRST_VFP_REGNUM;
133
134--- gcc-4.1.2/gcc/config/arm/arm.md-original 2007-06-28 15:42:36.000000000 +1000
135+++ gcc-4.1.2/gcc/config/arm/arm.md 2007-06-28 15:42:48.000000000 +1000
136@@ -9800,7 +9800,7 @@
137 return arm_output_epilogue (next_nonnote_insn (insn));
138 "
139 ;; Length is absolute worst case
140- [(set_attr "length" "44")
141+ [(set_attr "length" "108")
142 (set_attr "type" "block")
143 ;; We don't clobber the conditions, but the potential length of this
144 ;; operation is sufficient to make conditionalizing the sequence
145@@ -9818,7 +9818,7 @@
146 return thumb_unexpanded_epilogue ();
147 "
148 ; Length is absolute worst case
149- [(set_attr "length" "44")
150+ [(set_attr "length" "108")
151 (set_attr "type" "block")
152 ;; We don't clobber the conditions, but the potential length of this
153 ;; operation is sufficient to make conditionalizing the sequence