public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [ PATCH] : SH Assembler generates incorrect opcode for PCMP instructions
@ 2002-01-17  6:09 Arati Dikey
  0 siblings, 0 replies; 4+ messages in thread
From: Arati Dikey @ 2002-01-17  6:09 UTC (permalink / raw)
  To: binutils



Hi !

The SH assembler generates incorrect opcodes for the parallel PCMP
instruction.
Basically, its last nibble is a copy of the previous instruction's
second nibble
when working in Big Endian format.

For example,
test.s
	movs.w @-R5, A0
      PCMP X0,Y0

 generates opcodes
	f5 70
	f8 00 84 05

 instead of
	f8 00 84 00

The following patch corrects this. I have also verified that it does not
cause any
side effect on other DSP instructions.

Regards,
Arati Dikey



--- tc-sh.c.orig	Thu Dec  6 11:34:18 2001
+++ tc-sh.c	      Thu Jan 17 16:41:28 2002
@@ -1769,7 +1769,10 @@
 	  if (field_b)
 	    as_bad (_("multiple parallel processing specifications"));
 	  field_b = ((opcode->nibbles[2] << 12) + (opcode->nibbles[3] <<
8)
-		     + (reg_x << 6) + (reg_y << 4) + reg_n);
+		     + (reg_x << 6) + (reg_y << 4) );
+
+	  if (strcmp (opcode->name, "pcmp") != 0)
+	  	 field_b += reg_n;
 	  break;
 	case PDC:
 	  if (cond)

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCH] : SH Assembler generates incorrect opcode for PCMP instructions
@ 2002-01-30 21:51 Arati Dikey
  2002-01-31 13:55 ` Nick Clifton
  0 siblings, 1 reply; 4+ messages in thread
From: Arati Dikey @ 2002-01-30 21:51 UTC (permalink / raw)
  To: binutils

Hi !

The SH assembler generates incorrect opcodes for the parallel PCMP
instruction.
Basically, its last nibble is a copy of the previous instruction's
second nibble
when working in Big Endian format.

For example,
test.s
	movs.w @-R5, A0
      PCMP X0,Y0

generates opcodes
	f5 70
	f8 00 84 05

 instead of
	f8 00 84 00

The following patch corrects this. I have also verified that it does not
cause any
side effect on other DSP instructions.

Regards,
Arati Dikey


Changelog 
	2002-01-17  Arati Dikey <aratid@kpit.com>

	tc-sh.c (assemble_ppi): Do not add reg_n value for PCMP
instructions



--- tc-sh.c.orig	Thu Dec  6 11:34:18 2001
+++ tc-sh.c	      Thu Jan 17 16:41:28 2002
@@ -1769,7 +1769,10 @@ assemble_ppi (op_end, opcode)
 	  if (field_b)
 	    as_bad (_("multiple parallel processing specifications"));
 	  field_b = ((opcode->nibbles[2] << 12) + (opcode->nibbles[3] <<
8)
-		     + (reg_x << 6) + (reg_y << 4) + reg_n);
+		     + (reg_x << 6) + (reg_y << 4) );
+
+	  if (strcmp (opcode->name, "pcmp") != 0)
+	  	 field_b += reg_n;
 	  break;
 	case PDC:
 	  if (cond)





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNUSH tool chain for Hitachi's SH Series.
The following site also offers free support to European customers.
Read more at http://www.kpit.com/products/support.htm.
Latest version of GNUSH is released on Jan 1, 2002.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-06-14 15:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-17  6:09 [ PATCH] : SH Assembler generates incorrect opcode for PCMP instructions Arati Dikey
2002-01-30 21:51 [PATCH] " Arati Dikey
2002-01-31 13:55 ` Nick Clifton
2002-06-14  8:07   ` Joern Rennecke

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).