This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
ARM's N flag is miscomputed in `mull'
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: ARM's N flag is miscomputed in `mull'
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 22 Jun 2000 17:40:48 -0300
- Organization: GCC Team, Red Hat
- References: <or8zvxjxg7.fsf@guarana.lsd.ic.unicamp.br>
On Jun 22, 2000, Alexandre Oliva <aoliva@redhat.com> wrote:
> I'm checking this in, approved by Nick Clifton:
Likewise:
Index: sim/arm/ChangeLog
from Alexandre Oliva <aoliva@cygnus.com>
* armemu.c (Multiply64): Fix computation of flag N.
Index: sim/arm/armemu.c
===================================================================
RCS file: /cvs/src/src/sim/arm/armemu.c,v
retrieving revision 1.5
diff -u -r1.5 armemu.c
--- sim/arm/armemu.c 2000/06/22 20:03:32 1.5
+++ sim/arm/armemu.c 2000/06/22 20:28:49
@@ -3819,10 +3819,9 @@
if (scc)
{
- if ((RdHi == 0) && (RdLo == 0))
- ARMul_NegZero (state, RdHi); /* zero value */
- else
- ARMul_NegZero (state, scc); /* non-zero value */
+ /* Ensure that both RdHi and RdLo are used to compute Z, but
+ don't let RdLo's sign bit make it to N. */
+ ARMul_NegZero (state, RdHi | (RdLo >> 16) | (RdLo & 0xFFFF));
}
/* The cycle count depends on whether the instruction is a signed or
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me