From patchwork Thu May 21 07:12:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 474844 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 B013514012C for ; Thu, 21 May 2015 17:13:15 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=joKNnph2; 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:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; q=dns; s=default; b=isrGOLHyZhI7GTII WsyXqpRnTAZNJNr3K3CoKH00Z4uIu7HRd/ITjiZCMT6w+nWmMOpIS2VMELgCe685 usW0VAaDVKfy8Wz7QHL/UufoKuJFtdi29Odv2Cv1BtwbHXFPwVU9K6McJVtRvGC0 DM2qkMtVpMx2q/46hf1gluHlJ30= 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:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=default; bh=FT783u++2sER8x0EoWtAec O0VWU=; b=joKNnph2ba2JCwV2CnazMO8+j1RkbpjEWiuDDbJWzEkxcK9OQl6a6i W1qsy0+U31WW7Ip3t2mUubvq9twQepZyDkwGUafK1u5ijo7Ml1oeNXgbkB3XSZ5A /Ce5dMseLsRHtZrjxb4bF7MAnsEM2rldwjDl1GehViWeCxjOLi1B4= Received: (qmail 123938 invoked by alias); 21 May 2015 07:13:08 -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 123928 invoked by uid 89); 21 May 2015 07:13:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 21 May 2015 07:13:06 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1YvKf7-0000rA-L7 from Thomas_Schwinge@mentor.com ; Thu, 21 May 2015 00:13:02 -0700 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.3.224.2; Thu, 21 May 2015 08:13:00 +0100 From: Thomas Schwinge To: Jakub Jelinek , Bernd Schmidt , CC: Richard Sandiford Subject: Re: [nvptx] Re: Mostly rewrite genrecog In-Reply-To: <20150507091437.GG1751@tucnak.redhat.com> References: <87egn5yis1.fsf@e105548-lin.cambridge.arm.com> <871tisvk4q.fsf@kepler.schwinge.homeip.net> <20150507091437.GG1751@tucnak.redhat.com> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Thu, 21 May 2015 09:12:42 +0200 Message-ID: <87vbfmh09h.fsf@schwinge.name> MIME-Version: 1.0 Hi! On Thu, 7 May 2015 11:14:37 +0200, Jakub Jelinek wrote: > On Thu, May 07, 2015 at 10:59:01AM +0200, Thomas Schwinge wrote: > > build/genrecog [...]/source-gcc/gcc/common.md [...]/source-gcc/gcc/config/nvptx/nvptx.md \ > > insn-conditions.md > tmp-recog.c > > -[...]/source-gcc/gcc/config/nvptx/nvptx.md:1206: warning: operand 0 missing mode? > > -[...]/source-gcc/gcc/config/nvptx/nvptx.md:1206: warning: operand 1 missing mode? > > > > gcc/config/nvptx/nvptx.md: > > > > 1206 (define_insn "allocate_stack" > > 1207 [(set (match_operand 0 "nvptx_register_operand" "=R") > > 1208 (unspec [(match_operand 1 "nvptx_register_operand" "R")] > > 1209 UNSPEC_ALLOCA))] > > 1210 "" > > 1211 "%.\\tcall (%0), %%alloca, (%1);") > > > > Are these two (former) warnings a) something that should still be > > reported by genrecog, > > Yes. . > > and b) something that should be addressed (Bernd)? > > Yes. Supposedly you want :P on both match_operand and unspec too, but > as this serves not just as an insn pattern, but also as expander that > needs to have this particular name, supposedly you want: > > (define_expand "allocate_stack" > [(match_operand 0 "nvptx_register_operand") > (match_operand 1 "nvptx_register_operand")] > "" > { > if (TARGET_ABI64) > emit_insn (gen_allocate_stack_di (operands[0], operands[1])); > else > emit_insn (gen_allocate_stack_si (operands[0], operands[1])); > DONE; > }) > > (define_insn "allocate_stack_" > [(set (match_operand:P 0 "nvptx_register_operand" "=R") > (unspec:P [(match_operand:P 1 "nvptx_register_operand" "R")] > UNSPEC_ALLOCA))] > "" > "%.\\tcall (%0), %%alloca, (%1);") > > rr so. OK to commit? commit 004e521e8dd1c0236a55e9a69a17cc3333c2a41d Author: Thomas Schwinge Date: Thu May 7 11:30:26 2015 +0200 [nvptx] Address genrecog warnings 2015-05-21 Jakub Jelinek gcc/ * config/nvptx/nvptx.md (allocate_stack): Rename to... (allocate_stack_): ... this, and add :P on both match_operand and unspec. (allocate_stack): New expander. --- gcc/config/nvptx/nvptx.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) > Of course, as even latest Cuda drop doesn't support alloca, this is > quite dubious, perhaps better would be sorry on it. > > BTW, with Cuda 7.0, even printf doesn't work anymore, is that known? I have not yet used that version of CUDA, so don't know about this. :-| Grüße, Thomas diff --git gcc/config/nvptx/nvptx.md gcc/config/nvptx/nvptx.md index c30de36..a49786c 100644 --- gcc/config/nvptx/nvptx.md +++ gcc/config/nvptx/nvptx.md @@ -1203,10 +1203,22 @@ sorry ("target cannot support nonlocal goto."); }) -(define_insn "allocate_stack" - [(set (match_operand 0 "nvptx_register_operand" "=R") - (unspec [(match_operand 1 "nvptx_register_operand" "R")] - UNSPEC_ALLOCA))] +(define_expand "allocate_stack" + [(match_operand 0 "nvptx_register_operand") + (match_operand 1 "nvptx_register_operand")] + "" +{ + if (TARGET_ABI64) + emit_insn (gen_allocate_stack_di (operands[0], operands[1])); + else + emit_insn (gen_allocate_stack_si (operands[0], operands[1])); + DONE; +}) + +(define_insn "allocate_stack_" + [(set (match_operand:P 0 "nvptx_register_operand" "=R") + (unspec:P [(match_operand:P 1 "nvptx_register_operand" "R")] + UNSPEC_ALLOCA))] "" "%.\\tcall (%0), %%alloca, (%1);")