From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21694 invoked by alias); 1 Feb 2008 10:26:20 -0000 Received: (qmail 21684 invoked by uid 22791); 1 Feb 2008 10:26:19 -0000 X-Spam-Check-By: sourceware.org Received: from s200aog12.obsmtp.com (HELO s200aog12.obsmtp.com) (207.126.144.126) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 01 Feb 2008 10:25:57 +0000 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob012.postini.com ([207.126.147.11]) with SMTP; Fri, 01 Feb 2008 10:25:54 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A8499DAE1 for ; Fri, 1 Feb 2008 10:25:53 +0000 (GMT) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 65A834BE5F for ; Fri, 1 Feb 2008 10:25:53 +0000 (GMT) Received: from [164.129.12.194] (bri0669.bri.st.com [164.129.12.194]) by mail1.bri.st.com (MOS 3.7.5a-GA) with ESMTP id CJQ50382 (AUTH stubbsa); Fri, 1 Feb 2008 10:25:51 GMT Message-ID: <47A2F3AF.4090009@st.com> Date: Fri, 01 Feb 2008 10:26:00 -0000 From: Andrew STUBBS User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: GDB Patches Subject: [patch][sh] mac.l insn endian issue Content-Type: multipart/mixed; boundary="------------070708020108020605060606" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-02/txt/msg00005.txt.bz2 This is a multi-part message in MIME format. --------------070708020108020605060606 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 151 Hi all, The mac.l simulator implementation is broken on big endian hosts, such as Sparc Solaris. The attached patch should fix the problem. Andrew --------------070708020108020605060606 Content-Type: text/plain; name="patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch.txt" Content-length: 1208 2008-01-31 Antony King Fix INSbl28170: * interp.c (macl): Fix non-portable implementation. --- sim/sh/interp.c@@/main/INSIGHT-6.6-ST-1.0-int/1 2007-08-17 15:11:45.000000000 +0100 +++ sim/sh/interp.c 2008-01-31 18:33:16.000000000 +0000 @@ -1433,14 +1433,9 @@ int m, n; { long tempm, tempn; - long prod, macl, mach, sum; - long long ans,ansl,ansh,t; - unsigned long long high,low,combine; - union mac64 - { - long m[2]; /* mach and macl*/ - long long m64; /* 64 bit MAC */ - }mac64; + long macl, mach; + long long ans; + long long mac64; tempm = RSLAT (regs[m]); regs[m] += 4; @@ -1451,15 +1446,15 @@ mach = MACH; macl = MACL; - mac64.m[0] = macl; - mac64.m[1] = mach; + mac64 = ((long long) macl & 0xffffffff) | + ((long long) mach & 0xffffffff) << 32; ans = (long long) tempm * (long long) tempn; /* Multiply 32bit * 32bit */ - mac64.m64 += ans; /* Accumulate 64bit + 64 bit */ + mac64 += ans; /* Accumulate 64bit + 64 bit */ - macl = mac64.m[0]; - mach = mac64.m[1]; + macl = (long) (mac64 & 0xffffffff); + mach = (long) ((mac64 >> 32) & 0xffffffff); if (S) /* Store only 48 bits of the result */ { --------------070708020108020605060606--