From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19210 invoked by alias); 11 Nov 2014 14:47:04 -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 19200 invoked by uid 89); 11 Nov 2014 14:47:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qc0-f178.google.com Received: from mail-qc0-f178.google.com (HELO mail-qc0-f178.google.com) (209.85.216.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 11 Nov 2014 14:47:02 +0000 Received: by mail-qc0-f178.google.com with SMTP id b13so8787791qcw.9 for ; Tue, 11 Nov 2014 06:47:00 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.224.97.72 with SMTP id k8mr576428qan.25.1415717220731; Tue, 11 Nov 2014 06:47:00 -0800 (PST) Received: by 10.140.81.231 with HTTP; Tue, 11 Nov 2014 06:47:00 -0800 (PST) In-Reply-To: References: Date: Tue, 11 Nov 2014 14:48:00 -0000 Message-ID: Subject: Re: [PATCH, aarch64] Add prefetch support From: Marcus Shawcroft To: "Gopalasubramanian, Ganesh" Cc: "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-11/txt/msg01000.txt.bz2 On 30 October 2014 08:54, Gopalasubramanian, Ganesh wrote: > 2014-10-30 Ganesh Gopalasubramanian Check the whitespace in your ChangeLog line. > * config/arm/types.md (define_attr "type"): Add prefetch. The existing schedulers use 'load1'. We can of course split that into two introducing "prefetch" and update all of the existing schedulers to reflect the change. However I suggest we do that as a separate activity when someone actually needs the distinction, note this change will require updating the schedulers for both ARM and AArch64 backends not just those relevant to AArch64. For this prefetch patch I suggest we go with the existing "load1". The inline patch has been munged by your mailer, I tried applying the patch to my tree but it is full of escape sequences. Can you either fix your mailer or submit patches as attachments? > diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md > index 74b554e..12a3f170 100644 > --- a/gcc/config/aarch64/aarch64.md > +++ b/gcc/config/aarch64/aarch64.md > @@ -320,6 +320,38 @@ > [(set_attr "type" "no_insn")] > ) > > + > +(define_insn "prefetch" > + [(prefetch (match_operand:DI 0 "address_operand" "r") > + (match_operand:QI 1 "const_int_operand" "") > + (match_operand:QI 2 "const_int_operand" ""))] > + "" > + "* > +{ Use {} instead of "*{, then all of the extra quoting in the C below goes away. > + const char * pftype[2][10] > + = { {\"PLDL1STRM\", \"PLDL3KEEP\", \"PLDL2KEEP\", \"PLDL1KEEP\"}, > + {\"PSTL1STRM\", \"PSTL3KEEP\", \"PSTL2KEEP\", \"PSTL1KEEP\"}, > + }; > + > + int locality = INTVAL (operands[2]); > + char pattern[100]; > + > + gcc_assert (IN_RANGE (locality, 0, 3)); > + > + strcpy (pattern, \"prfm\\t\"); > + strcat (pattern, (const char*)pftype[INTVAL(operands[1])][locality]); > + strcat (pattern, \", %a0\"); Use sprintf() rather that multiple calls to cpy and cat. I suspect the cast in front of pftype is superflous? > + > + output_asm_insn (pattern, > + operands); Unnecessary line break. Cheers /Marcus