From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13595 invoked by alias); 3 Mar 2010 06:52:42 -0000 Received: (qmail 13561 invoked by uid 22791); 3 Mar 2010 06:52:40 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 03 Mar 2010 06:52:34 +0000 Received: from spaceape9.eur.corp.google.com (spaceape9.eur.corp.google.com [172.28.16.143]) by smtp-out.google.com with ESMTP id o236qVgO001063 for ; Wed, 3 Mar 2010 06:52:32 GMT Received: from yxe35 (yxe35.prod.google.com [10.190.2.35]) by spaceape9.eur.corp.google.com with ESMTP id o236qT7M017412 for ; Tue, 2 Mar 2010 22:52:30 -0800 Received: by yxe35 with SMTP id 35so550385yxe.31 for ; Tue, 02 Mar 2010 22:52:28 -0800 (PST) Received: by 10.90.241.15 with SMTP id o15mr6448333agh.29.1267599148702; Tue, 02 Mar 2010 22:52:28 -0800 (PST) Received: from coign.google.com (adsl-71-133-8-30.dsl.pltn13.pacbell.net [71.133.8.30]) by mx.google.com with ESMTPS id 9sm1755808ywf.53.2010.03.02.22.52.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 02 Mar 2010 22:52:27 -0800 (PST) To: Prashant Purohit Cc: gcc-help@gcc.gnu.org Subject: Re: How "arm_gen_constant" Function In arm.c works? References: <27753882.post@talk.nabble.com> <27764440.post@talk.nabble.com> From: Ian Lance Taylor Date: Wed, 03 Mar 2010 06:52:00 -0000 In-Reply-To: <27764440.post@talk.nabble.com> (Prashant Purohit's message of "Tue\, 2 Mar 2010 21\:16\:08 -0800 \(PST\)") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2010-03/txt/msg00033.txt.bz2 Prashant Purohit writes: > I mean to say, as we can not generate all the constants from 8 bit > rotation scheme supported in ARM architecture, I just wanted to know the > logic behind that function which generates one Mov and one Add/Sub > instruction if that constant is not being generated by rotation scheme > alone. > e:g : suppose, the immediate constant is 1234 then that function will do > it as > > mov r3, #1232 > add r3, r3, #2 (In case of ARM) > Please tell me, how it splits that constant in to 1232 and 2. I don't know how to answer except to simply read the function. The code is right there. In this case I expect it happens in the loop at the end of the function. If you have any questions about how the function works, can you be more specific? Ian