From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23748 invoked by alias); 14 Sep 2009 14:59:02 -0000 Received: (qmail 23736 invoked by uid 22791); 14 Sep 2009 14:59:01 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Sep 2009 14:58:58 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8EEwvdN007901; Mon, 14 Sep 2009 10:58:57 -0400 Received: from stone.twiddle.home (vpn-227-152.phx2.redhat.com [10.3.227.152]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8EEwuZV001354; Mon, 14 Sep 2009 10:58:56 -0400 Message-ID: <4AAE5A2D.6090605@redhat.com> Date: Mon, 14 Sep 2009 14:59:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Thunderbird/3.0b3 MIME-Version: 1.0 To: Mohamed Shafi CC: GCC Subject: Re: How to split 40bit data types load/store? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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-09/txt/msg00248.txt.bz2 On 09/14/2009 07:24 AM, Mohamed Shafi wrote: > Hello all, > > I am doing a port for a 32bit target in GCC 4.4.0. I have to support a > 40bit data (_Accum) in the port. The target has 40bit registers which > is a GPR and works as 32bit reg in other modes. The load and store for > _Accum happens in two step. The lower 32bit in one instruction and the > upper 8bit in the next instruction. I want to split the instruction > after reload. I tired to have a pattern (for load) like this: > > (define_insn "fn_load_ext_sa" > [(set (unspec:SA [(match_operand:DA 0 "register_operand" "")] > UNSPEC_FN_EXT) > (match_operand:SA 1 "memory_operand" ""))] > > (define_insn "fn_load_sa" > [(set (unspec:SA [(match_operand:DA 0 "register_operand" "")] > UNSPEC_FN) > (match_operand:SA 1 "memory_operand" ""))] Unspec on the left-hand-side isn't something that's supposed to happen, and is more than likely the cause of your problems. Try moving the unspec to the right-hand-side like: (set (reg:SI reg) (mem:SI addr)) (set (reg:SA reg) (unspec:SA [(reg:SI reg) (mem:QI addr)] UNSPEC_ACCUM_INSERT)) and (set (mem:SI addr) (reg:SI reg)) (set (mem:QI addr) (unspec:QI [(reg:SA reg)] UNSPEC_ACCUM_EXTRACT)) Note that after reload it's perfectly acceptable for a hard register to appear with the different SI and SAmodes. It's probably not too hard to define this with zero_extract sequences instead of unspecs, but given that these only appear after reload, it may not be worth the effort. r~