public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Kwok Yeung <kcy@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc/devel/omp/gcc-12] amdgcn: Add builtins for vector floor/floorf
Date: Wed,  2 Nov 2022 00:37:34 +0000 (GMT)	[thread overview]
Message-ID: <20221102003740.939103858C53@sourceware.org> (raw)

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

commit d3a2a1cc424cc06aaa83b25bf8943ac229e9948f
Author: Kwok Cheung Yeung <kcy@codesourcery.com>
Date:   Tue Nov 1 22:56:54 2022 +0000

    amdgcn: Add builtins for vector floor/floorf
    
    2022-11-01  Kwok Cheung Yeung  <kcy@codesourcery.com>
    
            gcc/
            * config/gcn/gcn-builtins.def (FLOORVF): New builtin.
            (FLOORV): New builtin.
            * config/gcn/gcn.cc (gcn_expand_builtin_1): Expand GCN_BUILTIN_FLOORVF
            and GCN_BUILTIN_FLOORV.

Diff:
---
 gcc/ChangeLog.omp               |  7 +++++++
 gcc/config/gcn/gcn-builtins.def | 10 ++++++++++
 gcc/config/gcn/gcn.cc           | 22 ++++++++++++++++++++++
 3 files changed, 39 insertions(+)

diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp
index 467a2497fb2..e9ee9d732df 100644
--- a/gcc/ChangeLog.omp
+++ b/gcc/ChangeLog.omp
@@ -1,3 +1,10 @@
+2022-11-01  Kwok Cheung Yeung  <kcy@codesourcery.com>
+
+	* config/gcn/gcn-builtins.def (FLOORVF): New builtin.
+	(FLOORV): New builtin.
+	* config/gcn/gcn.cc (gcn_expand_builtin_1): Expand GCN_BUILTIN_FLOORVF
+	and GCN_BUILTIN_FLOORV.
+
 2022-11-01  Kwok Cheung Yeung  <kcy@codesourcery.com>
 
 	* config/gcn/gcn.cc (gcn_expand_builtin_1): Fix expansion of
diff --git a/gcc/config/gcn/gcn-builtins.def b/gcc/config/gcn/gcn-builtins.def
index 21e3f0131e4..c50777bd3b0 100644
--- a/gcc/config/gcn/gcn-builtins.def
+++ b/gcc/config/gcn/gcn-builtins.def
@@ -69,6 +69,16 @@ DEF_BUILTIN (FABSV, 3 /*CODE_FOR_fabsv */,
 	     _A2 (GCN_BTI_V64DF, GCN_BTI_V64DF),
 	     gcn_expand_builtin_1)
 
+DEF_BUILTIN (FLOORVF, 3 /*CODE_FOR_floorvf */,
+	     "floorvf", B_INSN,
+	     _A2 (GCN_BTI_V64SF, GCN_BTI_V64SF),
+	     gcn_expand_builtin_1)
+
+DEF_BUILTIN (FLOORV, 3 /*CODE_FOR_floorv */,
+	     "floorv", B_INSN,
+	     _A2 (GCN_BTI_V64DF, GCN_BTI_V64DF),
+	     gcn_expand_builtin_1)
+
 DEF_BUILTIN (LDEXPVF, 3 /*CODE_FOR_ldexpvf */,
 	     "ldexpvf", B_INSN,
 	     _A3 (GCN_BTI_V64SF, GCN_BTI_V64SF, GCN_BTI_V64SI),
diff --git a/gcc/config/gcn/gcn.cc b/gcc/config/gcn/gcn.cc
index 08dd3d618c6..bfc91e04f81 100644
--- a/gcc/config/gcn/gcn.cc
+++ b/gcc/config/gcn/gcn.cc
@@ -4372,6 +4372,28 @@ gcn_expand_builtin_1 (tree exp, rtx target, rtx /*subtarget */ ,
 	emit_insn (gen_absv64df2 (target, arg));
 	return target;
       }
+    case GCN_BUILTIN_FLOORVF:
+      {
+	if (ignore)
+	  return target;
+	rtx arg = force_reg (V64SFmode,
+			     expand_expr (CALL_EXPR_ARG (exp, 0), NULL_RTX,
+					  V64SFmode,
+					  EXPAND_NORMAL));
+	emit_insn (gen_floorv64sf2 (target, arg));
+	return target;
+      }
+    case GCN_BUILTIN_FLOORV:
+      {
+	if (ignore)
+	  return target;
+	rtx arg = force_reg (V64DFmode,
+			     expand_expr (CALL_EXPR_ARG (exp, 0), NULL_RTX,
+					  V64DFmode,
+					  EXPAND_NORMAL));
+	emit_insn (gen_floorv64df2 (target, arg));
+	return target;
+      }
     case GCN_BUILTIN_LDEXPVF:
       {
 	if (ignore)

                 reply	other threads:[~2022-11-02  0:37 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=20221102003740.939103858C53@sourceware.org \
    --to=kcy@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).