public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: kvx: New port.
@ 2023-08-22  0:02 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-08-22  0:02 UTC (permalink / raw)
  To: binutils

Add files submitted on the mailing list but somehow not committed.

diff --git a/binutils/testsuite/binutils-all/dw2-decodedline-2.S b/binutils/testsuite/binutils-all/dw2-decodedline-2.S
new file mode 100644
index 00000000000..333cd3626a6
--- /dev/null
+++ b/binutils/testsuite/binutils-all/dw2-decodedline-2.S
@@ -0,0 +1,18 @@
+	.file	"dw2-decodedline.c"
+	.file 1 "dw2-decodedline.c"
+	.file 2 "directory/file1.c"
+	.text
+	.globl f1
+	.type	f1, %function
+f1:
+	.loc 2 1 0
+	nop
+	;;
+	.size	f1, .-f1
+	.globl main
+	.type	main, %function
+main:
+	.loc 1 2 0
+	nop
+	;;
+	.size	main, .-main
diff --git a/binutils/testsuite/binutils-all/kvx/kvx.exp b/binutils/testsuite/binutils-all/kvx/kvx.exp
new file mode 100644
index 00000000000..e096bebb65a
--- /dev/null
+++ b/binutils/testsuite/binutils-all/kvx/kvx.exp
@@ -0,0 +1,37 @@
+#   Copyright (C) 2009-2023 Free Software Foundation, Inc.
+#   Contributed by Kalray SA.
+
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 3 of the License, or
+#   (at your option) any later version.
+
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+
+#   You should have received a copy of the GNU General Public License
+#   along with this program; see the file COPYING3. If not,
+#   see <http://www.gnu.org/licenses/>.  */
+
+if {!([istarget "kvx*-*-*"])
+    || ![is_elf_format]
+    || [is_remote host]} then {
+    return
+}
+
+global tempfile
+global copyfile
+set tempfile tmpdir/kvxtemp.o
+set copyfile tmpdir/kvxcopy
+
+## binutils test framework does not support the 'dump' EXTRA args to
+## simply share a single .s for 32 and 64bits test.
+# So we duplicate the source .s
+
+# 32bits test
+run_dump_test "pcrel_bundle32bits"
+
+# 64bits test
+run_dump_test "pcrel_bundle"
diff --git a/binutils/testsuite/binutils-all/kvx/pcrel_bundle.d b/binutils/testsuite/binutils-all/kvx/pcrel_bundle.d
new file mode 100644
index 00000000000..ff8df45bb0e
--- /dev/null
+++ b/binutils/testsuite/binutils-all/kvx/pcrel_bundle.d
@@ -0,0 +1,33 @@
+#name: pcrel_bundle
+#source: pcrel_bundle.s
+#PROG: objcopy
+#as:
+#objdump: -dr
+#...
+
+Disassembly of section .text:
+
+0000000000000000 <foo>:
+   0:	00 0e 00 f0 00 00 00 80 00 00 00 00             	pcrel \$r0 = 56 \(0x38\);;
+
+   c:	0d 00 00 98                                     	call 40 <bar>
+  10:	00 0b 00 f0 00 00 00 80 00 00 00 00             	pcrel \$r0 = 44 \(0x2c\);;
+
+  1c:	09 00 00 98                                     	call 40 <bar>
+  20:	00 07 00 f0 00 00 00 b8 00 00 00 80             	pcrel \$r0 = 28 \(0x1c\)
+  2c:	00 00 00 00                                     	ld \$r0 = 0 \(0x0\)\[\$r0\];;
+
+  30:	00 f0 03 7f                                     	nop;;
+
+  34:	00 f0 03 7f                                     	nop;;
+
+
+0000000000000038 <.table>:
+  38:	00 f0 03 7f                                     	nop;;
+
+  3c:	00 f0 03 7f                                     	nop;;
+
+
+0000000000000040 <bar>:
+  40:	00 f0 03 7f                                     	nop;;
+
diff --git a/binutils/testsuite/binutils-all/kvx/pcrel_bundle.s b/binutils/testsuite/binutils-all/kvx/pcrel_bundle.s
new file mode 100644
index 00000000000..feaa581ce8f
--- /dev/null
+++ b/binutils/testsuite/binutils-all/kvx/pcrel_bundle.s
@@ -0,0 +1,25 @@
+foo:
+	pcrel $r0 = @pcrel(.table)
+	;;
+	call bar
+	pcrel $r0 = @pcrel(.table)
+	;;
+	call bar
+	ld $r0 = 0[$r0]
+	pcrel $r0 = @pcrel(.table)
+	;;
+	nop
+	;;
+	nop
+	;;
+.table:
+	nop
+	;;
+	nop
+	;; 
+bar:
+	nop
+	;;
+	
+
+	
diff --git a/binutils/testsuite/binutils-all/kvx/pcrel_bundle32bits.d b/binutils/testsuite/binutils-all/kvx/pcrel_bundle32bits.d
new file mode 100644
index 00000000000..732b3c50507
--- /dev/null
+++ b/binutils/testsuite/binutils-all/kvx/pcrel_bundle32bits.d
@@ -0,0 +1,33 @@
+#name: pcrel_bundle
+#source: pcrel_bundle.s
+#PROG: objcopy
+#as: -m32
+#objdump: -dr
+#...
+
+Disassembly of section .text:
+
+00000000 <foo>:
+   0:	00 0b 00 f0 00 00 00 00                         	pcrel \$r0 = 44 \(0x2c\);;
+
+   8:	0b 00 00 98                                     	call 34 <bar>
+   c:	00 09 00 f0 00 00 00 00                         	pcrel \$r0 = 36 \(0x24\);;
+
+  14:	08 00 00 98                                     	call 34 <bar>
+  18:	00 06 00 f0 00 00 00 b8                         	pcrel \$r0 = 24 \(0x18\)
+  20:	00 00 00 00                                     	ld \$r0 = 0 \(0x0\)\[\$r0\];;
+
+  24:	00 f0 03 7f                                     	nop;;
+
+  28:	00 f0 03 7f                                     	nop;;
+
+
+0000002c <.table>:
+  2c:	00 f0 03 7f                                     	nop;;
+
+  30:	00 f0 03 7f                                     	nop;;
+
+
+00000034 <bar>:
+  34:	00 f0 03 7f                                     	nop;;
+
diff --git a/binutils/testsuite/binutils-all/kvx/pcrel_bundle32bits.s b/binutils/testsuite/binutils-all/kvx/pcrel_bundle32bits.s
new file mode 100644
index 00000000000..feaa581ce8f
--- /dev/null
+++ b/binutils/testsuite/binutils-all/kvx/pcrel_bundle32bits.s
@@ -0,0 +1,25 @@
+foo:
+	pcrel $r0 = @pcrel(.table)
+	;;
+	call bar
+	pcrel $r0 = @pcrel(.table)
+	;;
+	call bar
+	ld $r0 = 0[$r0]
+	pcrel $r0 = @pcrel(.table)
+	;;
+	nop
+	;;
+	nop
+	;;
+.table:
+	nop
+	;;
+	nop
+	;; 
+bar:
+	nop
+	;;
+	
+
+	

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-22  0:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-22  0:02 kvx: New port Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).