This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
GNURX toolchain generates incorrect opcode for "mov.b #0xff, [r0]" instruction.
- From: "Vinay Kumar. G" <Vinay dot G at kpit dot com>
- To: "nickc at redhat dot com" <nickc at redhat dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Tue, 2 Feb 2016 13:03:35 +0000
- Subject: GNURX toolchain generates incorrect opcode for "mov.b #0xff, [r0]" instruction.
- Authentication-results: sourceware.org; auth=none
- Authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=kpit.com;
Hi Nick,
Thanks for giving an opportunity to work on the below posted
GNURX related bug.
https://sourceware.org/ml/binutils/2015-09/msg00095.html
The bug is also reported in the following link:
https://sourceware.org/bugzilla/show_bug.cgi?id=19556
I have verified the correct opcode generation for r0 register
using below patch.
{{{
Index: gas/config/rx-parse.y
===================================================================
--- gas/config/rx-parse.y (revision 2893)
+++ gas/config/rx-parse.y (working copy)
@@ -271,7 +271,15 @@
} }
/* ---------------------------------------------------------------------- */
+ | MOV DOT_B '#' EXPR ',' '[' REG ']'
+ { B2 (0xf8, 0x04); IMMB ($4, 12);}
+ | MOV DOT_W '#' EXPR ',' '[' REG ']'
+ { B2 (0xf8, 0x01); IMMW ($4, 12);}
+
+ | MOV DOT_L '#' EXPR ',' '[' REG ']'
+ { B2 (0xf8, 0x02); IMM ($4, 12);}
+
| MOV DOT_B '#' EXPR ',' disp '[' REG ']'
/* rx_disp5op changes the value if it succeeds, so keep it last. */
{ if ($8 <= 7 && rx_uintop ($4, 8) && rx_disp5op0 (&$6, BSIZE))
}}}
However I am still facing issue with registers other than r0 like r1-r15. Can you please give
some hints how to go about with this.
p.s. Kindly ignore any disclaimers at end of this e-mail as they are auto-inserted.
Regards,
Vinay