diff options
author | Claudiu Zissulescu <claziss@synopsys.com> | 2016-02-10 12:09:01 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2016-02-10 12:09:01 +0000 |
commit | 4670103e86f59a80259fd593a6949d693382e536 (patch) | |
tree | bc0ae65cc94a89c6fa81629a350abf6c9b243123 /gas/testsuite | |
parent | 83da6e748c8f105f07e17f53aa6b99ed7867ff5f (diff) | |
download | gdb-4670103e86f59a80259fd593a6949d693382e536.zip gdb-4670103e86f59a80259fd593a6949d693382e536.tar.gz gdb-4670103e86f59a80259fd593a6949d693382e536.tar.bz2 |
Add support for ARC instruction relaxation in the assembler.
gas/
2016-01-26 Claudiu Zissulescu <claziss@synopsys.com>
Janek van Oirschot <jvanoirs@synopsys.com>
* config/tc-arc.h (TC_FRAG_TYPE, TC_PCREL_ADJUST, MAX_INSN_ARGS)
(MAX_INSN_FLGS, MAX_FLAG_NAME_LENGHT, TC_GENERIC_RELAX_TABLE):
Define.
(arc_flags, arc_relax_type): New structure.
* config/tc-arc.c (FRAG_MAX_GROWTH, RELAX_TABLE_ENTRY)
(RELAX_TABLE_ENTRY_MAX): New define.
(relaxation_state, md_relax_table, arc_relaxable_insns)
(arc_num_relaxable_ins): New variable.
(rlx_operand_type, arc_rlx_types): New enums.
(arc_relaxable_ins): New structure.
(OPTION_RELAX): New option.
(arc_insn): New relax member.
(arc_flags): Remove.
(relax_insn_p): New function.
(apply_fixups): Likewise.
(relaxable_operand): Likewise.
(may_relax_expr): Likewise.
(relaxable_flag): Likewise.
(arc_pcrel_adjust): Likewise.
(md_estimate_size_before_relax): Implement.
(md_convert_frag): Likewise.
(md_parse_option): Handle new mrelax option.
(md_show_usage): Likewise.
(assemble_insn): Set relax member.
(emit_insn0): New function.
(emit_insn1): Likewise.
(emit_insn): Handle relaxation case.
* NEWS: Mention the new relaxation option.
* doc/c-arc.texi (ARC Options): Document new mrelax option.
gas/testsuite
2016-01-26 Claudiu Zissulescu <claziss@synopsys.com>
* gas/arc/relax-avoid1.d: New file.
* gas/arc/relax-avoid1.s: Likewise.
* gas/arc/relax-avoid2.d: Likewise.
* gas/arc/relax-avoid2.s: Likewise.
* gas/arc/relax-avoid3.d: Likewise.
* gas/arc/relax-avoid3.s: Likewise.
* gas/arc/relax-b.d: Likewise.
* gas/arc/relax-b.s: Likewise.
include/opcode/
2016-01-26 Claudiu Zissulescu <claziss@synopsys.com>
Janek van Oirschot <jvanoirs@synopsys.com>
* arc.h (arc_opcode arc_relax_opcodes, arc_num_relax_opcodes):
Declare.
opcodes/
2016-01-26 Claudiu Zissulescu <claziss@synopsys.com>
Janek van Oirschot <jvanoirs@synopsys.com>
* arc-opc.c (arc_relax_opcodes, arc_num_relax_opcodes): New
variable.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/gas/arc/relax-avoid1.d | 13 | ||||
-rw-r--r-- | gas/testsuite/gas/arc/relax-avoid1.s | 11 | ||||
-rw-r--r-- | gas/testsuite/gas/arc/relax-avoid2.d | 14 | ||||
-rw-r--r-- | gas/testsuite/gas/arc/relax-avoid2.s | 4 | ||||
-rw-r--r-- | gas/testsuite/gas/arc/relax-avoid3.d | 14 | ||||
-rw-r--r-- | gas/testsuite/gas/arc/relax-avoid3.s | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/arc/relax-b.d | 19 | ||||
-rw-r--r-- | gas/testsuite/gas/arc/relax-b.s | 11 |
8 files changed, 91 insertions, 0 deletions
diff --git a/gas/testsuite/gas/arc/relax-avoid1.d b/gas/testsuite/gas/arc/relax-avoid1.d new file mode 100644 index 0000000..3d6d74e --- /dev/null +++ b/gas/testsuite/gas/arc/relax-avoid1.d @@ -0,0 +1,13 @@ +#as: -mcpu=archs -mrelax +#objdump: -dr + +.*: +file format .*arc.* + + +Disassembly of section .text: + +00000000 <.text>: + 0: 78e0 nop_s + 2: 240a 0f80 0000 0000 mov r4,0 + 6: R_ARC_32_ME .LC2 + a: 78e0 nop_s diff --git a/gas/testsuite/gas/arc/relax-avoid1.s b/gas/testsuite/gas/arc/relax-avoid1.s new file mode 100644 index 0000000..82fbe63 --- /dev/null +++ b/gas/testsuite/gas/arc/relax-avoid1.s @@ -0,0 +1,11 @@ + .section .rodata + .align 4 +.LC2: + .word 0x01 + .word 0x02 + .word 0x03 + + .section .text + .align 4 + nop_s + mov r4,@.LC2 diff --git a/gas/testsuite/gas/arc/relax-avoid2.d b/gas/testsuite/gas/arc/relax-avoid2.d new file mode 100644 index 0000000..fd602b4 --- /dev/null +++ b/gas/testsuite/gas/arc/relax-avoid2.d @@ -0,0 +1,14 @@ +#as: -mcpu=archs -mrelax +#objdump: -dr + +.*: +file format .*arc.* + + +Disassembly of section .text: + +00000000 <test>: + 0: 2000 0000 add r0,r0,r0 + +00000004 <main>: + 4: 0802 0000 bl 0 <test> + 4: R_ARC_S25W_PCREL_PLT test diff --git a/gas/testsuite/gas/arc/relax-avoid2.s b/gas/testsuite/gas/arc/relax-avoid2.s new file mode 100644 index 0000000..703064d --- /dev/null +++ b/gas/testsuite/gas/arc/relax-avoid2.s @@ -0,0 +1,4 @@ +test: + add r0,r0,r0 +main: + bl @test@plt diff --git a/gas/testsuite/gas/arc/relax-avoid3.d b/gas/testsuite/gas/arc/relax-avoid3.d new file mode 100644 index 0000000..7b177fb --- /dev/null +++ b/gas/testsuite/gas/arc/relax-avoid3.d @@ -0,0 +1,14 @@ +#as: -mcpu=archs -mrelax +#objdump: -dr + +.*: +file format .*arc.* + + +Disassembly of section .text: + +00000000 <test>: + 0: 2000 0000 add r0,r0,r0 + +00000004 <main>: + 4: 0001 0000 b 0 <test> + 4: R_ARC_S25H_PCREL test diff --git a/gas/testsuite/gas/arc/relax-avoid3.s b/gas/testsuite/gas/arc/relax-avoid3.s new file mode 100644 index 0000000..dc913a4 --- /dev/null +++ b/gas/testsuite/gas/arc/relax-avoid3.s @@ -0,0 +1,5 @@ +test: + add r0,r0,r0 + .weak test +main: + b test diff --git a/gas/testsuite/gas/arc/relax-b.d b/gas/testsuite/gas/arc/relax-b.d new file mode 100644 index 0000000..fd8dc47 --- /dev/null +++ b/gas/testsuite/gas/arc/relax-b.d @@ -0,0 +1,19 @@ +#as: -mcpu=archs -mrelax +#objdump: -dr + +.*: +file format .*arc.* + + +Disassembly of section .text: + +00000000 <foo-0x4>: + 0: 78e0 nop_s + 2: 78e0 nop_s + +00000004 <foo>: + 4: 2000 0000 add r0,r0,r0 + +00000008 <bar>: + 8: ffff bl_s 4 <foo> + a: 2100 0041 add r1,r1,r1 + e: f1fc b_s 4 <foo> diff --git a/gas/testsuite/gas/arc/relax-b.s b/gas/testsuite/gas/arc/relax-b.s new file mode 100644 index 0000000..3698b14 --- /dev/null +++ b/gas/testsuite/gas/arc/relax-b.s @@ -0,0 +1,11 @@ + .text + nop_s + .align 4 +foo: + add r0,r0,r0 + + .align 4 +bar: + bl @foo + add r1,r1,r1 + b @foo |