From patchwork Fri Dec 17 05:14:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chung-Lin Tang X-Patchwork-Id: 75835 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id A92641007D3 for ; Fri, 17 Dec 2010 16:14:45 +1100 (EST) Received: (qmail 21484 invoked by alias); 17 Dec 2010 05:14:37 -0000 Received: (qmail 21465 invoked by uid 22791); 17 Dec 2010 05:14:35 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 17 Dec 2010 05:14:31 +0000 Received: (qmail 32169 invoked from network); 17 Dec 2010 05:14:29 -0000 Received: from unknown (HELO ?192.168.1.16?) (cltang@127.0.0.2) by mail.codesourcery.com with ESMTPA; 17 Dec 2010 05:14:29 -0000 Message-ID: <4D0AF1C4.9000706@codesourcery.com> Date: Fri, 17 Dec 2010 13:14:44 +0800 From: Chung-Lin Tang User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: gcc-patches CC: Richard Earnshaw Subject: [PATCH, ARM] VFP index range X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi Richard, this is a VFP load/store index range patch that I submitted last year[1], which you approved at that time, but never got committed. I've added the Thumb-2 bits I missed then, corrected some stuff in the testcase, and re-submitting now. Re-tested without regressions. Is this ok for trunk? Thanks, Chung-Lin [1] http://gcc.gnu.org/ml/gcc-patches/2009-07/msg01844.html 2010-12-17 Chung-Lin Tang gcc/ * config/arm/arm.c (arm_legitimate_index_p): Add VFP load/store index range case. Change to SF/DFmode tests to avoid capturing HFmode. (thumb2_legitimate_index_p): Same. gcc/testsuite/ * gcc.target/arm/vfp-1.c (test_ldst): New test for VFP load/store immediate indexes. Index: config/arm/arm.c =================================================================== --- config/arm/arm.c (revision 167900) +++ config/arm/arm.c (working copy) @@ -5647,8 +5647,8 @@ /* Standard coprocessor addressing modes. */ if (TARGET_HARD_FLOAT - && (TARGET_FPA || TARGET_MAVERICK) - && (GET_MODE_CLASS (mode) == MODE_FLOAT + && (TARGET_VFP || TARGET_FPA || TARGET_MAVERICK) + && (mode == SFmode || mode == DFmode || (TARGET_MAVERICK && mode == DImode))) return (code == CONST_INT && INTVAL (index) < 1024 && INTVAL (index) > -1024 @@ -5768,8 +5768,8 @@ /* ??? Combine arm and thumb2 coprocessor addressing modes. */ /* Standard coprocessor addressing modes. */ if (TARGET_HARD_FLOAT - && (TARGET_FPA || TARGET_MAVERICK) - && (GET_MODE_CLASS (mode) == MODE_FLOAT + && (TARGET_VFP || TARGET_FPA || TARGET_MAVERICK) + && (mode == SFmode || mode == DFmode || (TARGET_MAVERICK && mode == DImode))) return (code == CONST_INT && INTVAL (index) < 1024 && INTVAL (index) > -1024 Index: testsuite/gcc.target/arm/vfp-1.c =================================================================== --- testsuite/gcc.target/arm/vfp-1.c (revision 167900) +++ testsuite/gcc.target/arm/vfp-1.c (working copy) @@ -125,3 +125,15 @@ d1 = u1; } +void test_ldst (float f[], double d[]) { + /* { dg-final { scan-assembler "flds.+ \\\[r0, #1020\\\]" } } */ + /* { dg-final { scan-assembler "flds.+ \\\[r0, #-1020\\\]" } } */ + /* { dg-final { scan-assembler "add.+ r0, #1024" } } */ + /* { dg-final { scan-assembler "fsts.+ \\\[r0, #0\\\]$" } } */ + f[256] = f[255] + f[-255]; + + /* { dg-final { scan-assembler "fldd.+ \\\[r1, #1016\\\]" } } */ + /* { dg-final { scan-assembler "fldd.+ \\\[r1, #-1016\\\]" } } */ + /* { dg-final { scan-assembler "fstd.+ \\\[r1, #256\\\]" } } */ + d[32] = d[127] + d[-127]; +}