public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Faraz Shahbazker <fshahbazker@wavecomp.com>
To: "binutils@sourceware.org" <binutils@sourceware.org>
Cc: Faraz Shahbazker <fshahbazker@wavecomp.com>,
	"paul.hua.gm@gmail.com"	<paul.hua.gm@gmail.com>
Subject: [PATCH] [MIPS] Reject $0 as source register for DAUI instruction
Date: Tue, 14 May 2019 00:19:00 -0000	[thread overview]
Message-ID: <20190514001957.350621-1-fshahbazker@wavecomp.com> (raw)

The MIPS64R6 TRM requires that the source register for DAUI
not be r0.

[1] "MIPS Architecture for Programmers Volume II-A: The MIPS64
    Instruction Set Manual", Imagination Technologies Ltd., Document
    Number: MD00087, Revision 6.06, December 15, 2016, Section 3.2
    "Alphabetical List of Instructions", pp. 67-68.

gas/
	* testsuite/gas/mips/r6-branch-constraints.s: Rename to ...
	* testsuite/gas/mips/r6-reg-constraints.s: this and add test
	case for DAUI.
	* testsuite/gas/mips/r6-branch-constraints.l: Rename to ...
	* testsuite/gas/mips/r6-reg-constraints.l: this and add test
	for DAUI.
	* testsuite/gas/mips/mips.exp: Rename test from
	r6-branch-constraints to r6-reg-constraints.

opcodes/
	* mips-opc.c (mips_builtin_opcodes): Change source register
	constraint for DAUI.
---
 gas/testsuite/gas/mips/mips.exp                                         | 2 +-
 .../gas/mips/{r6-branch-constraints.l => r6-reg-constraints.l}          | 1 +
 .../gas/mips/{r6-branch-constraints.s => r6-reg-constraints.s}          | 1 +
 opcodes/mips-opc.c                                                      | 2 +-
 4 files changed, 4 insertions(+), 2 deletions(-)
 rename gas/testsuite/gas/mips/{r6-branch-constraints.l => r6-reg-constraints.l} (95%)
 rename gas/testsuite/gas/mips/{r6-branch-constraints.s => r6-reg-constraints.s} (96%)

diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 4db6683..5352954 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -2074,7 +2074,7 @@ if { [istarget mips*-*-vxworks*] } {
     run_list_test_arches "r6-removed"	"-32" [mips_arch_list_matching mips32r6]
     run_list_test_arches "r6-64-removed"	[mips_arch_list_matching mips64r6]
 
-    run_list_test_arches "r6-branch-constraints"  "-32" \
+    run_list_test_arches "r6-reg-constraints"  "-32" \
 			[mips_arch_list_matching mips32r6]
 
     run_dump_test_arches "crc"		[mips_arch_list_matching mips32r6]
diff --git a/gas/testsuite/gas/mips/r6-branch-constraints.l b/gas/testsuite/gas/mips/r6-reg-constraints.l
similarity index 95%
rename from gas/testsuite/gas/mips/r6-branch-constraints.l
rename to gas/testsuite/gas/mips/r6-reg-constraints.l
index bdeea9f..c898073 100644
--- a/gas/testsuite/gas/mips/r6-branch-constraints.l
+++ b/gas/testsuite/gas/mips/r6-reg-constraints.l
@@ -23,3 +23,4 @@
 .*:23: Error: the source register must not be \$0 `bnec \$0,\$2,.'
 .*:24: Error: invalid operands `bnec \$2,\$0,.'
 .*:25: Error: invalid operands `bnec \$2,\$2,.'
+.*:26: Error: the source register must not be \$0 `daui \$2,\$0,1'
diff --git a/gas/testsuite/gas/mips/r6-branch-constraints.s b/gas/testsuite/gas/mips/r6-reg-constraints.s
similarity index 96%
rename from gas/testsuite/gas/mips/r6-branch-constraints.s
rename to gas/testsuite/gas/mips/r6-reg-constraints.s
index 62ca893..b29527c 100644
--- a/gas/testsuite/gas/mips/r6-branch-constraints.s
+++ b/gas/testsuite/gas/mips/r6-reg-constraints.s
@@ -23,3 +23,4 @@
 	bnec	    $0,$2,.
 	bnec	    $2,$0,.
 	bnec	    $2,$2,.
+	daui	    $2,$0,1
diff --git a/opcodes/mips-opc.c b/opcodes/mips-opc.c
index 69b16be..0483a04 100644
--- a/opcodes/mips-opc.c
+++ b/opcodes/mips-opc.c
@@ -3271,7 +3271,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
 /* MIPS r6.  */
 {"aui",			"t,s,u",	0x3c000000, 0xfc000000,	WR_1|RD_2,		0,		I37,		0,	0 },
 {"auipc",		"s,u",		0xec1e0000, 0xfc1f0000, WR_1,			RD_pc,		I37,		0,	0 },
-{"daui",		"t,s,u",	0x74000000, 0xfc000000,	WR_1|RD_2,		0,		I37,		0,	0 },
+{"daui",		"t,-s,u",	0x74000000, 0xfc000000,	WR_1|RD_2,		0,		I37,		0,	0 },
 {"dahi",		"s,-d,u",	0x04060000, 0xfc1f0000,	MOD_1,			0,		I69,		0,	0 },
 {"dati",		"s,-d,u",	0x041e0000, 0xfc1f0000,	MOD_1,			0,		I69,		0,	0 },
 
-- 
2.9.5

             reply	other threads:[~2019-05-14  0:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-14  0:19 Faraz Shahbazker [this message]
2019-05-21 14:55 ` Nick Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190514001957.350621-1-fshahbazker@wavecomp.com \
    --to=fshahbazker@wavecomp.com \
    --cc=binutils@sourceware.org \
    --cc=paul.hua.gm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).