From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3649 invoked by alias); 13 Aug 2009 13:23:43 -0000 Received: (qmail 3612 invoked by uid 22791); 13 Aug 2009 13:23:41 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-ew0-f223.google.com (HELO mail-ew0-f223.google.com) (209.85.219.223) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 13 Aug 2009 13:23:30 +0000 Received: by ewy23 with SMTP id 23so761037ewy.8 for ; Thu, 13 Aug 2009 06:23:28 -0700 (PDT) Received: by 10.210.43.10 with SMTP id q10mr1668197ebq.23.1250169808235; Thu, 13 Aug 2009 06:23:28 -0700 (PDT) Received: from yakj.usersys.redhat.com (nat-pool-brq.redhat.com [62.40.79.66]) by mx.google.com with ESMTPS id 5sm1608989eyf.8.2009.08.13.06.23.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 13 Aug 2009 06:23:27 -0700 (PDT) Message-ID: <4A8413CE.5070906@gnu.org> Date: Thu, 13 Aug 2009 14:42:00 -0000 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2 MIME-Version: 1.0 To: Greg McGary CC: gcc@gcc.gnu.org Subject: Re: How to deal with 48-bit pointers and 32-bit integers References: <4A833BB8.2090209@mcgary.org> In-Reply-To: <4A833BB8.2090209@mcgary.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-08/txt/msg00218.txt.bz2 > I chose to define Pmode as PDImode, and write PDI patterns for pointer > moves & arithmetic. POINTER_SIZE is 64 bits, UNITS_PER_WORD is 4. > FUNCTION_ARG_ADVANCE arranges for both SImode and PDImode values to > occupy a single register. I have the port mostly working (passes 90% of > execution tests), but find myself painted into a corner in some cases. > What currently vexes me is when GCC wants to promote a PDImode register > (say r1) to DImode, then needs to truncate down to SImode for some kind > of ALU op, say pointer subtraction. The desired quantity is the > low-order 32 bits of r1, but GCC thinks the promotion to DImode implies > a pair of 32-bit regs (r1, r2) and since this is a big-endian machine, > it wants to deliver the low-order bits as the subreg r2. Maybe you can define TRULY_NOOP_TRUNCATION to be zero for source PDImode and destination SImode, and define a truncatepdisi2 pattern that just throws away the segment. I'm not sure however whether GCC will go through DImode anyway. Alternatively, maybe you can define extendpdidi2 so that it will put the segment in r1 and the low-order bits in r2. Paolo