public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-4998] rs6000: Update rs6000_builtin_decl
@ 2021-11-08 14:49 William Schmidt
  0 siblings, 0 replies; only message in thread
From: William Schmidt @ 2021-11-08 14:49 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:71cf7c0a0e929550f82b4ac70ac1fd068253039e

commit r12-4998-g71cf7c0a0e929550f82b4ac70ac1fd068253039e
Author: Bill Schmidt <wschmidt@linux.ibm.com>
Date:   Mon Nov 8 08:17:53 2021 -0600

    rs6000: Update rs6000_builtin_decl
    
    Create a new version of this function that uses the new infrastructure,
    and particularly checks for supported builtins the new way.
    
    2021-11-08  Bill Schmidt  <wschmidt@linux.ibm.com>
    
    gcc/
            * config/rs6000/rs6000-call.c (rs6000_new_builtin_decl): New function.
            (rs6000_builtin_decl): Call it.

Diff:
---
 gcc/config/rs6000/rs6000-call.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index c7fdf729d8d..9ddc34151bf 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -16411,11 +16411,31 @@ rs6000_init_builtins (void)
     }
 }
 
+static tree
+rs6000_new_builtin_decl (unsigned code, bool /* initialize_p */)
+{
+  rs6000_gen_builtins fcode = (rs6000_gen_builtins) code;
+
+  if (fcode >= RS6000_OVLD_MAX)
+    return error_mark_node;
+
+  if (!rs6000_new_builtin_is_supported (fcode))
+    {
+      rs6000_invalid_new_builtin (fcode);
+      return error_mark_node;
+    }
+
+  return rs6000_builtin_decls_x[code];
+}
+
 /* Returns the rs6000 builtin decl for CODE.  */
 
 tree
 rs6000_builtin_decl (unsigned code, bool initialize_p ATTRIBUTE_UNUSED)
 {
+  if (new_builtins_are_live)
+    return rs6000_new_builtin_decl (code, initialize_p);
+
   HOST_WIDE_INT fnmask;
 
   if (code >= RS6000_BUILTIN_COUNT)


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

only message in thread, other threads:[~2021-11-08 14:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08 14:49 [gcc r12-4998] rs6000: Update rs6000_builtin_decl William Schmidt

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