From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 500 invoked by alias); 15 Apr 2003 19:04:24 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 487 invoked from network); 15 Apr 2003 19:04:22 -0000 Received: from unknown (HELO talisman.cambridge.redhat.com) (213.86.99.237) by sources.redhat.com with SMTP; 15 Apr 2003 19:04:22 -0000 Received: (from rsandifo@localhost) by talisman.cambridge.redhat.com (8.11.6/8.11.6) id h3FJ37l01219; Tue, 15 Apr 2003 20:03:07 +0100 X-Authentication-Warning: talisman.cambridge.redhat.com: rsandifo set sender to rsandifo@redhat.com using -f To: gdb-patches@sources.redhat.com Subject: [mips sim]: Fix handling of unsigned muls in vr.igen From: Richard Sandiford Date: Tue, 15 Apr 2003 19:04:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-04/txt/msg00310.txt.bz2 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) {