public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/omp/gcc-12] amdgcn: Add builtins for vector floor/floorf
@ 2022-11-02  0:37 Kwok Yeung
  0 siblings, 0 replies; only message in thread
From: Kwok Yeung @ 2022-11-02  0:37 UTC (permalink / raw)
  To: gcc-cvs

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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-02  0:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-02  0:37 [gcc/devel/omp/gcc-12] amdgcn: Add builtins for vector floor/floorf Kwok Yeung

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).