From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5862 invoked by alias); 19 May 2005 03:03:54 -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 5851 invoked from network); 19 May 2005 03:03:52 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 19 May 2005 03:03:52 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j4J33pUb008406 for ; Wed, 18 May 2005 23:03:51 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j4J33pO04583; Wed, 18 May 2005 23:03:51 -0400 Received: from ballpeen.sfbay.redhat.com (ballpeen.sfbay.redhat.com [172.16.24.33]) by potter.sfbay.redhat.com (8.12.8/8.12.8) with ESMTP id j4J33na8019104; Wed, 18 May 2005 23:03:50 -0400 Received: from ballpeen.sfbay.redhat.com (ballpeen.sfbay.redhat.com [127.0.0.1]) by ballpeen.sfbay.redhat.com (8.13.1/8.13.1) with ESMTP id j4J33nOZ008264; Wed, 18 May 2005 20:03:49 -0700 Received: (from rth@localhost) by ballpeen.sfbay.redhat.com (8.13.1/8.13.1/Submit) id j4J33nbu008263; Wed, 18 May 2005 20:03:49 -0700 X-Authentication-Warning: ballpeen.sfbay.redhat.com: rth set sender to rth@redhat.com using -f Date: Thu, 19 May 2005 03:23:00 -0000 From: Richard Henderson To: Joel Brobecker Cc: gdb-patches@sources.redhat.com Subject: Re: Question: Checking register value in buffer Message-ID: <20050519030349.GA8255@redhat.com> References: <20050519020443.GP1462@adacore.com> <20050519022256.GA8204@redhat.com> <20050519024857.GY12565@adacore.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050519024857.GY12565@adacore.com> User-Agent: Mutt/1.4.1i X-SW-Source: 2005-05/txt/msg00463.txt.bz2 On Thu, May 19, 2005 at 12:48:57PM +1000, Joel Brobecker wrote: > In terms of computing the mask, I'm thinking of using something > like this: > > sign_mask = 1 << (sizeof (rav) * TARGET_CHAR_BIT - 1); This confuses host and target notions. You would have wanted the *host* CHAR_BIT, since you're using the host sizeof. > zero_mask = sign_mask ^ -1; This fails if rav is *wider* than 64-bits. > Are there better ways of computing these masks? How about just sign = (LONGEST)1 << 63 zero = sign - 1; r~