diff options
author | Claudiu Zissulescu <claziss@synopsys.com> | 2017-02-15 11:57:51 +0100 |
---|---|---|
committer | Claudiu Zissulescu <claziss@synopsys.com> | 2017-02-15 12:02:28 +0100 |
commit | cc07cda69e26ef28895086e1f214ddd1d3cb939d (patch) | |
tree | c221de4efbefdc22bec9a4178caa306784847d40 /gas/testsuite | |
parent | 7c723eecec713e1de9a95017aac29a40f3b9853a (diff) | |
download | gdb-cc07cda69e26ef28895086e1f214ddd1d3cb939d.zip gdb-cc07cda69e26ef28895086e1f214ddd1d3cb939d.tar.gz gdb-cc07cda69e26ef28895086e1f214ddd1d3cb939d.tar.bz2 |
[ARC] Fix assembler relaxation.
Fix assembler relaxation step for add, ld, mov, mpy and sub
instructions. Add tests to it.
gas/
2017-02-15 Claudiu Zissulescu <claziss@synopsys.com>
* config/tc-arc.c (md_convert_frag): Remove @pcl relocation
information from input expression.
(assemble_insn): Make sure pcrel is correctly set.
(arc_pcrel_adjust): Compensate for PCL rounding.
* testsuite/gas/arc/relax-add01.d: New file.
* testsuite/gas/arc/relax-add01.s: Likewise.
* testsuite/gas/arc/relax-add02.d: Likewise.
* testsuite/gas/arc/relax-add02.s: Likewise.
* testsuite/gas/arc/relax-add03.d: Likewise.
* testsuite/gas/arc/relax-add03.s: Likewise.
* testsuite/gas/arc/relax-add04.d: Likewise.
* testsuite/gas/arc/relax-add04.s: Likewise.
* testsuite/gas/arc/relax-ld01.d: Likewise.
* testsuite/gas/arc/relax-ld01.s: Likewise.
* testsuite/gas/arc/relax-ld02.d: Likewise.
* testsuite/gas/arc/relax-ld02.s: Likewise.
* testsuite/gas/arc/relax-mov01.d: Likewise.
* testsuite/gas/arc/relax-mov01.s: Likewise.
* testsuite/gas/arc/relax-mov02.d: Likewise.
* testsuite/gas/arc/relax-mov02.s: Likewise.
* testsuite/gas/arc/relax-mpy01.d: Likewise.
* testsuite/gas/arc/relax-mpy01.s: Likewise.
* testsuite/gas/arc/relax-sub01.d: Likewise.
* testsuite/gas/arc/relax-sub01.s: Likewise.
* testsuite/gas/arc/relax-sub02.d: Likewise.
* testsuite/gas/arc/relax-sub02.s: Likewise.
* testsuite/gas/arc/relax-sub03.d: Likewise.
* testsuite/gas/arc/relax-sub03.s: Likewise.
* testsuite/gas/arc/relax-sub04.d: Likewise.
* testsuite/gas/arc/relax-sub04.s: Likewise.
opcodes/
2017-02-15 Claudiu Zissulescu <claziss@synopsys.com>
* arc-opc.c (UIMM6_20R): Define.
(SIMM12_20): Use above.
(SIMM12_20R): Define.
(SIMM3_5_S): Use above.
(UIMM7_A32_11R_S): Define.
(UIMM7_9_S): Use above.
(UIMM3_13R_S): Define.
(SIMM11_A32_7_S): Use above.
(SIMM9_8R): Define.
(UIMM10_A32_8_S): Use above.
(UIMM8_8R_S): Define.
(W6): Use above.
(arc_relax_opcodes): Use all above defines.
Diffstat (limited to 'gas/testsuite')
26 files changed, 290 insertions, 0 deletions
diff --git a/gas/testsuite/gas/arc/relax-add01.d b/gas/testsuite/gas/arc/relax-add01.d new file mode 100644 index 0000000..13f3390 --- /dev/null +++ b/gas/testsuite/gas/arc/relax-add01.d @@ -0,0 +1,14 @@ +#as: -mrelax +#objdump: -dr + +.*: +file format .*arc.* + + +Disassembly of section .text: + +00000000 <.text>: + 0: 2740 7401 add r1,pcl,0x10 + 4: 264a 7000\s+.* + 8: 264a 7000\s+.* + c: 264a 7000\s+.* + 10: 2000 0000 add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-add01.s b/gas/testsuite/gas/arc/relax-add01.s new file mode 100644 index 0000000..d27ee6a --- /dev/null +++ b/gas/testsuite/gas/arc/relax-add01.s @@ -0,0 +1,9 @@ +;;; Check relaxation from add rA,rB,limm@pcl -> add rA,rB, uimm6@pcl + .cpu EM + add r1,pcl,@.L1@pcl + nop + nop + nop + .align 4 +.L1: + add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-add02.d b/gas/testsuite/gas/arc/relax-add02.d new file mode 100644 index 0000000..b2e419d --- /dev/null +++ b/gas/testsuite/gas/arc/relax-add02.d @@ -0,0 +1,14 @@ +#as: -mrelax +#objdump: -dr + +.*: +file format .*arc.* + + +Disassembly of section .text: + +00000000 <.text>: + 0: 2540 0401 add r1,r5,0x10 + 4: 264a 7000\s+.* + 8: 264a 7000\s+.* + c: 264a 7000\s+.* + 10: 2000 0000 add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-add02.s b/gas/testsuite/gas/arc/relax-add02.s new file mode 100644 index 0000000..552c55f --- /dev/null +++ b/gas/testsuite/gas/arc/relax-add02.s @@ -0,0 +1,8 @@ +;;; Check relaxation from add rA,rB,limm (PCL) -> add rA,rB, uimm6@pcl + .cpu EM + add r1,r5,@.L1 - . + nop + nop + nop +.L1: + add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-add03.d b/gas/testsuite/gas/arc/relax-add03.d new file mode 100644 index 0000000..35e0bca --- /dev/null +++ b/gas/testsuite/gas/arc/relax-add03.d @@ -0,0 +1,13 @@ +#as: -mrelax +#objdump: -dr + +.*: +file format .*arc.* + + +Disassembly of section .text: + +00000000 <.text>: + 0: 264a 7000\s+.* + 4: 2240 0201 add r1,r2,0x8 + 8: 264a 7000\s+.* + c: 2000 0000 add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-add03.s b/gas/testsuite/gas/arc/relax-add03.s new file mode 100644 index 0000000..279fa4f --- /dev/null +++ b/gas/testsuite/gas/arc/relax-add03.s @@ -0,0 +1,8 @@ +;;; Check relaxation from add rA,rB,limm@pcl -> add_s rC,B, uimm3@pcl + .cpu EM + nop + add r1,r2,@.L1@pcl + nop + .align 4 +.L1: + add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-add04.d b/gas/testsuite/gas/arc/relax-add04.d new file mode 100644 index 0000000..bb1697c --- /dev/null +++ b/gas/testsuite/gas/arc/relax-add04.d @@ -0,0 +1,14 @@ +#as: -mrelax +#objdump: -dr + +.*: +file format .*arc.* + + +Disassembly of section .text: + +00000000 <.text>: + 0: 78e0 nop_s + 2: 2740 7281 add r1,pcl,0xa + 6: 264a 7000\s+.* + a: 78e0 nop_s + c: 2000 0000 add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-add04.s b/gas/testsuite/gas/arc/relax-add04.s new file mode 100644 index 0000000..3af1f08 --- /dev/null +++ b/gas/testsuite/gas/arc/relax-add04.s @@ -0,0 +1,8 @@ +;;; Check relaxation from add rA,rB,limm (PCL) -> add rA,rB, uimm6@pcl + .cpu EM + nop_s + add r1,pcl,@.L1 - . + nop + .align 4 +.L1: + add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-ld01.d b/gas/testsuite/gas/arc/relax-ld01.d new file mode 100644 index 0000000..ce58995 --- /dev/null +++ b/gas/testsuite/gas/arc/relax-ld01.d @@ -0,0 +1,15 @@ +#as: -mrelax +#objdump: -dr + +.*: +file format .*arc.* + + +Disassembly of section .text: + +00000000 <.text>: + 0: 78e0 nop_s + 2: 1710 7001 ld r1,\[pcl,16\] + 6: 264a 7000\s+.* + a: 264a 7000\s+.* + e: 78e0 nop_s + 10: 2000 0000 add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-ld01.s b/gas/testsuite/gas/arc/relax-ld01.s new file mode 100644 index 0000000..199536c --- /dev/null +++ b/gas/testsuite/gas/arc/relax-ld01.s @@ -0,0 +1,9 @@ +;;; Check relaxation from ld rA,[rB,limm@pcl] -> ld rA,[rB, imm9@pcl] + .cpu EM + nop_s + ld r1,[pcl,@.L1@pcl] + nop + nop + .align 4 +.L1: + add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-ld02.d b/gas/testsuite/gas/arc/relax-ld02.d new file mode 100644 index 0000000..48e71b1 --- /dev/null +++ b/gas/testsuite/gas/arc/relax-ld02.d @@ -0,0 +1,14 @@ +#as: -mrelax +#objdump: -dr + +.*: +file format .*arc.* + + +Disassembly of section .text: + +00000000 <.text>: + 0: 78e0 nop_s + 2: 8223 ld_s r1,\[r2,0xc\] + 4: 264a 7000\s+.* + 8: 264a 7000\s+.* + c: 2000 0000 add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-ld02.s b/gas/testsuite/gas/arc/relax-ld02.s new file mode 100644 index 0000000..37ec66c --- /dev/null +++ b/gas/testsuite/gas/arc/relax-ld02.s @@ -0,0 +1,9 @@ +;;; Check relaxation from ld rA,[rB,limm@pcl] -> ld_s rC,[rB, imm9@pcl] + .cpu EM + nop_s + ld r1,[r2,@.L1@pcl] + nop + nop + .align 4 +.L1: + add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-mov01.d b/gas/testsuite/gas/arc/relax-mov01.d new file mode 100644 index 0000000..373814e --- /dev/null +++ b/gas/testsuite/gas/arc/relax-mov01.d @@ -0,0 +1,14 @@ +#as: -mrelax +#objdump: -dr + +.*: +file format .*arc.* + + +Disassembly of section .text: + +00000000 <.text>: + 0: 78e0 nop_s + 2: 258a 0300 mov r5,12 + 6: 264a 7000\s+.* + a: 264a 7000\s+.* + e: 2000 0000 add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-mov01.s b/gas/testsuite/gas/arc/relax-mov01.s new file mode 100644 index 0000000..4433356 --- /dev/null +++ b/gas/testsuite/gas/arc/relax-mov01.s @@ -0,0 +1,8 @@ +;;; Check relaxation from mov rA,limm -> mov rA, s12 + .cpu EM + nop_s + mov r5, @.L1 - . + nop + nop +.L1: + add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-mov02.d b/gas/testsuite/gas/arc/relax-mov02.d new file mode 100644 index 0000000..b776595 --- /dev/null +++ b/gas/testsuite/gas/arc/relax-mov02.d @@ -0,0 +1,14 @@ +#as: -mrelax +#objdump: -dr + +.*: +file format .*arc.* + + +Disassembly of section .text: + +00000000 <.text>: + 0: 78e0 nop_s + 2: d90a mov_s r1,0xa + 4: 264a 7000\s+.* + 8: 264a 7000\s+.* + c: 2000 0000 add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-mov02.s b/gas/testsuite/gas/arc/relax-mov02.s new file mode 100644 index 0000000..89ff619 --- /dev/null +++ b/gas/testsuite/gas/arc/relax-mov02.s @@ -0,0 +1,8 @@ +;;; Check relaxation from mov rA,limm -> mov_s rA, u8 + .cpu EM + nop_s + mov r1, @.L1 - . + nop + nop +.L1: + add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-mpy01.d b/gas/testsuite/gas/arc/relax-mpy01.d new file mode 100644 index 0000000..40debac --- /dev/null +++ b/gas/testsuite/gas/arc/relax-mpy01.d @@ -0,0 +1,14 @@ +#as: -mrelax +#objdump: -dr + +.*: +file format .*arc.* + + +Disassembly of section .text: + +00000000 <.text>: + 0: 255a 0401 mpy r1,r5,0x10 + 4: 264a 7000\s+.* + 8: 264a 7000\s+.* + c: 264a 7000\s+.* + 10: 2000 0000 add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-mpy01.s b/gas/testsuite/gas/arc/relax-mpy01.s new file mode 100644 index 0000000..fa64bd7 --- /dev/null +++ b/gas/testsuite/gas/arc/relax-mpy01.s @@ -0,0 +1,8 @@ +;;; Check relaxation from mpy rA,rB,limm -> mpy rA,rB, uimm6@pcl + .cpu EM + mpy r1,r5,@.L1 - . + nop + nop + nop +.L1: + add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-sub01.d b/gas/testsuite/gas/arc/relax-sub01.d new file mode 100644 index 0000000..604a993 --- /dev/null +++ b/gas/testsuite/gas/arc/relax-sub01.d @@ -0,0 +1,14 @@ +#as: -mrelax +#objdump: -dr + +.*: +file format .*arc.* + + +Disassembly of section .text: + +00000000 <.text>: + 0: 2742 7401 sub r1,pcl,0x10 + 4: 264a 7000\s+.* + 8: 264a 7000\s+.* + c: 264a 7000\s+.* + 10: 2000 0000 add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-sub01.s b/gas/testsuite/gas/arc/relax-sub01.s new file mode 100644 index 0000000..fde4a69 --- /dev/null +++ b/gas/testsuite/gas/arc/relax-sub01.s @@ -0,0 +1,9 @@ +;;; Check relaxation from sub rA,rB,limm@pcl -> sub rA,rB, uimm6@pcl + .cpu EM + sub r1,pcl,@.L1@pcl + nop + nop + nop + .align 4 +.L1: + add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-sub02.d b/gas/testsuite/gas/arc/relax-sub02.d new file mode 100644 index 0000000..604a993 --- /dev/null +++ b/gas/testsuite/gas/arc/relax-sub02.d @@ -0,0 +1,14 @@ +#as: -mrelax +#objdump: -dr + +.*: +file format .*arc.* + + +Disassembly of section .text: + +00000000 <.text>: + 0: 2742 7401 sub r1,pcl,0x10 + 4: 264a 7000\s+.* + 8: 264a 7000\s+.* + c: 264a 7000\s+.* + 10: 2000 0000 add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-sub02.s b/gas/testsuite/gas/arc/relax-sub02.s new file mode 100644 index 0000000..d273e03 --- /dev/null +++ b/gas/testsuite/gas/arc/relax-sub02.s @@ -0,0 +1,9 @@ +;;; Check relaxation from sub rA,rB,limm (PCL) -> sub rA,rB, uimm6@pcl + .cpu EM + sub r1,pcl,@.L1 - . + nop + nop + nop + .align 4 +.L1: + add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-sub03.d b/gas/testsuite/gas/arc/relax-sub03.d new file mode 100644 index 0000000..b41eda6 --- /dev/null +++ b/gas/testsuite/gas/arc/relax-sub03.d @@ -0,0 +1,13 @@ +#as: -mrelax +#objdump: -dr + +.*: +file format .*arc.* + + +Disassembly of section .text: + +00000000 <.text>: + 0: 264a 7000\s+.* + 4: 2242 0201 sub r1,r2,0x8 + 8: 264a 7000\s+.* + c: 2000 0000 add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-sub03.s b/gas/testsuite/gas/arc/relax-sub03.s new file mode 100644 index 0000000..4c5bd9d --- /dev/null +++ b/gas/testsuite/gas/arc/relax-sub03.s @@ -0,0 +1,8 @@ +;;; Check relaxation from sub rA,rB,limm@pcl -> sub_s rC,rB, uimm3@pcl + .cpu EM + nop + sub r1,r2,@.L1@pcl + nop + .align 4 +.L1: + add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-sub04.d b/gas/testsuite/gas/arc/relax-sub04.d new file mode 100644 index 0000000..07fd7fa --- /dev/null +++ b/gas/testsuite/gas/arc/relax-sub04.d @@ -0,0 +1,14 @@ +#as: -mrelax +#objdump: -dr + +.*: +file format .*arc.* + + +Disassembly of section .text: + +00000000 <.text>: + 0: 78e0 nop_s + 2: 2742 7281 sub r1,pcl,0xa + 6: 264a 7000\s+.* + a: 78e0 nop_s + c: 2000 0000 add r0,r0,r0 diff --git a/gas/testsuite/gas/arc/relax-sub04.s b/gas/testsuite/gas/arc/relax-sub04.s new file mode 100644 index 0000000..ecf10f1 --- /dev/null +++ b/gas/testsuite/gas/arc/relax-sub04.s @@ -0,0 +1,8 @@ +;;; Check relaxation from sub rA,rB,limm (PCL) -> sub rA,rB, uimm6@pcl + .cpu EM + nop_s + sub r1,pcl,@.L1 - . + nop + .align 4 +.L1: + add r0,r0,r0 |