From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20426 invoked by alias); 24 Jun 2014 09:25:15 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 20393 invoked by uid 89); 24 Jun 2014 09:25:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 24 Jun 2014 09:25:11 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Tue, 24 Jun 2014 10:25:09 +0100 Received: from [10.1.201.52] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 24 Jun 2014 10:24:58 +0100 Message-ID: <53A943F3.6090204@arm.com> Date: Tue, 24 Jun 2014 09:25:00 -0000 From: Yufeng Zhang User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Ramana Radhakrishnan Subject: [PING] [PATCH, ARM] Improve code-gen for multiple shifted accumulations in array indexing References: <53A1BEFC.1040306@arm.com> <53A1BFEF.30408@arm.com> In-Reply-To: <53A1BFEF.30408@arm.com> X-MC-Unique: 114062410250903801 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg01864.txt.bz2 Ping~ Original posted here: https://gcc.gnu.org/ml/gcc-patches/2014-06/msg01492.html Thanks, Yufeng On 06/18/14 17:35, Yufeng Zhang wrote: > This time with patch... Apologize. > > Yufeng > > On 06/18/14 17:31, Yufeng Zhang wrote: >> Hi, >> >> This patch improves the code-gen of -marm in the case of two-dimensional >> array access. >> >> Given the following code: >> >> typedef struct { int x,y,a,b; } X; >> >> int >> f7a(X p[][4], int x, int y) >> { >> return p[x][y].a; >> } >> >> The code-gen on -O2 -marm -mcpu=3Dcortex-a15 is currently >> >> mov r2, r2, asl #4 >> add r1, r2, r1, asl #6 >> add r0, r0, r1 >> ldr r0, [r0, #8] >> bx lr >> >> With the patch, we'll get: >> >> add r1, r0, r1, lsl #6 >> add r2, r1, r2, lsl #4 >> ldr r0, [r2, #8] >> bx lr >> >> The -mthumb code-gen had been OK. >> >> The patch has passed the bootstrapping on cortex-a15 and the >> arm-none-eabi regtest, with no code-gen difference in spec2k >> (unfortunately). >> >> OK for the trunk? >> >> Thanks, >> Yufeng >> >> gcc/ >> >> * config/arm/arm.c (arm_reassoc_shifts_in_address): New declaration >> and new function. >> (arm_legitimize_address): Call the new functions. >> (thumb_legitimize_address): Prefix the declaration with static. >> >> gcc/testsuite/ >> >> * gcc.target/arm/shifted-add-1.c: New test. >> * gcc.target/arm/shifted-add-2.c: Ditto. >> >>