From patchwork Fri Feb 26 22:43:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evandro Menezes X-Patchwork-Id: 589304 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id DE2A9140325 for ; Sat, 27 Feb 2016 09:43:44 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=YuqkmYGd; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=LIE4n08MbKB3BBPiX YOYqpNGwVeTdGdh2SsQQ9o8oGYHFwynhgZTFq7OXMH4avRn5/N4oIlGnJKsZdDll JaC+uIkxXPTuLp34D5tHFMrDibcwoRBASsG3mBUaP0v3KLTbW7sXzp0QuVRs+CBG H0Pv9IG4U1RP0986hHHsrIJj1U= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=g2TtrXn3lo3Bk6q4wsHiFvz AVG8=; b=YuqkmYGdfKyzDS85KDR7jODr7Zb59Db7qiNpujvLQjxX4zkSid4FYwX Y32E+bcHKAdEkWen1wJOXQ0WXXh/XWQ7r8aScPHb2W9etbRiB+aR1kQS9DbNuuMx 08zcRuB1WQzBr4N3qCz672YRylG4MBl6jtHaL3kKR5U+Z4e6taV8= Received: (qmail 12077 invoked by alias); 26 Feb 2016 22:43:33 -0000 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 Received: (qmail 12046 invoked by uid 89); 26 Feb 2016 22:43:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=HContent-type:mixed, sk:nonimme, ww, HContent-type:multipart X-HELO: usmailout4.samsung.com Received: from mailout4.w2.samsung.com (HELO usmailout4.samsung.com) (211.189.100.14) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 26 Feb 2016 22:43:31 +0000 Received: from uscpsbgm1.samsung.com (u114.gpu85.samsung.co.kr [203.254.195.114]) by usmailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O3600ICCF4GEF80@usmailout4.samsung.com> for gcc-patches@gcc.gnu.org; Fri, 26 Feb 2016 17:43:28 -0500 (EST) Received: from ussync1.samsung.com ( [203.254.195.81]) by uscpsbgm1.samsung.com (USCPMTA) with SMTP id 36.D5.04845.015D0D65; Fri, 26 Feb 2016 17:43:28 -0500 (EST) Received: from [172.31.207.192] ([105.140.31.209]) by ussync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O360047IF4FVT90@ussync1.samsung.com>; Fri, 26 Feb 2016 17:43:28 -0500 (EST) Subject: Re: [PATCH][AArch64] Replace insn to zero up DF register To: Wilco Dijkstra References: <56A94F35.8000000@samsung.com> Cc: "gcc-patches@gcc.gnu.org" , nd , Marcus Shawcroft , Kyrylo Tkachov , James Greenhalgh From: Evandro Menezes Message-id: <56D0D50E.8030802@samsung.com> Date: Fri, 26 Feb 2016 16:43:26 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-version: 1.0 In-reply-to: Content-type: multipart/mixed; boundary=------------030202070008090206020600 X-IsSubscribed: yes On 02/26/16 06:37, Wilco Dijkstra wrote: > Evandro Menezes wrote: >> I have a question though: is it necessary to add the "fp" and "simd" >> attributes to both movsf_aarch64 and movdf_aarch64 as well? > You need at least the "simd" attribute, but providing "fp" as well is clearer > (in principle the TARGET_FLOAT check in the pattern condition is > redundant as a result, but the movhf and movtf patterns already do both). > > Also you want to use the smallest possible SIMD size as these are > scalar operations and some microarchitectures execute 64-bit operations > more efficiently than 128-bit ones, so: > > mov\\t%0.h[0], %w1 > + movi\\t%0.4h, #0 > umov\\t%w0, %1.h[0] > > fmov\\t%s0, %w1 > + movi\\t%0.2s, #0 > fmov\\t%w0, %s1 > > With those changes it should be ready for commit once you get the OK from James/Marcus. Replace insn to zero up SIMD registers gcc/ * config/aarch64/aarch64.md (*movhf_aarch64): Add "movi %0, #0" to zero up register. (*movsf_aarch64): Likewise and add "simd" and "fp" attributes. (*movdf_aarch64): Likewise. Please, verify the new "simd" and "fp" attributes for SF and DF. Thank you, From d447411ea85f065faa77d56cb143effffb07a467 Mon Sep 17 00:00:00 2001 From: Evandro Menezes Date: Mon, 19 Oct 2015 18:31:48 -0500 Subject: [PATCH] Replace insn to zero up SIMD registers gcc/ * config/aarch64/aarch64.md (*movhf_aarch64): Add "movi %0, #0" to zero up register. (*movsf_aarch64): Likewise and add "simd" and "fp" attributes. (*movdf_aarch64): Likewise. --- gcc/config/aarch64/aarch64.md | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 68676c9..a5661ed 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -1163,12 +1163,13 @@ ) (define_insn "*movhf_aarch64" - [(set (match_operand:HF 0 "nonimmediate_operand" "=w, ?r,w,w,m,r,m ,r") - (match_operand:HF 1 "general_operand" "?rY, w,w,m,w,m,rY,r"))] + [(set (match_operand:HF 0 "nonimmediate_operand" "=w,w,?r,w,w,m,r,m ,r") + (match_operand:HF 1 "general_operand" "?r,Y, w,w,m,w,m,rY,r"))] "TARGET_FLOAT && (register_operand (operands[0], HFmode) || aarch64_reg_or_fp_zero (operands[1], HFmode))" "@ mov\\t%0.h[0], %w1 + movi\\t%0.4h, #0 umov\\t%w0, %1.h[0] mov\\t%0.h[0], %1.h[0] ldr\\t%h0, %1 @@ -1176,19 +1177,20 @@ ldrh\\t%w0, %1 strh\\t%w1, %0 mov\\t%w0, %w1" - [(set_attr "type" "neon_from_gp,neon_to_gp,neon_move,\ + [(set_attr "type" "neon_from_gp,neon_move,neon_to_gp,neon_move,\ f_loads,f_stores,load1,store1,mov_reg") - (set_attr "simd" "yes,yes,yes,*,*,*,*,*") - (set_attr "fp" "*,*,*,yes,yes,*,*,*")] + (set_attr "simd" "yes,yes,yes,yes,*,*,*,*,*") + (set_attr "fp" "*,*,*,*,yes,yes,*,*,*")] ) (define_insn "*movsf_aarch64" - [(set (match_operand:SF 0 "nonimmediate_operand" "=w, ?r,w,w ,w,m,r,m ,r") - (match_operand:SF 1 "general_operand" "?rY, w,w,Ufc,m,w,m,rY,r"))] + [(set (match_operand:SF 0 "nonimmediate_operand" "=w,w,?r,w,w ,w,m,r,m ,r") + (match_operand:SF 1 "general_operand" "?r,Y, w,w,Ufc,m,w,m,rY,r"))] "TARGET_FLOAT && (register_operand (operands[0], SFmode) || aarch64_reg_or_fp_zero (operands[1], SFmode))" "@ fmov\\t%s0, %w1 + movi\\t%0.2s, #0 fmov\\t%w0, %s1 fmov\\t%s0, %s1 fmov\\t%s0, %1 @@ -1197,17 +1199,20 @@ ldr\\t%w0, %1 str\\t%w1, %0 mov\\t%w0, %w1" - [(set_attr "type" "f_mcr,f_mrc,fmov,fconsts,\ - f_loads,f_stores,load1,store1,mov_reg")] + [(set_attr "type" "f_mcr,neon_move,f_mrc,fmov,fconsts,\ + f_loads,f_stores,load1,store1,mov_reg") + (set_attr "simd" "yes,yes,yes,yes,yes,*,*,*,*,*") + (set_attr "fp" "yes,*,yes,yes,yes,yes,yes,*,*,yes")] ) (define_insn "*movdf_aarch64" - [(set (match_operand:DF 0 "nonimmediate_operand" "=w, ?r,w,w ,w,m,r,m ,r") - (match_operand:DF 1 "general_operand" "?rY, w,w,Ufc,m,w,m,rY,r"))] + [(set (match_operand:DF 0 "nonimmediate_operand" "=w,w,?r,w,w ,w,m,r,m ,r") + (match_operand:DF 1 "general_operand" "?r,Y, w,w,Ufc,m,w,m,rY,r"))] "TARGET_FLOAT && (register_operand (operands[0], DFmode) || aarch64_reg_or_fp_zero (operands[1], DFmode))" "@ fmov\\t%d0, %x1 + movi\\t%d0, #0 fmov\\t%x0, %d1 fmov\\t%d0, %d1 fmov\\t%d0, %1 @@ -1216,8 +1221,10 @@ ldr\\t%x0, %1 str\\t%x1, %0 mov\\t%x0, %x1" - [(set_attr "type" "f_mcr,f_mrc,fmov,fconstd,\ - f_loadd,f_stored,load1,store1,mov_reg")] + [(set_attr "type" "f_mcr,neon_move,f_mrc,fmov,fconstd,\ + f_loadd,f_stored,load1,store1,mov_reg") + (set_attr "simd" "yes,yes,yes,yes,yes,*,*,*,*,*") + (set_attr "fp" "yes,*,yes,yes,yes,yes,yes,*,*,yes")] ) (define_insn "*movtf_aarch64" -- 2.6.3