This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] For SH target,DSP index register instruction is case sensitive
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- To: "Arati" <aratid at kpit dot com>
- Cc: <binutils at sources dot redhat dot com>
- Date: 29 Nov 2001 09:37:47 +0000
- Subject: Re: [PATCH] For SH target,DSP index register instruction is case sensitive
- References: <001101c178b7$fa798220$81100aac@stpp.soft.net>
Hi Arati,
> The DSP instruction MOVX.W @R4+R8,X0 gives Assembler error "invalid
> operands for opcode". On analyzing the code, I found that in
> tc-sh.c, in function parse_at(), r8 and r9 were checked without
> fisrt calling tolower() function as is done in the other parse
> functions. This can be solved with the patch below.
> Changelog
> 2001-11-29 Arati Dikey <aratid@kpit.com>
> * tc-sh.c (parse_at): Removed case-sensitivity of index
> register R8, R9.
Thanks for submitting this patch. I have applied it, in a slightly
extended version (see below).
Cheers
Nick
Index: gas/config/tc-sh.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-sh.c,v
retrieving revision 1.47
diff -p -c -r1.47 tc-sh.c
*** tc-sh.c 2001/11/15 21:28:58 1.47
--- tc-sh.c 2001/11/29 09:38:20
*************** parse_at (src, op)
*** 994,1008 ****
}
if (src[0] == '+')
{
src++;
! if ((src[0] == 'r' && src[1] == '8')
! || (src[0] == 'i' && (src[1] == 'x' || src[1] == 's')))
{
src += 2;
op->type = A_PMOD_N;
}
! if ((src[0] == 'r' && src[1] == '9')
! || (src[0] == 'i' && src[1] == 'y'))
{
src += 2;
op->type = A_PMODY_N;
--- 994,1013 ----
}
if (src[0] == '+')
{
+ char l0, l1;
+
src++;
! l0 = TOLOWER (src[0]);
! l1 = TOLOWER (src[1]);
!
! if ((l0 == 'r' && l1 == '8')
! || (l0 == 'i' && (l1 == 'x' || l1 == 's')))
{
src += 2;
op->type = A_PMOD_N;
}
! if ((l0 == 'r' && l1 == '9')
! || (l0 == 'i' && l1 == 'y'))
{
src += 2;
op->type = A_PMODY_N;