From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13559 invoked by alias); 10 May 2006 01:32:42 -0000 Received: (qmail 13551 invoked by uid 22791); 10 May 2006 01:32:41 -0000 X-Spam-Check-By: sourceware.org Received: from 209-232-97-206.ded.pacbell.net (HELO dns0.mips.com) (209.232.97.206) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 10 May 2006 01:32:38 +0000 Received: from mercury.mips.com (sbcns-dmz [209.232.97.193]) by dns0.mips.com (8.12.11/8.12.11) with ESMTP id k4A1WZP7009141 for ; Tue, 9 May 2006 18:32:35 -0700 (PDT) Received: from exchange.MIPS.COM (exchange [192.168.20.29]) by mercury.mips.com (8.13.5/8.13.5) with ESMTP id k4A1WarB002398; Tue, 9 May 2006 18:32:36 -0700 (PDT) Received: from pcfu ([192.168.20.169]) by exchange.MIPS.COM with Microsoft SMTPSVC(6.0.3790.211); Tue, 9 May 2006 18:31:23 -0700 Message-ID: <005401c673d1$975b4ce0$a914a8c0@MIPS.COM> Reply-To: "Chao-ying Fu" From: "Chao-ying Fu" To: Cc: "Thekkath, Radhika" Subject: [patch] Fix MIPS32 DSP simulator bugs Date: Wed, 10 May 2006 01:32:00 -0000 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0051_01C67396.EAD40550" X-Mailer: Microsoft Outlook Express 6.00.2800.1807 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00188.txt.bz2 This is a multi-part message in MIME format. ------=_NextPart_000_0051_01C67396.EAD40550 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-length: 488 Hello, This patch fixed bugs in MIPS32 DSP rounding instructions. Test with mipsisa32-elf and mipsisa64-elf. Is it ok to check in? Thanks a lot! Regards, Chao-ying src/sim/mips/ChangeLog 2006-05-09 Chao-ying Fu dsp.igen (do_ph_shift, do_w_shra): Fix bugs for rounding instructions. src/sim/testsuite/sim/mips/ChangeLog 2006-05-09 Chao-ying Fu * mips32-dsp.s: Add some tests for shra_r.ph, shrav_r.ph, shra_r.w, shrav_r.w. ------=_NextPart_000_0051_01C67396.EAD40550 Content-Type: application/octet-stream; name="sim.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="sim.diff" Content-length: 4214 Index: mips/dsp.igen=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/sim/mips/dsp.igen,v=0A= retrieving revision 1.1=0A= diff -c -3 -p -r1.1 dsp.igen=0A= *** mips/dsp.igen 14 Dec 2005 23:07:56 -0000 1.1=0A= --- mips/dsp.igen 10 May 2006 01:17:30 -0000=0A= ***************=0A= *** 193,201 ****=0A= }=0A= else // right=0A= {=0A= ! if (sat =3D=3D 1 && shift !=3D 0)=0A= ! h0 +=3D (1 << (shift - 1));=0A= ! h0 =3D h0 >> shift;=0A= }=0A= =20=20=0A= result |=3D ((unsigned32)((unsigned16)h0) << i);=0A= --- 193,202 ----=0A= }=0A= else // right=0A= {=0A= ! if (sat =3D=3D 1 && shift !=3D 0 && (h0 & (1 << (shift-1))))=0A= ! h0 =3D (h0 >> shift) + 1;=0A= ! else=0A= ! h0 =3D h0 >> shift;=0A= }=0A= =20=20=0A= result |=3D ((unsigned32)((unsigned16)h0) << i);=0A= ***************=0A= *** 246,254 ****=0A= {=0A= unsigned32 result =3D GPR[rt];=0A= signed32 h0 =3D (signed32)result;=0A= ! if (shift !=3D 0)=0A= ! h0 +=3D (1 << (shift - 1));=0A= ! h0 =3D h0 >> shift;=0A= GPR[rd] =3D EXTEND32 (h0);=0A= }=0A= =20=20=0A= --- 247,256 ----=0A= {=0A= unsigned32 result =3D GPR[rt];=0A= signed32 h0 =3D (signed32)result;=0A= ! if (shift !=3D 0 && (h0 & (1 << (shift-1))))=0A= ! h0 =3D (h0 >> shift) + 1;=0A= ! else=0A= ! h0 =3D h0 >> shift;=0A= GPR[rd] =3D EXTEND32 (h0);=0A= }=0A= =20=20=0A= Index: testsuite/sim/mips/mips32-dsp.s=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/sim/testsuite/sim/mips/mips32-dsp.s,v=0A= retrieving revision 1.1=0A= diff -c -3 -p -r1.1 mips32-dsp.s=0A= *** testsuite/sim/mips/mips32-dsp.s 14 Dec 2005 23:09:26 -0000 1.1=0A= --- testsuite/sim/mips/mips32-dsp.s 10 May 2006 01:17:33 -0000=0A= *************** DIAG:=0A= *** 332,343 ****=0A= --- 332,348 ----=0A= dspck_dtsaio shra_r.ph, 0x10001, 0x20001, 1, 0x0, 0x0=0A= dspck_dtsaio shra_r.ph, 0x10001, 0x10001, 1, 0x0, 0x0=0A= dspck_dtsaio shra_r.ph, 0x0, 0x10001, 2, 0x0, 0x0=0A= + dspck_dtsaio shra_r.ph, 0x7fff8000, 0x7fff8000, 0, 0x0, 0x0=0A= + dspck_dtsaio shra_r.ph, 0x4000c000, 0x7fff8000, 1, 0x0, 0x0=0A= + dspck_dtsaio shra_r.ph, 0x2000e000, 0x7ffe8000, 2, 0x0, 0x0=0A= =20=20=0A= writemsg "[44] Test shrav_r.ph"=0A= dspck_dstio shrav_r.ph, 0x20001, 0x30002, 0x1, 0x0, 0x0=0A= dspck_dstio shrav_r.ph, 0x10001, 0x20001, 0x1, 0x0, 0x0=0A= dspck_dstio shrav_r.ph, 0x10001, 0x10001, 0x1, 0x0, 0x0=0A= dspck_dstio shrav_r.ph, 0x0, 0x10001, 0x2, 0x0, 0x0=0A= + dspck_dstio shrav_r.ph, 0x7fff8000, 0x7fff8000, 0, 0x0, 0x0=0A= + dspck_dstio shrav_r.ph, 0x2000e000, 0x7fff8000, 2, 0x0, 0x0=0A= =20=20=0A= writemsg "[45] Test shra_r.w"=0A= dspck_dtsaio shra_r.w, 0x1, 0x2, 1, 0x0, 0x0=0A= *************** DIAG:=0A= *** 345,350 ****=0A= --- 350,358 ----=0A= dspck_dtsaio shra_r.w, 0x8001, 0x10001, 1, 0x0, 0x0=0A= dspck_dtsaio shra_r.w, 0x1, 0x10001, 17, 0x0, 0x0=0A= dspck_dtsaio shra_r.w, 0xffffc001, 0x80010001, 17, 0x0, 0x0=0A= + dspck_dtsaio shra_r.w, 0x7fffffff, 0x7fffffff, 0, 0x0, 0x0=0A= + dspck_dtsaio shra_r.w, 0x40000000, 0x7fffffff, 1, 0x0, 0x0=0A= + dspck_dtsaio shra_r.w, 0x20000000, 0x7ffffffe, 2, 0x0, 0x0=0A= =20=20=0A= writemsg "[46] Test shrav_r.w"=0A= dspck_dstio shrav_r.w, 0x1, 0x2, 0x1, 0x0, 0x0=0A= *************** DIAG:=0A= *** 352,357 ****=0A= --- 360,368 ----=0A= dspck_dstio shrav_r.w, 0x8001, 0x10001, 0x1, 0x0, 0x0=0A= dspck_dstio shrav_r.w, 0x8001, 0x10001, 0x21, 0x0, 0x0=0A= dspck_dstio shrav_r.w, 0x4000, 0x10001, 0x2, 0x0, 0x0=0A= + dspck_dstio shrav_r.w, 0x7fffffff, 0x7fffffff, 0x0, 0x0, 0x0=0A= + dspck_dstio shrav_r.w, 0x10000000, 0x7ffffffc, 0x3, 0x0, 0x0=0A= + dspck_dstio shrav_r.w, 0x08000000, 0x7ffffff8, 0x4, 0x0, 0x0=0A= =20=20=0A= writemsg "[47] Test muleu_s.ph.qbl"=0A= dspck_dstio muleu_s.ph.qbl, 0x0, 0x0, 0x0, 0x0, 0x0=0A= ------=_NextPart_000_0051_01C67396.EAD40550--