aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2016-03-30 00:02:19 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2016-04-14 17:16:46 +0100
commit4b0c052e456421a3c6d7b4c98be3ad0b3bd2ad27 (patch)
treeba2ad6919a72787b533fdc37c2694aa49522995d /gas
parent33cbe6c07ed7e66d65c106cffb496eff5d7e8fb5 (diff)
downloadgdb-4b0c052e456421a3c6d7b4c98be3ad0b3bd2ad27.zip
gdb-4b0c052e456421a3c6d7b4c98be3ad0b3bd2ad27.tar.gz
gdb-4b0c052e456421a3c6d7b4c98be3ad0b3bd2ad27.tar.bz2
arc/nps400 : New cmem instructions and associated relocation
Add support for arc/nps400 cmem instructions, these load and store instructions are hard-wired to access "0x57f00000 + 16-bit-offset". Supporting this relocation required some additions to the arc relocation handling in the bfd library, as well as the standard changes required to add a new relocation type. There's a test of the new instructions in the assembler, and a test of the relocation in the linker. bfd/ChangeLog: * reloc.c: Add BFD_RELOC_ARC_NPS_CMEM16 entry. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * elf32-arc.c: Add 'opcode/arc.h' include. (struct arc_relocation_data): Add symbol_name. (arc_special_overflow_checks): New function. (arc_do_relocation): Use arc_special_overflow_checks, reindent as required, add an extra comment. (elf_arc_relocate_section): Setup symbol_name in reloc_data. gas/ChangeLog: * testsuite/gas/arc/nps400-3.d: New file. * testsuite/gas/arc/nps400-3.s: New file. include/ChangeLog: * elf/arc-reloc.def: Add ARC_NPS_CMEM16 reloc. * opcode/arc.h (NPS_CMEM_HIGH_VALUE): Define. ld/ChangeLog: * testsuite/ld-arc/arc.exp: New file. * testsuite/ld-arc/nps-1.s: New file. * testsuite/ld-arc/nps-1a.d: New file. * testsuite/ld-arc/nps-1b.d: New file. * testsuite/ld-arc/nps-1b.err: New file. opcodes/ChangeLog: * arc-nps400-tbl.h: Add xldb, xldw, xld, xstb, xstw, and xst instructions. * arc-opc.c (insert_nps_cmem_uimm16): New function. (extract_nps_cmem_uimm16): New function. (arc_operands): Add NPS_XLDST_UIMM16 operand.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/testsuite/gas/arc/nps400-3.d56
-rw-r--r--gas/testsuite/gas/arc/nps400-3.s23
3 files changed, 84 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index c9ea846..f95cd7a 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,10 @@
2016-04-14 Andrew Burgess <andrew.burgess@embecosm.com>
+ * testsuite/gas/arc/nps400-3.d: New file.
+ * testsuite/gas/arc/nps400-3.s: New file.
+
+2016-04-14 Andrew Burgess <andrew.burgess@embecosm.com>
+
* testsuite/gas/arc/add_s-err.s: Update target pattern.
* testsuite/gas/arc/warn.s: Likewise.
* testsuite/gas/elf/elf.exp: Run test for arc.
diff --git a/gas/testsuite/gas/arc/nps400-3.d b/gas/testsuite/gas/arc/nps400-3.d
new file mode 100644
index 0000000..ea52554
--- /dev/null
+++ b/gas/testsuite/gas/arc/nps400-3.d
@@ -0,0 +1,56 @@
+#as: -mcpu=nps400
+#objdump: -dr
+
+.*: +file format .*arc.*
+
+Disassembly of section .text:
+
+[0-9a-f]+ <.*>:
+ 0: 5988 0000 xldb r12,\[0x57f00000\]
+ 4: 5ae8 ffff xldb r23,\[0x57f0ffff\]
+ 8: 5868 0000 xldb r3,\[0x57f00000\]
+ c: 5968 ffff xldb r11,\[0x57f0ffff\]
+ 10: 5a88 0000 xldb r20,\[0x57f00000\]
+ 10: R_ARC_NPS_CMEM16 foo
+ 14: 5828 0000 xldb r1,\[0x57f00000\]
+ 14: R_ARC_NPS_CMEM16 foo\+0x20
+ 18: 5989 0000 xldw r12,\[0x57f00000\]
+ 1c: 5ae9 ffff xldw r23,\[0x57f0ffff\]
+ 20: 5869 0000 xldw r3,\[0x57f00000\]
+ 24: 5969 ffff xldw r11,\[0x57f0ffff\]
+ 28: 5a89 0000 xldw r20,\[0x57f00000\]
+ 28: R_ARC_NPS_CMEM16 foo
+ 2c: 5829 0000 xldw r1,\[0x57f00000\]
+ 2c: R_ARC_NPS_CMEM16 foo\+0x20
+ 30: 598a 0000 xld r12,\[0x57f00000\]
+ 34: 5aea ffff xld r23,\[0x57f0ffff\]
+ 38: 586a 0000 xld r3,\[0x57f00000\]
+ 3c: 596a ffff xld r11,\[0x57f0ffff\]
+ 40: 5a8a 0000 xld r20,\[0x57f00000\]
+ 40: R_ARC_NPS_CMEM16 foo
+ 44: 582a 0000 xld r1,\[0x57f00000\]
+ 44: R_ARC_NPS_CMEM16 foo\+0x20
+ 48: 598c 0000 xstb r12,\[0x57f00000\]
+ 4c: 5aec ffff xstb r23,\[0x57f0ffff\]
+ 50: 586c 0000 xstb r3,\[0x57f00000\]
+ 54: 596c ffff xstb r11,\[0x57f0ffff\]
+ 58: 5a8c 0000 xstb r20,\[0x57f00000\]
+ 58: R_ARC_NPS_CMEM16 foo
+ 5c: 582c 0000 xstb r1,\[0x57f00000\]
+ 5c: R_ARC_NPS_CMEM16 foo\+0x20
+ 60: 598d 0000 xstw r12,\[0x57f00000\]
+ 64: 5aed ffff xstw r23,\[0x57f0ffff\]
+ 68: 586d 0000 xstw r3,\[0x57f00000\]
+ 6c: 596d ffff xstw r11,\[0x57f0ffff\]
+ 70: 5a8d 0000 xstw r20,\[0x57f00000\]
+ 70: R_ARC_NPS_CMEM16 foo
+ 74: 582d 0000 xstw r1,\[0x57f00000\]
+ 74: R_ARC_NPS_CMEM16 foo\+0x20
+ 78: 598e 0000 xst r12,\[0x57f00000\]
+ 7c: 5aee ffff xst r23,\[0x57f0ffff\]
+ 80: 586e 0000 xst r3,\[0x57f00000\]
+ 84: 596e ffff xst r11,\[0x57f0ffff\]
+ 88: 5a8e 0000 xst r20,\[0x57f00000\]
+ 88: R_ARC_NPS_CMEM16 foo
+ 8c: 582e 0000 xst r1,\[0x57f00000\]
+ 8c: R_ARC_NPS_CMEM16 foo\+0x20
diff --git a/gas/testsuite/gas/arc/nps400-3.s b/gas/testsuite/gas/arc/nps400-3.s
new file mode 100644
index 0000000..6840223
--- /dev/null
+++ b/gas/testsuite/gas/arc/nps400-3.s
@@ -0,0 +1,23 @@
+ .macro xldst_test mnem
+ \mnem r12, [ 0x0 ]
+ \mnem r23, [ 0xffff ]
+ \mnem r3, [ 0x57f00000 ]
+ \mnem r11, [ 0x57f0ffff ]
+ \mnem r20, [ foo ]
+ \mnem r1, [ foo + 0x20 ]
+ .endm
+
+ .text
+ ;; xldb
+ xldst_test xldb
+ ;; xldw
+ xldst_test xldw
+ ;; xld
+ xldst_test xld
+ ;; xstb
+ xldst_test xstb
+ ;; xstw
+ xldst_test xstw
+ ;; xst
+ xldst_test xst
+