From patchwork Thu Mar 8 16:19:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Stubbs X-Patchwork-Id: 7176 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 9615B23E77 for ; Thu, 8 Mar 2012 16:19:26 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 4A786A18842 for ; Thu, 8 Mar 2012 16:19:26 +0000 (UTC) Received: by yhpp61 with SMTP id p61so365127yhp.11 for ; Thu, 08 Mar 2012 08:19:25 -0800 (PST) Received: by 10.50.183.137 with SMTP id em9mr9648918igc.58.1331223565462; Thu, 08 Mar 2012 08:19:25 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.53.18 with SMTP id k18csp13666ibg; Thu, 8 Mar 2012 08:19:24 -0800 (PST) Received: by 10.50.184.168 with SMTP id ev8mr7709707igc.29.1331223563940; Thu, 08 Mar 2012 08:19:23 -0800 (PST) Received: from relay1.mentorg.com (relay1.mentorg.com. [192.94.38.131]) by mx.google.com with ESMTPS id aj6si2847990igc.60.2012.03.08.08.19.23 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 08 Mar 2012 08:19:23 -0800 (PST) Received-SPF: neutral (google.com: 192.94.38.131 is neither permitted nor denied by best guess record for domain of Andrew_Stubbs@mentor.com) client-ip=192.94.38.131; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.94.38.131 is neither permitted nor denied by best guess record for domain of Andrew_Stubbs@mentor.com) smtp.mail=Andrew_Stubbs@mentor.com Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1S5g3m-0005ey-Hy from Andrew_Stubbs@mentor.com ; Thu, 08 Mar 2012 08:19:22 -0800 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 8 Mar 2012 08:19:04 -0800 Received: from [172.30.12.212] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.1.289.1; Thu, 8 Mar 2012 16:19:15 +0000 Message-ID: <4F58DBFF.6080002@codesourcery.com> Date: Thu, 8 Mar 2012 16:19:11 +0000 From: Andrew Stubbs User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: Richard Earnshaw CC: "gcc-patches@gcc.gnu.org" , "patches@linaro.org" Subject: Re: [PATCH][ARM] NEON DImode not References: <4F4E3AA5.1070804@codesourcery.com> <4F4E67B3.8050002@arm.com> <4F4F7226.6070809@codesourcery.com> <4F4FACC2.2050508@arm.com> In-Reply-To: <4F4FACC2.2050508@arm.com> X-OriginalArrivalTime: 08 Mar 2012 16:19:04.0359 (UTC) FILETIME=[2E069370:01CCFD47] X-Gm-Message-State: ALoCoQnx/kv7GQchC++hJVbr4hQUm7zixx/hcsY4Gual5Oy3bey3IvQWmuk1R/bpZSP4pqVfxK59 On 01/03/12 17:07, Richard Earnshaw wrote: > The RTL part of one_cmpldi2_internal and one_cmpldi2_neon are the same. > Given that we now have controls to determine when an alternative is > enabled it's generally better to have just one pattern here and turn on > the alternatives that are suitable rather than having multiple patterns. > > You're already half doing this with the nota8 and onlya8 controls. Ok, this patch unifies the two and emits the NEON instructions directly from the arm.md pattern. I was under the impression that it is desirable to keep the neon stuff in neon.md as far as possible. OK? Andrew P.S. The insn_enabled code is not ideal, but the 'arch' attribute that might normally deal with this is already in use. Alternative ways might be to have a variation on the 'w' constraint ('W'?) that is conditional on TARGET_NEON, or to have compound arch values (e.g. "onlya8_neon")? 2012-03-08 Andrew Stubbs gcc/ * config/arm/arm.md (one_cmpldi2): Add NEON support. --- gcc/config/arm/arm.md | 26 ++++++++++++++++++++------ 1 files changed, 20 insertions(+), 6 deletions(-) diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 751997f..27a0f81 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -4207,11 +4207,16 @@ "") (define_insn_and_split "one_cmpldi2" - [(set (match_operand:DI 0 "s_register_operand" "=&r,&r") - (not:DI (match_operand:DI 1 "s_register_operand" "0,r")))] + [(set (match_operand:DI 0 "s_register_operand" "=w,&r,&r,?w") + (not:DI (match_operand:DI 1 "s_register_operand" " w, 0, r, w")))] "TARGET_32BIT" - "#" - "TARGET_32BIT && reload_completed" + "@ + vmvn\t%P0, %P1 + # + # + vmvn\t%P0, %P1" + "TARGET_32BIT && reload_completed + && arm_general_register_operand (operands[0], DImode)" [(set (match_dup 0) (not:SI (match_dup 1))) (set (match_dup 2) (not:SI (match_dup 3)))] " @@ -4221,8 +4226,17 @@ operands[3] = gen_highpart (SImode, operands[1]); operands[1] = gen_lowpart (SImode, operands[1]); }" - [(set_attr "length" "8") - (set_attr "predicable" "yes")] + [(set_attr "length" "*,8,8,*") + (set_attr "predicable" "yes") + (set_attr "neon_type" "neon_int_1,*,*,neon_int_1") + (set_attr "arch" "nota8,*,*,onlya8") + (set_attr_alternative "insn_enabled" + [(if_then_else (match_test "TARGET_NEON") + (const_string "yes") (const_string "no")) + (const_string "yes") + (const_string "yes") + (if_then_else (match_test "TARGET_NEON") + (const_string "yes") (const_string "no"))])] ) (define_expand "one_cmplsi2"