From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27946 invoked by alias); 1 Feb 2003 03:23:34 -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 27939 invoked from network); 1 Feb 2003 03:23:34 -0000 Received: from unknown (HELO mail.cs.umass.edu) (128.119.243.168) by 172.16.49.205 with SMTP; 1 Feb 2003 03:23:34 -0000 Received: from localhost (IDENT:78bNWqRzLOz6j6ukyJpuEyrI6atgD2oX@loki.cs.umass.edu [128.119.243.168]) by mail.cs.umass.edu (8.12.6/8.12.5) with ESMTP id h113NW1c014244; Fri, 31 Jan 2003 22:23:32 -0500 Date: Sat, 01 Feb 2003 03:23:00 -0000 Message-Id: <20030131.222329.93642824.kazu@cs.umass.edu> To: msnyder@redhat.com Cc: gdb-patches@sources.redhat.com Subject: Re: Unreviewed patches From: Kazu Hirata In-Reply-To: <3E3B229D.67F2E805@redhat.com> References: <3E39E145.A5B01D17@redhat.com> <20030130.234517.112286807.kazu@cs.umass.edu> <3E3B229D.67F2E805@redhat.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Checked: This message probably not SPAM X-Spam-Score: -3.4, Required: 5 X-Spam-Tests: IN_REP_TO X-Spam-Report: SPAM: -3.4 hits, 5 required; SPAM: * -3.4 -- Found a In-Reply-To header X-Scanned-By: MIMEDefang 2.26 (www . roaringpenguin . com / mimedefang) X-SW-Source: 2003-02/txt/msg00010.txt.bz2 Hi Michael, > Yes, thanks. My problem is this: your patch uses a host-order > sign-extend to simulate a target-order sign-extend. If the host > and target have different byte orders, you lose. That's probably > why the simulator uses breg[] to fetch bytes, instead of using > wreg and masking. > > I suggest that it would be comparatively easy to extend the > breg[] array so that it would cover at least the first three > bytes in the register (and possibly all four, just because > it's no extra effort). Something like the attached. > > Then the code that references breg[] does not need to change. I understand your concern. But then if GET_W_REG may give a byte-swapped value, would the following be endian unsafe? case O (O_ADD, SW): rd = GET_W_REG (code->dst.reg); ea = fetch (&code->src); res = rd + ea; goto alu16; The addition is done in host-order. Kazu Hirata