Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Richard Sandiford <rsandifo@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [mips sim]: Fix check for negative dmult operands
Date: Sat, 07 Jun 2003 10:21:00 -0000	[thread overview]
Message-ID: <wvn7k7y198k.fsf@talisman.cambridge.redhat.com> (raw)

do_dmultx tests for negative operands with:

    if (op1 < 0)
      {
        op1 = - op1;
        ++sign;
      }
    if (op2 < 0)
      {
        op2 = - op2;
        ++sign;
      }

but op1 and op2 are unsigned...

The patch below fixes some gcc.c-torture/execute/950426-2.c failures
on mipsisa64-elf.  Please install if OK.

Richard


	* mips.igen (do_dmultx): Fix check for negative operands.

Index: sim/mips/mips.igen
===================================================================
RCS file: /cvs/src/src/sim/mips/mips.igen,v
retrieving revision 1.53
diff -u -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.53 mips.igen
--- sim/mips/mips.igen	14 Jan 2003 19:01:41 -0000	1.53
+++ sim/mips/mips.igen	7 Jun 2003 10:14:00 -0000
@@ -1347,12 +1350,12 @@ 000000,5.RS,5.RT,0000000000,011011:SPECI
   sign = 0;
   if (signed_p)
     {
-      if (op1 < 0)
+      if ((signed64) op1 < 0)
 	{
 	  op1 = - op1;
 	  ++sign;
 	}
-      if (op2 < 0)
+      if ((signed64) op2 < 0)
 	{
 	  op2 = - op2;
 	  ++sign;


             reply	other threads:[~2003-06-07 10:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-07 10:21 Richard Sandiford [this message]
2003-06-15 16:50 ` Richard Sandiford
2003-06-15 17:04   ` Andrew Cagney
     [not found]     ` <mailpost.1055696668.19518@news-sj1-1>
2003-06-18  1:18       ` cgd
     [not found]   ` <mailpost.1055695861.19245@news-sj1-1>
2003-06-18  1:13     ` cgd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wvn7k7y198k.fsf@talisman.cambridge.redhat.com \
    --to=rsandifo@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox