public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexander Monakov <amonakov@ispras.ru>
To: gcc-patches@gcc.gnu.org
Subject: [gomp-nvptx 6/7] nvptx backend: change mul.u32 to mul.lo.u32
Date: Fri, 18 Mar 2016 18:13:00 -0000	[thread overview]
Message-ID: <1458323327-9908-7-git-send-email-amonakov@ispras.ru> (raw)
In-Reply-To: <1458323327-9908-1-git-send-email-amonakov@ispras.ru>

Recent testing uncovered that PTX JIT may reject attempts to use 'mul.u32' as
a non-widening 32-bit multiply instruction.  Use 'mul.lo.u32' to fix 32-bit
code generation and conform to the PTX spec better.

	* config/nvptx/nvptx.c (nvptx_init_unisimt_predicate): Emit
	'mul.lo.u32' instead of 'mul.u32' for 32-bit ABI target.
	(nvptx_declare_function_name): Ditto.
---
 gcc/ChangeLog.gomp-nvptx | 6 ++++++
 gcc/config/nvptx/nvptx.c | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index 93bf781..bc187ea 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -955,7 +955,7 @@ nvptx_init_unisimt_predicate (FILE *file)
   fprintf (file, "\t\t.reg.u%d %%ustmp2;\n", bits);
   fprintf (file, "\t\tmov.u32 %%ustmp0, %%tid.y;\n");
   fprintf (file, "\t\tmul%s.u32 %%ustmp1, %%ustmp0, 4;\n",
-	   bits == 64 ? ".wide" : "");
+	   bits == 64 ? ".wide" : ".lo");
   fprintf (file, "\t\tmov.u%d %%ustmp2, __nvptx_uni;\n", bits);
   fprintf (file, "\t\tadd.u%d %%ustmp2, %%ustmp2, %%ustmp1;\n", bits);
   fprintf (file, "\t\tld.shared.u32 %%r%d, [%%ustmp2];\n", master);
@@ -1115,7 +1115,7 @@ nvptx_declare_function_name (FILE *file, const char *name, const_tree decl)
       fprintf (file, "\t.reg.u%d %%fstmp2;\n", bits);
       fprintf (file, "\tmov.u32 %%fstmp0, %%tid.y;\n");
       fprintf (file, "\tmul%s.u32 %%fstmp1, %%fstmp0, %d;\n",
-	       bits == 64 ? ".wide" : "", bits / 8);
+	       bits == 64 ? ".wide" : ".lo", bits / 8);
       fprintf (file, "\tmov.u%d %%fstmp2, __nvptx_stacks;\n", bits);
       /* fstmp2 = &__nvptx_stacks[tid.y];  */
       fprintf (file, "\tadd.u%d %%fstmp2, %%fstmp2, %%fstmp1;\n", bits);

      parent reply	other threads:[~2016-03-18 17:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18 17:48 [gomp-nvptx 0/7] Various fixes Alexander Monakov
2016-03-18 17:48 ` [gomp-nvptx 2/7] nvptx libgcc: use attribute shared Alexander Monakov
2016-03-18 17:48 ` [gomp-nvptx 4/7] nvptx backend: re-enable line info generation Alexander Monakov
2016-03-18 17:48 ` [gomp-nvptx 1/7] libgomp: remove paste error in gomp_team_barrier_wait_end Alexander Monakov
2016-03-18 17:49 ` [gomp-nvptx 5/7] nvptx backend: use POINTER_SIZE instead of BITS_PER_WORD Alexander Monakov
2016-03-18 17:49 ` [gomp-nvptx 7/7] nvptx backend: define STACK_SIZE_MODE Alexander Monakov
2016-03-18 17:49 ` [gomp-nvptx 3/7] libgomp plugin: make cuMemFreeHost error non-fatal Alexander Monakov
2016-03-18 18:13 ` Alexander Monakov [this message]

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=1458323327-9908-7-git-send-email-amonakov@ispras.ru \
    --to=amonakov@ispras.ru \
    --cc=gcc-patches@gcc.gnu.org \
    /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).