This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] S12Z: gas: Permit "extend" instructions which don't actually extend.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=77fdb0e00bd47c564c4e32726fc6020d9441d4a7

commit 77fdb0e00bd47c564c4e32726fc6020d9441d4a7
Author: John Darrington <john@darrington.wattle.id.au>
Date:   Wed Jan 16 14:34:50 2019 +0100

    S12Z: gas: Permit "extend" instructions which don't actually extend.
    
    Other assemblers permit "extending" a register into a register of a
    smaller size or the same size.  It doesn't make much sense to do this
    but would appear to be a valid instruction.  So change the error to a
    warning.
    
    gas/
    	* config/tc-s12z.c (tfr): Change as_bad to as_warn.
    	Also fix message typo and semantics.

Diff:
---
 gas/ChangeLog        |  2 ++
 gas/config/tc-s12z.c | 15 +++++----------
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 986af84..6b852c2 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,7 @@
 2019-01-16  John Darrington <john@darrington.wattle.id.au>
 
+        * config/tc-s12z.c (tfr): Change as_bad to as_warn.
+	Also fix message typo and semantics.
         * config/tc-s12z.c (emit_opr): Emit BFD_RELOC_S12Z_OPR instead of
 	BFD_RELOC_24.
 	* testsuite/gas/s12z/opr-indirect-expr.d: Expect R_S12Z_OPR instead
diff --git a/gas/config/tc-s12z.c b/gas/config/tc-s12z.c
index 7d1ddf6..f6c5889 100644
--- a/gas/config/tc-s12z.c
+++ b/gas/config/tc-s12z.c
@@ -1316,16 +1316,11 @@ tfr (const struct instruction *insn)
   if (!lex_reg_name (~0, &reg2))
     goto fail;
 
-  if ((0 == strcasecmp ("sex", insn->name))
-      || (0 == strcasecmp ("zex", insn->name)))
-    {
-      if (registers[reg1].bytes >= registers[reg2].bytes)
-	{
-	  as_bad (_("Source register for %s must be smaller that the destination register"),
-		  insn->name);
-	  goto fail;
-	}
-    }
+  if ( ((0 == strcasecmp ("sex", insn->name))
+        || (0 == strcasecmp ("zex", insn->name)))
+       && (registers[reg2].bytes <= registers[reg1].bytes))
+      as_warn (_("Source register for %s is no larger than the destination register"),
+               insn->name);
 
   char *f = s12z_new_insn (1 + insn->page);
   if (insn->page == 2)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]