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 handling of unsigned muls in vr.igen
Date: Tue, 15 Apr 2003 19:04:00 -0000	[thread overview]
Message-ID: <wvnr883a8ic.fsf@talisman.cambridge.redhat.com> (raw)

Oops, it looks like I managed to introduce a bug while contributing the
VR simulator stuff.  Operands to unsigned multiplications were being
multiplied in their original sign-extended form.

Patch tested against gcc's mips-rewrite branch, fixes some
test failures.  No regressions.  Please install if OK.

Richard


	* vr.igen (do_vr_mul_op): Zero-extend the low 32 bits of
	unsigned operands.

Index: sim/mips/vr.igen
===================================================================
RCS file: /cvs/src/src/sim/mips/vr.igen,v
retrieving revision 1.2
diff -u -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.2 vr.igen
--- sim/mips/vr.igen	5 Jan 2003 07:56:59 -0000	1.2
+++ sim/mips/vr.igen	15 Apr 2003 18:54:29 -0000
@@ -73,7 +73,9 @@
 		      (long) CIA);
 
   TRACE_ALU_INPUT2 (x, y);
-  product = (unsigned_p ? x * y : EXTEND32 (x) * EXTEND32 (y));
+  product = (unsigned_p
+	     ? V8_4 (x, 1) * V8_4 (y, 1)
+	     : EXTEND32 (x) * EXTEND32 (y));
   result = (subtract_p ? lhs - product : lhs + product);
   if (saturate_p)
     {


             reply	other threads:[~2003-04-15 19:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-15 19:04 Richard Sandiford [this message]
     [not found] ` <mailpost.1050433474.137@news-sj1-1>
2003-04-16  0:52   ` 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=wvnr883a8ic.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