From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cp165172.hpdns.net (cp165172.hpdns.net [91.238.165.172]) by sourceware.org (Postfix) with ESMTPS id 539593858CDA for ; Wed, 11 Oct 2023 09:15:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 539593858CDA Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dyxyl.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dyxyl.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dyxyl.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=vg4kd9SjLJB06peoG50e9CS4xVJn+sellNYoLM7dbaA=; b=IYZ0nMthL/g5vsR5ITJJ3V7HNG 2mS1lmo/S23PpfHqklgvwMIGhCTIRdi2ekv6Um4CDd0lF8xJFXTw7sFGq/3IdPKZgfDuLxrWZteww qa2NmvQTpntYDzTDDVFaYAUxEZEEYuwd7A/T2zQhuG8DX0kopKMrz5I/cVElSTyDr43r63P2jSIlL wq0vycrsvP86qbUryHH/cVcxwl7Clh3DUg/GMGJ9cyrjCx8rO4EuMd0VjHE2q1fK+8irc+MvRfcLl 0gJHJFhtWioqmNULwgCqFafwjIznTQYf9pRUjacUbw6qa7vYAr4pcv9ImAD6JkTV+Hn17OaT6cmmt 57npAmMQ==; Received: from cpc92880-cmbg19-2-0-cust615.5-4.cable.virginm.net ([82.27.106.104]:38546 helo=localhost.localdomain) by cp165172.hpdns.net with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96.1) (envelope-from ) id 1qqVJ6-006UN8-1X; Wed, 11 Oct 2023 10:15:06 +0100 Received: by localhost.localdomain (Postfix, from userid 597) id 561FB161D56; Tue, 10 Oct 2023 22:35:40 +0100 (BST) From: Martin Simmons To: Jeff Law Cc: gdb@sourceware.org Subject: Re: Fwd: [RFA] Fix for mcore simulator In-Reply-To: <9f2c4844-c2ef-417b-ba09-9f71c7066759@gmail.com> (message from Jeff Law via Gdb on Thu, 5 Oct 2023 10:09:44 -0600) References: <1d854df9-b28c-41eb-af7c-e3a423885558@gmail.com> <9f2c4844-c2ef-417b-ba09-9f71c7066759@gmail.com> Date: Tue, 10 Oct 2023 22:35:40 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-YourOrg-MailScanner-Information: Please contact the ISP for more information X-YourOrg-MailScanner-ID: 1qqVJ6-006UN8-1X X-YourOrg-MailScanner: Found to be clean X-YourOrg-MailScanner-SpamCheck: X-YourOrg-MailScanner-From: qqxnjvamvxwx@dyxyl.com X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,DATE_IN_PAST_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cp165172.hpdns.net X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - dyxyl.com X-Get-Message-Sender-Via: cp165172.hpdns.net: authenticated_id: dyxyl/from_h X-Authenticated-Sender: cp165172.hpdns.net: qqxnjvamvxwx@dyxyl.com X-Source: X-Source-Args: X-Source-Dir: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> On Thu, 5 Oct 2023 10:09:44 -0600, Jeff Law via Gdb said: > > Of course if the code is supposed to behave the same, then that points > to problems elsewhere (assembler, linker, simulator). Sure enough the > mcore simulator was mis-handling the sign extension instructions. The > simulator implementation of sextb is via paired shift-by-24 operations. > Similarly the simulator implements sexth via paired shift-by-16 operations. > > The temporary holding the value was declared as a "long" thus this > approach worked fine for hosts with a 32 bit wide long and failed > miserably for hosts with a 64 bit wide long. > > This patch makes the shift count automatically adjust based on the size > of the temporary. It includes a simple test for sextb and sexth. I > have _not_ done a full audit of the mcore simulator for more 32->64 bit > issues. The use of long seems bogus to me. Why not just declare tmp as int32_t? __Martin