Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [mips sim]: Fix handling of unsigned muls in vr.igen
@ 2003-04-15 19:04 Richard Sandiford
       [not found] ` <mailpost.1050433474.137@news-sj1-1>
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Sandiford @ 2003-04-15 19:04 UTC (permalink / raw)
  To: gdb-patches

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)
     {


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-04-16  0:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-15 19:04 [mips sim]: Fix handling of unsigned muls in vr.igen Richard Sandiford
     [not found] ` <mailpost.1050433474.137@news-sj1-1>
2003-04-16  0:52   ` cgd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox