public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom de Vries <vries@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-5836] nvptx: Add test-case gcc.target/nvptx/exttrunc-1.c
Date: Wed,  8 Dec 2021 15:42:26 +0000 (GMT)	[thread overview]
Message-ID: <20211208154226.A6CBA3858D3C@sourceware.org> (raw)

https://gcc.gnu.org/g:d3d44a00e511f0402e8a2449c1c9c27f28ac9cf7

commit r12-5836-gd3d44a00e511f0402e8a2449c1c9c27f28ac9cf7
Author: Roger Sayle <roger@nextmovesoftware.com>
Date:   Wed Dec 8 14:21:49 2021 +0100

    nvptx: Add test-case gcc.target/nvptx/exttrunc-1.c
    
    Add new test-case converting short to char and back to short.
    
    Tested on nvptx.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/nvptx/exttrunc-1.c: New test case.

Diff:
---
 gcc/testsuite/gcc.target/nvptx/exttrunc-1.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/gcc/testsuite/gcc.target/nvptx/exttrunc-1.c b/gcc/testsuite/gcc.target/nvptx/exttrunc-1.c
new file mode 100644
index 00000000000..ed9ceee700e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/exttrunc-1.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+short exttrunc_hi2_qi(short x)
+{
+  return (char)x;
+}
+
+/* Match:
+   mov.u32 %r24, %ar0;
+   cvt.u32.u32 %r26, %r24;
+   cvt.s32.s8 %value, %r26;
+   Todo: Remove cvt.u32.u32.  */
+
+/* { dg-final { scan-assembler-times "mov\.u32\t%r\[0-9\]*, %ar0" 1 } } */
+/* { dg-final { scan-assembler-times "mov\." 1 } } */
+
+/* { dg-final { scan-assembler-times "cvt\.u32\.u32" 1 } } */
+/* { dg-final { scan-assembler-times "cvt\.s32\.s8" 1 } } */
+/* { dg-final { scan-assembler-times "cvt\." 2 } } */


                 reply	other threads:[~2021-12-08 15:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20211208154226.A6CBA3858D3C@sourceware.org \
    --to=vries@gcc.gnu.org \
    --cc=gcc-cvs@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).