public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: Jakub Jelinek <jakub@redhat.com>,
	Bernd Schmidt <bernds@codesourcery.com>,
	<gcc-patches@gcc.gnu.org>
Cc: Richard Sandiford <richard.sandiford@arm.com>
Subject: Re: [nvptx] Re: Mostly rewrite genrecog
Date: Thu, 21 May 2015 08:09:00 -0000	[thread overview]
Message-ID: <87vbfmh09h.fsf@schwinge.name> (raw)
In-Reply-To: <20150507091437.GG1751@tucnak.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 3817 bytes --]

Hi!

On Thu, 7 May 2015 11:14:37 +0200, Jakub Jelinek <jakub@redhat.com> 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.

<http://news.gmane.org/find-root.php?message_id=%3C87twvjtrf4.fsf%40e105548-lin.cambridge.arm.com%3E>.


> > 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_<mode>"
>   [(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 <thomas@codesourcery.com>
Date:   Thu May 7 11:30:26 2015 +0200

    [nvptx] Address genrecog warnings
    
    2015-05-21  Jakub Jelinek  <jakub@redhat.com>
    
    	gcc/
    	* config/nvptx/nvptx.md (allocate_stack): Rename to...
    	(allocate_stack_<mode>): ... 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(-)

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_<mode>"
+  [(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);")
 


> 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

[-- Attachment #2: Type: application/pgp-signature, Size: 472 bytes --]

  reply	other threads:[~2015-05-21  7:13 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-27 10:20 Richard Sandiford
2015-04-28 23:18 ` Jeff Law
2015-04-29 13:59   ` Richard Sandiford
2015-04-29  8:52 ` Eric Botcazou
2015-04-29 13:51   ` Richard Sandiford
2015-04-30 10:44     ` Eric Botcazou
2015-04-30  6:54 ` Bin.Cheng
2015-04-30 11:58   ` Richard Sandiford
2015-04-30  7:17 ` Andreas Schwab
2015-04-30  7:58   ` Richard Sandiford
2015-04-30 12:10     ` Andreas Schwab
2015-04-30 12:33       ` Richard Biener
2015-04-30 16:27         ` Richard Sandiford
2015-05-01 12:42           ` Richard Sandiford
2015-05-01 13:57             ` Jeff Law
2015-05-07  8:59 ` [nvptx] " Thomas Schwinge
2015-05-07  9:14   ` Jakub Jelinek
2015-05-21  8:09     ` Thomas Schwinge [this message]
2015-05-21 11:57       ` Bernd Schmidt
2015-05-08  9:10 ` genrecog: Address -Wsign-compare diagnostics (was: Mostly rewrite genrecog) Thomas Schwinge
2015-05-08 14:43   ` genrecog: Address -Wsign-compare diagnostics Richard Sandiford
2015-05-08 18:39   ` Jeff Law
2015-05-16  8:13 ` Mostly rewrite genrecog Andreas Krebbel
2015-05-17 22:05   ` Richard Sandiford
2015-05-22 16:14     ` Andreas Krebbel
2015-05-22 16:32       ` Richard Sandiford
2015-05-29 17:39         ` RFA: Fix mode checks for possibly-constant predicates Richard Sandiford
2015-05-29 19:27           ` Richard Henderson
2015-06-03  7:23             ` Richard Sandiford
2015-06-03  9:39               ` Richard Sandiford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vbfmh09h.fsf@schwinge.name \
    --to=thomas@codesourcery.com \
    --cc=bernds@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=richard.sandiford@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).