This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] sh-sim: thislock/prevlock tweak
- From: Michael Snyder <msnyder at redhat dot com>
- To: Joern Rennecke <joern dot rennecke at superh dot com>
- Cc: Joern Rennecke <amylaar at fairadsl dot co dot uk>, gdb-patches at sources dot redhat dot com
- Date: Fri, 06 Feb 2004 11:35:39 -0800
- Subject: Re: [RFA] sh-sim: thislock/prevlock tweak
- Organization: Red Hat, Inc.
- References: <200402061238.i16CcWl25143@linsvr1.uk.superh.com>
Joern Rennecke wrote:
Joern,
I don't fully understand this code, but it looks to me as if this
minor change is needed. Most other instructions appear to call
the macro "L()" for the register that was explicitly the target
of the instruction.
Looks sensible as far as I can see it; it would be helpful to have
enough context to see the full insn.
OK
Index: gencode.c
===================================================================
RCS file: /cvs/src/src/sim/sh/gencode.c,v
retrieving revision 1.26
diff -p -5 -r1.26 gencode.c
*** gencode.c 27 Jan 2004 23:30:01 -0000 1.26
--- gencode.c 6 Feb 2004 19:35:09 -0000
*************** op tab[] =
*** 867,885 ****
{ "0", "n", "movua.l @<REG_N>,R0", "0100nnnn10101001",
"int regn = R[n];",
"MA (1);",
"R[0] = (RBAT (regn) << 24) + (RBAT (regn + 1) << 16) + ",
" (RBAT (regn + 2) << 8) + RBAT (regn + 3);",
! "L (n);",
},
{ "0n", "n", "movua.l @<REG_N>+,R0", "0100nnnn11101001",
"int regn = R[n];",
"MA (1);",
"R[0] = (RBAT (regn) << 24) + (RBAT (regn + 1) << 16) + ",
" (RBAT (regn + 2) << 8) + RBAT (regn + 3);",
"R[n] += 4;",
! "L (n);",
},
{ "", "mn", "mul.l <REG_M>,<REG_N>", "0000nnnnmmmm0111",
"MACL = ((int) R[n]) * ((int) R[m]);",
},
#if 0 /* FIXME: The above cast to int is not really portable.
--- 867,885 ----
{ "0", "n", "movua.l @<REG_N>,R0", "0100nnnn10101001",
"int regn = R[n];",
"MA (1);",
"R[0] = (RBAT (regn) << 24) + (RBAT (regn + 1) << 16) + ",
" (RBAT (regn + 2) << 8) + RBAT (regn + 3);",
! "L (0);",
},
{ "0n", "n", "movua.l @<REG_N>+,R0", "0100nnnn11101001",
"int regn = R[n];",
"MA (1);",
"R[0] = (RBAT (regn) << 24) + (RBAT (regn + 1) << 16) + ",
" (RBAT (regn + 2) << 8) + RBAT (regn + 3);",
"R[n] += 4;",
! "L (0);",
},
{ "", "mn", "mul.l <REG_M>,<REG_N>", "0000nnnnmmmm0111",
"MACL = ((int) R[n]) * ((int) R[m]);",
},
#if 0 /* FIXME: The above cast to int is not really portable.