1 |
halcy0n 08/11/23 00:50:06 |
2 |
|
3 |
Modified: README.history |
4 |
Added: |
5 |
77_all_mips-r10k-support-for-atomic-memory-fixes.patch |
6 |
Log: |
7 |
Add patch from bug #247129; thanks to Joshua Kinard <kumba AT gentoo DOT org> |
8 |
|
9 |
Revision Changes Path |
10 |
1.3 src/patchsets/gcc/4.3.2/gentoo/README.history |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.3.2/gentoo/README.history?rev=1.3&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.3.2/gentoo/README.history?rev=1.3&content-type=text/plain |
14 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.3.2/gentoo/README.history?r1=1.2&r2=1.3 |
15 |
|
16 |
Index: README.history |
17 |
=================================================================== |
18 |
RCS file: /var/cvsroot/gentoo/src/patchsets/gcc/4.3.2/gentoo/README.history,v |
19 |
retrieving revision 1.2 |
20 |
retrieving revision 1.3 |
21 |
diff -u -r1.2 -r1.3 |
22 |
--- README.history 25 Oct 2008 20:36:06 -0000 1.2 |
23 |
+++ README.history 23 Nov 2008 00:50:06 -0000 1.3 |
24 |
@@ -1,3 +1,6 @@ |
25 |
+1.2 22.11.2008 |
26 |
+ + 77_all_mips-r10k-support-for-atomic-memory-fixes.patch |
27 |
+ |
28 |
1.1 25.10.2008 |
29 |
+ 75_all_mips-r10k-cache-barriers.patch |
30 |
+ 76_all_mips-r10k-scheduling-support.patch |
31 |
|
32 |
|
33 |
|
34 |
1.1 src/patchsets/gcc/4.3.2/gentoo/77_all_mips-r10k-support-for-atomic-memory-fixes.patch |
35 |
|
36 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.3.2/gentoo/77_all_mips-r10k-support-for-atomic-memory-fixes.patch?rev=1.1&view=markup |
37 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.3.2/gentoo/77_all_mips-r10k-support-for-atomic-memory-fixes.patch?rev=1.1&content-type=text/plain |
38 |
|
39 |
Index: 77_all_mips-r10k-support-for-atomic-memory-fixes.patch |
40 |
=================================================================== |
41 |
diff -Naurp gcc-4.3.2.orig/gcc/config/mips/mips-protos.h gcc-4.3.2/gcc/config/mips/mips-protos.h |
42 |
--- gcc-4.3.2.orig/gcc/config/mips/mips-protos.h 2008-01-26 05:22:14.000000000 -0500 |
43 |
+++ gcc-4.3.2/gcc/config/mips/mips-protos.h 2008-11-16 02:08:09.000000000 -0500 |
44 |
@@ -278,6 +278,7 @@ extern const char *mips_output_load_labe |
45 |
extern const char *mips_output_conditional_branch (rtx, rtx *, const char *, |
46 |
const char *); |
47 |
extern const char *mips_output_order_conditional_branch (rtx, rtx *, bool); |
48 |
+extern const char *mips_output_sync_loop (const char *); |
49 |
extern const char *mips_output_division (const char *, rtx *); |
50 |
extern unsigned int mips_hard_regno_nregs (int, enum machine_mode); |
51 |
extern bool mips_linked_madd_p (rtx, rtx); |
52 |
diff -Naurp gcc-4.3.2.orig/gcc/config/mips/mips.c gcc-4.3.2/gcc/config/mips/mips.c |
53 |
--- gcc-4.3.2.orig/gcc/config/mips/mips.c 2008-11-16 01:57:14.000000000 -0500 |
54 |
+++ gcc-4.3.2/gcc/config/mips/mips.c 2008-11-16 02:09:37.000000000 -0500 |
55 |
@@ -6253,6 +6253,7 @@ mips_print_operand_reloc (FILE *file, rt |
56 |
'#' Print a nop if in a ".set noreorder" block. |
57 |
'/' Like '#', but do nothing within a delayed-branch sequence. |
58 |
'?' Print "l" if mips_branch_likely is true |
59 |
+ '~' Print a nop if mips_branch_likely is true |
60 |
'.' Print the name of the register with a hard-wired zero (zero or $0). |
61 |
'@' Print the name of the assembler temporary register (at or $1). |
62 |
'^' Print the name of the pic call-through register (t9 or $25). |
63 |
@@ -6327,6 +6328,11 @@ mips_print_operand_punctuation (FILE *fi |
64 |
putc ('l', file); |
65 |
break; |
66 |
|
67 |
+ case '~': |
68 |
+ if (mips_branch_likely) |
69 |
+ fputs ("\n\tnop", file); |
70 |
+ break; |
71 |
+ |
72 |
case '.': |
73 |
fputs (reg_names[GP_REG_FIRST + 0], file); |
74 |
break; |
75 |
@@ -6370,7 +6376,7 @@ mips_init_print_operand_punct (void) |
76 |
{ |
77 |
const char *p; |
78 |
|
79 |
- for (p = "()[]<>*#/?.@^+$|-"; *p; p++) |
80 |
+ for (p = "()[]<>*#/?~.@^+$|-"; *p; p++) |
81 |
mips_print_operand_punct[(unsigned char) *p] = true; |
82 |
} |
83 |
|
84 |
@@ -9375,6 +9381,17 @@ mips_output_order_conditional_branch (rt |
85 |
return mips_output_conditional_branch (insn, operands, branch[1], branch[0]); |
86 |
} |
87 |
|
88 |
+/* Return the assembly code for __sync_*() loop LOOP. The loop should support |
89 |
+ both normal and likely branches, using %? and %~ where appropriate. */ |
90 |
+ |
91 |
+const char * |
92 |
+mips_output_sync_loop (const char *loop) |
93 |
+{ |
94 |
+ /* Use branch-likely instructions to work around the LL/SC R10000 errata. */ |
95 |
+ mips_branch_likely = TARGET_FIX_R10000; |
96 |
+ return loop; |
97 |
+} |
98 |
+ |
99 |
/* Return the assembly code for DIV or DDIV instruction DIVISION, which has |
100 |
the operands given by OPERANDS. Add in a divide-by-zero check if needed. |
101 |
|
102 |
@@ -12710,6 +12727,24 @@ mips_override_options (void) |
103 |
&& mips_matching_cpu_name_p (mips_arch_info->name, "r4400")) |
104 |
target_flags |= MASK_FIX_R4400; |
105 |
|
106 |
+ /* Default to working around R10000 errata only if the processor |
107 |
+ was selected explicitly. */ |
108 |
+ if ((target_flags_explicit & MASK_FIX_R10000) == 0 |
109 |
+ && mips_matching_cpu_name_p (mips_arch_info->name, "r10000")) |
110 |
+ target_flags |= MASK_FIX_R10000; |
111 |
+ |
112 |
+ /* Make sure that branch-likely instructions available when using |
113 |
+ -mfix-r10000. The instructions are not available if either: |
114 |
+ |
115 |
+ 1. -mno-branch-likely was passed. |
116 |
+ 2. The selected ISA does not support branch-likely and |
117 |
+ the command line does not include -mbranch-likely. */ |
118 |
+ if (TARGET_FIX_R10000 |
119 |
+ && ((target_flags_explicit & MASK_BRANCHLIKELY) == 0 |
120 |
+ ? !ISA_HAS_BRANCHLIKELY |
121 |
+ : !TARGET_BRANCHLIKELY)) |
122 |
+ sorry ("%qs requires branch-likely instructions", "-mfix-r10000"); |
123 |
+ |
124 |
/* Save base state of options. */ |
125 |
mips_base_mips16 = TARGET_MIPS16; |
126 |
mips_base_target_flags = target_flags; |
127 |
diff -Naurp gcc-4.3.2.orig/gcc/config/mips/mips.h gcc-4.3.2/gcc/config/mips/mips.h |
128 |
--- gcc-4.3.2.orig/gcc/config/mips/mips.h 2008-11-16 01:57:14.000000000 -0500 |
129 |
+++ gcc-4.3.2/gcc/config/mips/mips.h 2008-11-16 02:11:20.000000000 -0500 |
130 |
@@ -2911,7 +2911,7 @@ while (0) |
131 |
"\tbne\t%0,%z2,2f\n" \ |
132 |
"\t" OP "\t%@,%3\n" \ |
133 |
"\tsc" SUFFIX "\t%@,%1\n" \ |
134 |
- "\tbeq\t%@,%.,1b\n" \ |
135 |
+ "\tbeq%?\t%@,%.,1b\n" \ |
136 |
"\tnop\n" \ |
137 |
"2:\tsync%-%]%>%)" |
138 |
|
139 |
@@ -2926,7 +2926,7 @@ while (0) |
140 |
"1:\tll" SUFFIX "\t%@,%0\n" \ |
141 |
"\t" INSN "\t%@,%@,%1\n" \ |
142 |
"\tsc" SUFFIX "\t%@,%0\n" \ |
143 |
- "\tbeq\t%@,%.,1b\n" \ |
144 |
+ "\tbeq%?\t%@,%.,1b\n" \ |
145 |
"\tnop\n" \ |
146 |
"\tsync%-%]%>%)" |
147 |
|
148 |
@@ -2943,7 +2943,7 @@ while (0) |
149 |
"1:\tll" SUFFIX "\t%0,%1\n" \ |
150 |
"\t" INSN "\t%@,%0,%2\n" \ |
151 |
"\tsc" SUFFIX "\t%@,%1\n" \ |
152 |
- "\tbeq\t%@,%.,1b\n" \ |
153 |
+ "\tbeq%?\t%@,%.,1b\n" \ |
154 |
"\tnop\n" \ |
155 |
"\tsync%-%]%>%)" |
156 |
|
157 |
@@ -2960,7 +2960,7 @@ while (0) |
158 |
"1:\tll" SUFFIX "\t%0,%1\n" \ |
159 |
"\t" INSN "\t%@,%0,%2\n" \ |
160 |
"\tsc" SUFFIX "\t%@,%1\n" \ |
161 |
- "\tbeq\t%@,%.,1b\n" \ |
162 |
+ "\tbeq%?\t%@,%.,1b%~\n" \ |
163 |
"\t" INSN "\t%0,%0,%2\n" \ |
164 |
"\tsync%-%]%>%)" |
165 |
|
166 |
@@ -2977,7 +2977,7 @@ while (0) |
167 |
"\tnor\t%@,%@,%.\n" \ |
168 |
"\t" INSN "\t%@,%@,%1\n" \ |
169 |
"\tsc" SUFFIX "\t%@,%0\n" \ |
170 |
- "\tbeq\t%@,%.,1b\n" \ |
171 |
+ "\tbeq%?\t%@,%.,1b\n" \ |
172 |
"\tnop\n" \ |
173 |
"\tsync%-%]%>%)" |
174 |
|
175 |
@@ -2996,7 +2996,7 @@ while (0) |
176 |
"\tnor\t%@,%0,%.\n" \ |
177 |
"\t" INSN "\t%@,%@,%2\n" \ |
178 |
"\tsc" SUFFIX "\t%@,%1\n" \ |
179 |
- "\tbeq\t%@,%.,1b\n" \ |
180 |
+ "\tbeq%?\t%@,%.,1b\n" \ |
181 |
"\tnop\n" \ |
182 |
"\tsync%-%]%>%)" |
183 |
|
184 |
@@ -3015,7 +3015,7 @@ while (0) |
185 |
"\tnor\t%0,%0,%.\n" \ |
186 |
"\t" INSN "\t%@,%0,%2\n" \ |
187 |
"\tsc" SUFFIX "\t%@,%1\n" \ |
188 |
- "\tbeq\t%@,%.,1b\n" \ |
189 |
+ "\tbeq%?\t%@,%.,1b%~\n" \ |
190 |
"\t" INSN "\t%0,%0,%2\n" \ |
191 |
"\tsync%-%]%>%)" |
192 |
|
193 |
@@ -3033,7 +3033,7 @@ while (0) |
194 |
"1:\tll" SUFFIX "\t%0,%1\n" \ |
195 |
"\t" OP "\t%@,%2\n" \ |
196 |
"\tsc" SUFFIX "\t%@,%1\n" \ |
197 |
- "\tbeq\t%@,%.,1b\n" \ |
198 |
+ "\tbeq%?\t%@,%.,1b\n" \ |
199 |
"\tnop\n" \ |
200 |
"\tsync%-%]%>%)" |
201 |
|
202 |
diff -Naurp gcc-4.3.2.orig/gcc/config/mips/mips.md gcc-4.3.2/gcc/config/mips/mips.md |
203 |
--- gcc-4.3.2.orig/gcc/config/mips/mips.md 2008-11-16 01:57:14.000000000 -0500 |
204 |
+++ gcc-4.3.2/gcc/config/mips/mips.md 2008-11-16 02:17:30.000000000 -0500 |
205 |
@@ -4449,9 +4449,9 @@ |
206 |
"GENERATE_LL_SC" |
207 |
{ |
208 |
if (which_alternative == 0) |
209 |
- return MIPS_COMPARE_AND_SWAP ("<d>", "li"); |
210 |
+ return mips_output_sync_loop (MIPS_COMPARE_AND_SWAP ("<d>", "li")); |
211 |
else |
212 |
- return MIPS_COMPARE_AND_SWAP ("<d>", "move"); |
213 |
+ return mips_output_sync_loop (MIPS_COMPARE_AND_SWAP ("<d>", "move")); |
214 |
} |
215 |
[(set_attr "length" "32")]) |
216 |
|
217 |
@@ -4464,9 +4464,9 @@ |
218 |
"GENERATE_LL_SC" |
219 |
{ |
220 |
if (which_alternative == 0) |
221 |
- return MIPS_SYNC_OP ("<d>", "<d>addiu"); |
222 |
+ return mips_output_sync_loop (MIPS_SYNC_OP ("<d>", "<d>addiu")); |
223 |
else |
224 |
- return MIPS_SYNC_OP ("<d>", "<d>addu"); |
225 |
+ return mips_output_sync_loop (MIPS_SYNC_OP ("<d>", "<d>addu")); |
226 |
} |
227 |
[(set_attr "length" "28")]) |
228 |
|
229 |
@@ -4478,7 +4478,7 @@ |
230 |
UNSPEC_SYNC_OLD_OP))] |
231 |
"GENERATE_LL_SC" |
232 |
{ |
233 |
- return MIPS_SYNC_OP ("<d>", "<d>subu"); |
234 |
+ return mips_output_sync_loop (MIPS_SYNC_OP ("<d>", "<d>subu")); |
235 |
} |
236 |
[(set_attr "length" "28")]) |
237 |
|
238 |
@@ -4493,9 +4493,9 @@ |
239 |
"GENERATE_LL_SC" |
240 |
{ |
241 |
if (which_alternative == 0) |
242 |
- return MIPS_SYNC_OLD_OP ("<d>", "<d>addiu"); |
243 |
+ return mips_output_sync_loop (MIPS_SYNC_OLD_OP ("<d>", "<d>addiu")); |
244 |
else |
245 |
- return MIPS_SYNC_OLD_OP ("<d>", "<d>addu"); |
246 |
+ return mips_output_sync_loop (MIPS_SYNC_OLD_OP ("<d>", "<d>addu")); |
247 |
} |
248 |
[(set_attr "length" "28")]) |
249 |
|
250 |
@@ -4509,7 +4509,7 @@ |
251 |
UNSPEC_SYNC_OLD_OP))] |
252 |
"GENERATE_LL_SC" |
253 |
{ |
254 |
- return MIPS_SYNC_OLD_OP ("<d>", "<d>subu"); |
255 |
+ return mips_output_sync_loop (MIPS_SYNC_OLD_OP ("<d>", "<d>subu")); |
256 |
} |
257 |
[(set_attr "length" "28")]) |
258 |
|
259 |
@@ -4524,9 +4524,9 @@ |
260 |
"GENERATE_LL_SC" |
261 |
{ |
262 |
if (which_alternative == 0) |
263 |
- return MIPS_SYNC_NEW_OP ("<d>", "<d>addiu"); |
264 |
+ return mips_output_sync_loop (MIPS_SYNC_NEW_OP ("<d>", "<d>addiu")); |
265 |
else |
266 |
- return MIPS_SYNC_NEW_OP ("<d>", "<d>addu"); |
267 |
+ return mips_output_sync_loop (MIPS_SYNC_NEW_OP ("<d>", "<d>addu")); |
268 |
} |
269 |
[(set_attr "length" "28")]) |
270 |
|
271 |
@@ -4540,7 +4540,7 @@ |
272 |
UNSPEC_SYNC_NEW_OP))] |
273 |
"GENERATE_LL_SC" |
274 |
{ |
275 |
- return MIPS_SYNC_NEW_OP ("<d>", "<d>subu"); |
276 |
+ return mips_output_sync_loop (MIPS_SYNC_NEW_OP ("<d>", "<d>subu")); |
277 |
} |
278 |
[(set_attr "length" "28")]) |
279 |
|
280 |
@@ -4553,9 +4553,9 @@ |
281 |
"GENERATE_LL_SC" |
282 |
{ |
283 |
if (which_alternative == 0) |
284 |
- return MIPS_SYNC_OP ("<d>", "<immediate_insn>"); |
285 |
+ return mips_output_sync_loop (MIPS_SYNC_OP ("<d>", "<immediate_insn>")); |
286 |
else |
287 |
- return MIPS_SYNC_OP ("<d>", "<insn>"); |
288 |
+ return mips_output_sync_loop (MIPS_SYNC_OP ("<d>", "<insn>")); |
289 |
} |
290 |
[(set_attr "length" "28")]) |
291 |
|
292 |
@@ -4570,9 +4570,9 @@ |
293 |
"GENERATE_LL_SC" |
294 |
{ |
295 |
if (which_alternative == 0) |
296 |
- return MIPS_SYNC_OLD_OP ("<d>", "<immediate_insn>"); |
297 |
+ return mips_output_sync_loop (MIPS_SYNC_OLD_OP ("<d>", "<immediate_insn>")); |
298 |
else |
299 |
- return MIPS_SYNC_OLD_OP ("<d>", "<insn>"); |
300 |
+ return mips_output_sync_loop (MIPS_SYNC_OLD_OP ("<d>", "<insn>")); |
301 |
} |
302 |
[(set_attr "length" "28")]) |
303 |
|
304 |
@@ -4587,9 +4587,10 @@ |
305 |
"GENERATE_LL_SC" |
306 |
{ |
307 |
if (which_alternative == 0) |
308 |
- return MIPS_SYNC_NEW_OP ("<d>", "<immediate_insn>"); |
309 |
+ return (mips_output_sync_loop |
310 |
+ (MIPS_SYNC_NEW_OP ("<d>", "<immediate_insn>"))); |
311 |
else |
312 |
- return MIPS_SYNC_NEW_OP ("<d>", "<insn>"); |
313 |
+ return mips_output_sync_loop (MIPS_SYNC_NEW_OP ("<d>", "<insn>")); |
314 |
} |
315 |
[(set_attr "length" "28")]) |
316 |
|
317 |
@@ -4600,9 +4601,9 @@ |
318 |
"GENERATE_LL_SC" |
319 |
{ |
320 |
if (which_alternative == 0) |
321 |
- return MIPS_SYNC_NAND ("<d>", "andi"); |
322 |
+ return mips_output_sync_loop (MIPS_SYNC_NAND ("<d>", "andi")); |
323 |
else |
324 |
- return MIPS_SYNC_NAND ("<d>", "and"); |
325 |
+ return mips_output_sync_loop (MIPS_SYNC_NAND ("<d>", "and")); |
326 |
} |
327 |
[(set_attr "length" "32")]) |
328 |
|
329 |
@@ -4615,9 +4616,9 @@ |
330 |
"GENERATE_LL_SC" |
331 |
{ |
332 |
if (which_alternative == 0) |
333 |
- return MIPS_SYNC_OLD_NAND ("<d>", "andi"); |
334 |
+ return mips_output_sync_loop (MIPS_SYNC_OLD_NAND ("<d>", "andi")); |
335 |
else |
336 |
- return MIPS_SYNC_OLD_NAND ("<d>", "and"); |
337 |
+ return mips_output_sync_loop (MIPS_SYNC_OLD_NAND ("<d>", "and")); |
338 |
} |
339 |
[(set_attr "length" "32")]) |
340 |
|
341 |
@@ -4630,9 +4631,9 @@ |
342 |
"GENERATE_LL_SC" |
343 |
{ |
344 |
if (which_alternative == 0) |
345 |
- return MIPS_SYNC_NEW_NAND ("<d>", "andi"); |
346 |
+ return mips_output_sync_loop (MIPS_SYNC_NEW_NAND ("<d>", "andi")); |
347 |
else |
348 |
- return MIPS_SYNC_NEW_NAND ("<d>", "and"); |
349 |
+ return mips_output_sync_loop (MIPS_SYNC_NEW_NAND ("<d>", "and")); |
350 |
} |
351 |
[(set_attr "length" "32")]) |
352 |
|
353 |
@@ -4645,9 +4646,9 @@ |
354 |
"GENERATE_LL_SC" |
355 |
{ |
356 |
if (which_alternative == 0) |
357 |
- return MIPS_SYNC_EXCHANGE ("<d>", "li"); |
358 |
+ return mips_output_sync_loop (MIPS_SYNC_EXCHANGE ("<d>", "li")); |
359 |
else |
360 |
- return MIPS_SYNC_EXCHANGE ("<d>", "move"); |
361 |
+ return mips_output_sync_loop (MIPS_SYNC_EXCHANGE ("<d>", "move")); |
362 |
} |
363 |
[(set_attr "length" "24")]) |
364 |
|
365 |
diff -Naurp gcc-4.3.2.orig/gcc/config/mips/mips.opt gcc-4.3.2/gcc/config/mips/mips.opt |
366 |
--- gcc-4.3.2.orig/gcc/config/mips/mips.opt 2008-11-16 01:57:14.000000000 -0500 |
367 |
+++ gcc-4.3.2/gcc/config/mips/mips.opt 2008-11-16 02:08:09.000000000 -0500 |
368 |
@@ -112,6 +112,10 @@ mfix-r4400 |
369 |
Target Report Mask(FIX_R4400) |
370 |
Work around certain R4400 errata |
371 |
|
372 |
+mfix-r10000 |
373 |
+Target Report Mask(FIX_R10000) |
374 |
+Work around certain R10000 errata |
375 |
+ |
376 |
mfix-sb1 |
377 |
Target Report Var(TARGET_FIX_SB1) |
378 |
Work around errata for early SB-1 revision 2 cores |
379 |
diff -Naurp gcc-4.3.2.orig/gcc/doc/invoke.texi gcc-4.3.2/gcc/doc/invoke.texi |
380 |
--- gcc-4.3.2.orig/gcc/doc/invoke.texi 2008-11-16 01:57:14.000000000 -0500 |
381 |
+++ gcc-4.3.2/gcc/doc/invoke.texi 2008-11-16 02:08:09.000000000 -0500 |
382 |
@@ -641,8 +641,8 @@ Objective-C and Objective-C++ Dialects}. |
383 |
-mmemcpy -mno-memcpy -mlong-calls -mno-long-calls @gol |
384 |
-mmad -mno-mad -mfused-madd -mno-fused-madd -nocpp @gol |
385 |
-mfix-r4000 -mno-fix-r4000 -mfix-r4400 -mno-fix-r4400 @gol |
386 |
--mfix-vr4120 -mno-fix-vr4120 -mfix-vr4130 -mno-fix-vr4130 @gol |
387 |
--mfix-sb1 -mno-fix-sb1 @gol |
388 |
+-mfix-r10000 -mno-fix-r10000 -mfix-vr4120 -mno-fix-vr4120 @gol |
389 |
+-mfix-vr4130 -mno-fix-vr4130 -mfix-sb1 -mno-fix-sb1 @gol |
390 |
-mflush-func=@var{func} -mno-flush-func @gol |
391 |
-mbranch-cost=@var{num} -mbranch-likely -mno-branch-likely @gol |
392 |
-mfp-exceptions -mno-fp-exceptions @gol |
393 |
@@ -12427,6 +12427,22 @@ A double-word or a variable shift may gi |
394 |
immediately after starting an integer division. |
395 |
@end itemize |
396 |
|
397 |
+@item -mfix-r10000 |
398 |
+@itemx -mno-fix-r10000 |
399 |
+@opindex mfix-r10000 |
400 |
+@opindex mno-fix-r10000 |
401 |
+Work around certain R10000 errata: |
402 |
+@itemize @minus |
403 |
+@item |
404 |
+@code{ll}/@code{sc} sequences may not behave atomically on revisions |
405 |
+prior to 3.0. They may deadlock on revisions 2.6 and earlier. |
406 |
+@end itemize |
407 |
+ |
408 |
+This option can only be used if the target architecture supports |
409 |
+branch-likely instructions. @option{-mfix-r10000} is the default when |
410 |
+@option{-march=r10000} is used; @option{-mno-fix-r10000} is the default |
411 |
+otherwise. |
412 |
+ |
413 |
@item -mfix-vr4120 |
414 |
@itemx -mno-fix-vr4120 |
415 |
@opindex mfix-vr4120 |
416 |
diff -Naurp gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-1.c gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-1.c |
417 |
--- gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-1.c 1969-12-31 19:00:00.000000000 -0500 |
418 |
+++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-1.c 2008-11-16 02:08:09.000000000 -0500 |
419 |
@@ -0,0 +1,21 @@ |
420 |
+/* { dg-do compile } */ |
421 |
+/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */ |
422 |
+/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ |
423 |
+ |
424 |
+NOMIPS16 int |
425 |
+f1 (int *z) |
426 |
+{ |
427 |
+ return __sync_fetch_and_add (z, 42); |
428 |
+} |
429 |
+ |
430 |
+NOMIPS16 short |
431 |
+f2 (short *z) |
432 |
+{ |
433 |
+ return __sync_fetch_and_add (z, 42); |
434 |
+} |
435 |
+ |
436 |
+NOMIPS16 char |
437 |
+f3 (char *z) |
438 |
+{ |
439 |
+ return __sync_fetch_and_add (z, 42); |
440 |
+} |
441 |
diff -Naurp gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-10.c gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-10.c |
442 |
--- gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-10.c 1969-12-31 19:00:00.000000000 -0500 |
443 |
+++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-10.c 2008-11-16 02:08:09.000000000 -0500 |
444 |
@@ -0,0 +1,21 @@ |
445 |
+/* { dg-do compile } */ |
446 |
+/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */ |
447 |
+/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ |
448 |
+ |
449 |
+NOMIPS16 int |
450 |
+f1 (int *z) |
451 |
+{ |
452 |
+ return __sync_and_and_fetch (z, 42); |
453 |
+} |
454 |
+ |
455 |
+NOMIPS16 short |
456 |
+f2 (short *z) |
457 |
+{ |
458 |
+ return __sync_and_and_fetch (z, 42); |
459 |
+} |
460 |
+ |
461 |
+NOMIPS16 char |
462 |
+f3 (char *z) |
463 |
+{ |
464 |
+ return __sync_and_and_fetch (z, 42); |
465 |
+} |
466 |
diff -Naurp gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-11.c gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-11.c |
467 |
--- gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-11.c 1969-12-31 19:00:00.000000000 -0500 |
468 |
+++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-11.c 2008-11-16 02:08:09.000000000 -0500 |
469 |
@@ -0,0 +1,21 @@ |
470 |
+/* { dg-do compile } */ |
471 |
+/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */ |
472 |
+/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ |
473 |
+ |
474 |
+NOMIPS16 int |
475 |
+f1 (int *z) |
476 |
+{ |
477 |
+ return __sync_xor_and_fetch (z, 42); |
478 |
+} |
479 |
+ |
480 |
+NOMIPS16 short |
481 |
+f2 (short *z) |
482 |
+{ |
483 |
+ return __sync_xor_and_fetch (z, 42); |
484 |
+} |
485 |
+ |
486 |
+NOMIPS16 char |
487 |
+f3 (char *z) |
488 |
+{ |
489 |
+ return __sync_xor_and_fetch (z, 42); |
490 |
+} |
491 |
diff -Naurp gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-12.c gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-12.c |
492 |
--- gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-12.c 1969-12-31 19:00:00.000000000 -0500 |
493 |
+++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-12.c 2008-11-16 02:08:09.000000000 -0500 |
494 |
@@ -0,0 +1,21 @@ |
495 |
+/* { dg-do compile } */ |
496 |
+/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */ |
497 |
+/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ |
498 |
+ |
499 |
+NOMIPS16 int |
500 |
+f1 (int *z) |
501 |
+{ |
502 |
+ return __sync_nand_and_fetch (z, 42); |
503 |
+} |
504 |
+ |
505 |
+NOMIPS16 short |
506 |
+f2 (short *z) |
507 |
+{ |
508 |
+ return __sync_nand_and_fetch (z, 42); |
509 |
+} |
510 |
+ |
511 |
+NOMIPS16 char |
512 |
+f3 (char *z) |
513 |
+{ |
514 |
+ return __sync_nand_and_fetch (z, 42); |
515 |
+} |
516 |
diff -Naurp gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-13.c gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-13.c |
517 |
--- gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-13.c 1969-12-31 19:00:00.000000000 -0500 |
518 |
+++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-13.c 2008-11-16 02:08:09.000000000 -0500 |
519 |
@@ -0,0 +1,21 @@ |
520 |
+/* { dg-do compile } */ |
521 |
+/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */ |
522 |
+/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ |
523 |
+ |
524 |
+NOMIPS16 int |
525 |
+f1 (int *z) |
526 |
+{ |
527 |
+ return __sync_bool_compare_and_swap (z, 0, 42); |
528 |
+} |
529 |
+ |
530 |
+NOMIPS16 short |
531 |
+f2 (short *z) |
532 |
+{ |
533 |
+ return __sync_bool_compare_and_swap (z, 0, 42); |
534 |
+} |
535 |
+ |
536 |
+NOMIPS16 char |
537 |
+f3 (char *z) |
538 |
+{ |
539 |
+ return __sync_bool_compare_and_swap (z, 0, 42); |
540 |
+} |
541 |
diff -Naurp gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-14.c gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-14.c |
542 |
--- gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-14.c 1969-12-31 19:00:00.000000000 -0500 |
543 |
+++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-14.c 2008-11-16 02:08:09.000000000 -0500 |
544 |
@@ -0,0 +1,21 @@ |
545 |
+/* { dg-do compile } */ |
546 |
+/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */ |
547 |
+/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ |
548 |
+ |
549 |
+NOMIPS16 int |
550 |
+f1 (int *z) |
551 |
+{ |
552 |
+ return __sync_val_compare_and_swap (z, 0, 42); |
553 |
+} |
554 |
+ |
555 |
+NOMIPS16 short |
556 |
+f2 (short *z) |
557 |
+{ |
558 |
+ return __sync_val_compare_and_swap (z, 0, 42); |
559 |
+} |
560 |
+ |
561 |
+NOMIPS16 char |
562 |
+f3 (char *z) |
563 |
+{ |
564 |
+ return __sync_val_compare_and_swap (z, 0, 42); |
565 |
+} |
566 |
diff -Naurp gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-15.c gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-15.c |
567 |
--- gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-15.c 1969-12-31 19:00:00.000000000 -0500 |
568 |
+++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-15.c 2008-11-16 02:08:09.000000000 -0500 |
569 |
@@ -0,0 +1,33 @@ |
570 |
+/* { dg-do compile } */ |
571 |
+/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */ |
572 |
+/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ |
573 |
+ |
574 |
+NOMIPS16 int |
575 |
+f1 (int *z) |
576 |
+{ |
577 |
+ int result; |
578 |
+ |
579 |
+ result = __sync_lock_test_and_set (z, 42); |
580 |
+ __sync_lock_release (z); |
581 |
+ return result; |
582 |
+} |
583 |
+ |
584 |
+NOMIPS16 short |
585 |
+f2 (short *z) |
586 |
+{ |
587 |
+ short result; |
588 |
+ |
589 |
+ result = __sync_lock_test_and_set (z, 42); |
590 |
+ __sync_lock_release (z); |
591 |
+ return result; |
592 |
+} |
593 |
+ |
594 |
+NOMIPS16 char |
595 |
+f3 (char *z) |
596 |
+{ |
597 |
+ char result; |
598 |
+ |
599 |
+ result = __sync_lock_test_and_set (z, 42); |
600 |
+ __sync_lock_release (z); |
601 |
+ return result; |
602 |
+} |
603 |
diff -Naurp gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-2.c gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-2.c |
604 |
--- gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-2.c 1969-12-31 19:00:00.000000000 -0500 |
605 |
+++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-2.c 2008-11-16 02:08:09.000000000 -0500 |
606 |
@@ -0,0 +1,21 @@ |
607 |
+/* { dg-do compile } */ |
608 |
+/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */ |
609 |
+/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ |
610 |
+ |
611 |
+NOMIPS16 int |
612 |
+f1 (int *z, int amt) |
613 |
+{ |
614 |
+ return __sync_fetch_and_sub (z, amt); |
615 |
+} |
616 |
+ |
617 |
+NOMIPS16 short |
618 |
+f2 (short *z, short amt) |
619 |
+{ |
620 |
+ return __sync_fetch_and_sub (z, amt); |
621 |
+} |
622 |
+ |
623 |
+NOMIPS16 char |
624 |
+f3 (char *z, char amt) |
625 |
+{ |
626 |
+ return __sync_fetch_and_sub (z, amt); |
627 |
+} |
628 |
diff -Naurp gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-3.c gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-3.c |
629 |
--- gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-3.c 1969-12-31 19:00:00.000000000 -0500 |
630 |
+++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-3.c 2008-11-16 02:08:09.000000000 -0500 |
631 |
@@ -0,0 +1,21 @@ |
632 |
+/* { dg-do compile } */ |
633 |
+/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */ |
634 |
+/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ |
635 |
+ |
636 |
+NOMIPS16 int |
637 |
+f1 (int *z) |
638 |
+{ |
639 |
+ return __sync_fetch_and_or (z, 42); |
640 |
+} |
641 |
+ |
642 |
+NOMIPS16 short |
643 |
+f2 (short *z) |
644 |
+{ |
645 |
+ return __sync_fetch_and_or (z, 42); |
646 |
+} |
647 |
+ |
648 |
+NOMIPS16 char |
649 |
+f3 (char *z) |
650 |
+{ |
651 |
+ return __sync_fetch_and_or (z, 42); |
652 |
+} |
653 |
diff -Naurp gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-4.c gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-4.c |
654 |
--- gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-4.c 1969-12-31 19:00:00.000000000 -0500 |
655 |
+++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-4.c 2008-11-16 02:08:09.000000000 -0500 |
656 |
@@ -0,0 +1,21 @@ |
657 |
+/* { dg-do compile } */ |
658 |
+/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */ |
659 |
+/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ |
660 |
+ |
661 |
+NOMIPS16 int |
662 |
+f1 (int *z) |
663 |
+{ |
664 |
+ return __sync_fetch_and_and (z, 42); |
665 |
+} |
666 |
+ |
667 |
+NOMIPS16 short |
668 |
+f2 (short *z) |
669 |
+{ |
670 |
+ return __sync_fetch_and_and (z, 42); |
671 |
+} |
672 |
+ |
673 |
+NOMIPS16 char |
674 |
+f3 (char *z) |
675 |
+{ |
676 |
+ return __sync_fetch_and_and (z, 42); |
677 |
+} |
678 |
diff -Naurp gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-5.c gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-5.c |
679 |
--- gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-5.c 1969-12-31 19:00:00.000000000 -0500 |
680 |
+++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-5.c 2008-11-16 02:08:09.000000000 -0500 |
681 |
@@ -0,0 +1,21 @@ |
682 |
+/* { dg-do compile } */ |
683 |
+/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */ |
684 |
+/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ |
685 |
+ |
686 |
+NOMIPS16 int |
687 |
+f1 (int *z) |
688 |
+{ |
689 |
+ return __sync_fetch_and_xor (z, 42); |
690 |
+} |
691 |
+ |
692 |
+NOMIPS16 short |
693 |
+f2 (short *z) |
694 |
+{ |
695 |
+ return __sync_fetch_and_xor (z, 42); |
696 |
+} |
697 |
+ |
698 |
+NOMIPS16 char |
699 |
+f3 (char *z) |
700 |
+{ |
701 |
+ return __sync_fetch_and_xor (z, 42); |
702 |
+} |
703 |
diff -Naurp gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-6.c gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-6.c |
704 |
--- gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-6.c 1969-12-31 19:00:00.000000000 -0500 |
705 |
+++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-6.c 2008-11-16 02:08:09.000000000 -0500 |
706 |
@@ -0,0 +1,21 @@ |
707 |
+/* { dg-do compile } */ |
708 |
+/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */ |
709 |
+/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ |
710 |
+ |
711 |
+NOMIPS16 int |
712 |
+f1 (int *z) |
713 |
+{ |
714 |
+ return __sync_fetch_and_nand (z, 42); |
715 |
+} |
716 |
+ |
717 |
+NOMIPS16 short |
718 |
+f2 (short *z) |
719 |
+{ |
720 |
+ return __sync_fetch_and_nand (z, 42); |
721 |
+} |
722 |
+ |
723 |
+NOMIPS16 char |
724 |
+f3 (char *z) |
725 |
+{ |
726 |
+ return __sync_fetch_and_nand (z, 42); |
727 |
+} |
728 |
diff -Naurp gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-7.c gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-7.c |
729 |
--- gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-7.c 1969-12-31 19:00:00.000000000 -0500 |
730 |
+++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-7.c 2008-11-16 02:08:09.000000000 -0500 |
731 |
@@ -0,0 +1,21 @@ |
732 |
+/* { dg-do compile } */ |
733 |
+/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */ |
734 |
+/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ |
735 |
+ |
736 |
+NOMIPS16 int |
737 |
+f1 (int *z) |
738 |
+{ |
739 |
+ return __sync_add_and_fetch (z, 42); |
740 |
+} |
741 |
+ |
742 |
+NOMIPS16 short |
743 |
+f2 (short *z) |
744 |
+{ |
745 |
+ return __sync_add_and_fetch (z, 42); |
746 |
+} |
747 |
+ |
748 |
+NOMIPS16 char |
749 |
+f3 (char *z) |
750 |
+{ |
751 |
+ return __sync_add_and_fetch (z, 42); |
752 |
+} |
753 |
diff -Naurp gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-8.c gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-8.c |
754 |
--- gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-8.c 1969-12-31 19:00:00.000000000 -0500 |
755 |
+++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-8.c 2008-11-16 02:08:09.000000000 -0500 |
756 |
@@ -0,0 +1,21 @@ |
757 |
+/* { dg-do compile } */ |
758 |
+/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */ |
759 |
+/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ |
760 |
+ |
761 |
+NOMIPS16 int |
762 |
+f1 (int *z, int amt) |
763 |
+{ |
764 |
+ return __sync_sub_and_fetch (z, amt); |
765 |
+} |
766 |
+ |
767 |
+NOMIPS16 short |
768 |
+f2 (short *z, short amt) |
769 |
+{ |
770 |
+ return __sync_sub_and_fetch (z, amt); |
771 |
+} |
772 |
+ |
773 |
+NOMIPS16 char |
774 |
+f3 (char *z, char amt) |
775 |
+{ |
776 |
+ return __sync_sub_and_fetch (z, amt); |
777 |
+} |
778 |
diff -Naurp gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-9.c gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-9.c |
779 |
--- gcc-4.3.2.orig/gcc/testsuite/gcc.target/mips/fix-r10000-9.c 1969-12-31 19:00:00.000000000 -0500 |
780 |
+++ gcc-4.3.2/gcc/testsuite/gcc.target/mips/fix-r10000-9.c 2008-11-16 02:08:09.000000000 -0500 |
781 |
@@ -0,0 +1,21 @@ |
782 |
+/* { dg-do compile } */ |
783 |
+/* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */ |
784 |
+/* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */ |
785 |
+ |
786 |
+NOMIPS16 int |
787 |
+f1 (int *z) |
788 |
+{ |
789 |
+ return __sync_or_and_fetch (z, 42); |
790 |
+} |
791 |
+ |
792 |
+NOMIPS16 short |
793 |
+f2 (short *z) |
794 |
+{ |
795 |
+ return __sync_or_and_fetch (z, 42); |
796 |
+} |
797 |
+ |
798 |
+NOMIPS16 char |
799 |
+f3 (char *z) |
800 |
+{ |
801 |
+ return __sync_or_and_fetch (z, 42); |
802 |
+} |