Browse Source
* config/tc-mips.c (mips_fix_24k): Declare.
(check_for_24k_errata): New.
(mips_cleanup): Call check_for_24k_errata.
(start_noreorder): Likewise.
(md_mips_end): Likewise.
(s_change_sec): Likewise.
(s_change_section): Likewise.
(append_insn): Call check_for_24k_errata. Prevent
ERET/DERET instructions from being moved into delay
slots.
(OPTION_FIX_24K): New.
(OPTION_NO_FIX_24k) New.
(md_longopts): Add "mfix-24k" and "mno-fix-24k".
(md_parse_option): Handle fix-24k options.
(md_show_usage): Display fix-24k options.
* doc/c-mips.texi: Document.
* testsuite/gas/mips/mips.exp: Run new tests.
* testsuite/gas/mips/eret.s: New test.
* testsuite/gas/mips/eret.d: New test output.
* testsuite/gas/mips/eret.l: New test output.
cgen-1_1-branch
7 changed files with 232 additions and 3 deletions
@ -0,0 +1,41 @@ |
|||
#objdump: -d |
|||
#name: MIPS eret disassembly |
|||
#as: -mfix-24k -march=24kc --no-warn |
|||
|
|||
.*\.o: file format .*mips.* |
|||
|
|||
Disassembly of section \.text: |
|||
|
|||
00000000 <\.text>: |
|||
0: 240c0000 li t4,0 |
|||
4: 42000018 eret |
|||
8: 00000000 nop |
|||
c: 10000003 b 0x1c |
|||
10: 00000000 nop |
|||
14: 240a0003 li t2,3 |
|||
18: 42000018 eret |
|||
1c: 24040000 li a0,0 |
|||
20: 4200001f deret |
|||
24: 00000000 nop |
|||
28: 116afffa beq t3,t2,0x14 |
|||
2c: 00000000 nop |
|||
30: 4200001f deret |
|||
34: 00000000 nop |
|||
38: 42000018 eret |
|||
3c: 00000000 nop |
|||
40: 42000018 eret |
|||
44: 00000000 nop |
|||
48: 1000fff4 b 0x1c |
|||
4c: 00000000 nop |
|||
50: 240c0004 li t4,4 |
|||
54: 4200001f deret |
|||
58: 240c0003 li t4,3 |
|||
5c: 42000018 eret |
|||
60: 10000005 b 0x78 |
|||
64: 240c0003 li t4,3 |
|||
68: 42000018 eret |
|||
6c: 00000000 nop |
|||
70: 10000001 b 0x78 |
|||
74: 240c0003 li t4,3 |
|||
78: 240c0003 li t4,3 |
|||
7c: 42000018 eret |
|||
@ -0,0 +1,3 @@ |
|||
.*\.s: Assembler messages: |
|||
.*\.s:20: Warning: ERET and DERET must be followed by a NOP on the 24K\. |
|||
.*\.s:27: Warning: ERET and DERET must be followed by a NOP on the 24K\. |
|||
@ -0,0 +1,27 @@ |
|||
.text |
|||
li $t4, 0 |
|||
eret |
|||
b 2f |
|||
1: li $t2, 3 |
|||
eret |
|||
2: li $a0, 0 |
|||
deret |
|||
beq $t3,$t2,1b |
|||
deret |
|||
eret |
|||
eret |
|||
b 2b |
|||
|
|||
.set noreorder |
|||
li $t4, 4 |
|||
deret |
|||
li $t4, 3 |
|||
eret |
|||
b 1f |
|||
li $t4, 3 |
|||
eret |
|||
nop |
|||
b 1f |
|||
li $t4, 3 |
|||
1: li $t4, 3 |
|||
eret |
|||
Loading…
Reference in new issue