Re: [PATCH] libgccjit: Add support for machine-dependent builtins

2024-04-19 Thread Antoni Boucher

David: Ping.

Le 2024-02-29 à 10 h 34, Antoni Boucher a écrit :

David: Ping.

On Thu, 2024-02-15 at 09:32 -0500, Antoni Boucher wrote:

David: Ping

On Thu, 2024-02-08 at 08:59 -0500, Antoni Boucher wrote:

David: Ping.

On Wed, 2024-01-10 at 18:58 -0500, Antoni Boucher wrote:

Here it is: https://gcc.gnu.org/pipermail/jit/2023q4/001725.html

On Wed, 2024-01-10 at 18:44 -0500, David Malcolm wrote:

On Wed, 2024-01-10 at 18:29 -0500, Antoni Boucher wrote:

David: Ping in case you missed this patch.


For some reason it's not showing up in patchwork (or, at least,
I
can't
find it there).  Do you have a URL for it there?

Sorry about this
Dave



On Sat, 2023-02-11 at 17:37 -0800, Andrew Pinski wrote:

On Sat, Feb 11, 2023 at 4:31 PM Antoni Boucher via Gcc-
patches
 wrote:


Hi.
This patch adds support for machine-dependent builtins in
libgccjit
(bug 108762).

There are two things I don't like in this patch:

  1. There are a few functions copied from the C frontend
(common_mark_addressable_vec and a few others).

  2. Getting a target builtin only works from the second
compilation
since the type information is recorded at the first
compilation.
I
couldn't find a way to get the builtin data without using
the
langhook.
It is necessary to get the type information for type
checking
and
instrospection.

Any idea how to fix these issues?


Seems like you should do this patch in a few steps; that is
split
it
up.
Definitely split out GCC_JIT_TYPE_BFLOAT16 support.
I also think the vector support should be in a different
patch
too.

Splitting out these parts would definitely make it easier
for
review
and make incremental improvements.

Thanks,
Andrew Pinski





Thanks for the review.














Re: [PATCH] libgccjit: Add support for machine-dependent builtins

2024-02-29 Thread Antoni Boucher
David: Ping.

On Thu, 2024-02-15 at 09:32 -0500, Antoni Boucher wrote:
> David: Ping
> 
> On Thu, 2024-02-08 at 08:59 -0500, Antoni Boucher wrote:
> > David: Ping.
> > 
> > On Wed, 2024-01-10 at 18:58 -0500, Antoni Boucher wrote:
> > > Here it is: https://gcc.gnu.org/pipermail/jit/2023q4/001725.html
> > > 
> > > On Wed, 2024-01-10 at 18:44 -0500, David Malcolm wrote:
> > > > On Wed, 2024-01-10 at 18:29 -0500, Antoni Boucher wrote:
> > > > > David: Ping in case you missed this patch.
> > > > 
> > > > For some reason it's not showing up in patchwork (or, at least,
> > > > I
> > > > can't
> > > > find it there).  Do you have a URL for it there?
> > > > 
> > > > Sorry about this
> > > > Dave
> > > > 
> > > > > 
> > > > > On Sat, 2023-02-11 at 17:37 -0800, Andrew Pinski wrote:
> > > > > > On Sat, Feb 11, 2023 at 4:31 PM Antoni Boucher via Gcc-
> > > > > > patches
> > > > > >  wrote:
> > > > > > > 
> > > > > > > Hi.
> > > > > > > This patch adds support for machine-dependent builtins in
> > > > > > > libgccjit
> > > > > > > (bug 108762).
> > > > > > > 
> > > > > > > There are two things I don't like in this patch:
> > > > > > > 
> > > > > > >  1. There are a few functions copied from the C frontend
> > > > > > > (common_mark_addressable_vec and a few others).
> > > > > > > 
> > > > > > >  2. Getting a target builtin only works from the second
> > > > > > > compilation
> > > > > > > since the type information is recorded at the first
> > > > > > > compilation.
> > > > > > > I
> > > > > > > couldn't find a way to get the builtin data without using
> > > > > > > the
> > > > > > > langhook.
> > > > > > > It is necessary to get the type information for type
> > > > > > > checking
> > > > > > > and
> > > > > > > instrospection.
> > > > > > > 
> > > > > > > Any idea how to fix these issues?
> > > > > > 
> > > > > > Seems like you should do this patch in a few steps; that is
> > > > > > split
> > > > > > it
> > > > > > up.
> > > > > > Definitely split out GCC_JIT_TYPE_BFLOAT16 support.
> > > > > > I also think the vector support should be in a different
> > > > > > patch
> > > > > > too.
> > > > > > 
> > > > > > Splitting out these parts would definitely make it easier
> > > > > > for
> > > > > > review
> > > > > > and make incremental improvements.
> > > > > > 
> > > > > > Thanks,
> > > > > > Andrew Pinski
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > > 
> > > > > > > Thanks for the review.
> > > > > 
> > > > 
> > > 
> > 
> 



Re: [PATCH] libgccjit: Add support for machine-dependent builtins

2024-02-15 Thread Antoni Boucher
David: Ping

On Thu, 2024-02-08 at 08:59 -0500, Antoni Boucher wrote:
> David: Ping.
> 
> On Wed, 2024-01-10 at 18:58 -0500, Antoni Boucher wrote:
> > Here it is: https://gcc.gnu.org/pipermail/jit/2023q4/001725.html
> > 
> > On Wed, 2024-01-10 at 18:44 -0500, David Malcolm wrote:
> > > On Wed, 2024-01-10 at 18:29 -0500, Antoni Boucher wrote:
> > > > David: Ping in case you missed this patch.
> > > 
> > > For some reason it's not showing up in patchwork (or, at least, I
> > > can't
> > > find it there).  Do you have a URL for it there?
> > > 
> > > Sorry about this
> > > Dave
> > > 
> > > > 
> > > > On Sat, 2023-02-11 at 17:37 -0800, Andrew Pinski wrote:
> > > > > On Sat, Feb 11, 2023 at 4:31 PM Antoni Boucher via Gcc-
> > > > > patches
> > > > >  wrote:
> > > > > > 
> > > > > > Hi.
> > > > > > This patch adds support for machine-dependent builtins in
> > > > > > libgccjit
> > > > > > (bug 108762).
> > > > > > 
> > > > > > There are two things I don't like in this patch:
> > > > > > 
> > > > > >  1. There are a few functions copied from the C frontend
> > > > > > (common_mark_addressable_vec and a few others).
> > > > > > 
> > > > > >  2. Getting a target builtin only works from the second
> > > > > > compilation
> > > > > > since the type information is recorded at the first
> > > > > > compilation.
> > > > > > I
> > > > > > couldn't find a way to get the builtin data without using
> > > > > > the
> > > > > > langhook.
> > > > > > It is necessary to get the type information for type
> > > > > > checking
> > > > > > and
> > > > > > instrospection.
> > > > > > 
> > > > > > Any idea how to fix these issues?
> > > > > 
> > > > > Seems like you should do this patch in a few steps; that is
> > > > > split
> > > > > it
> > > > > up.
> > > > > Definitely split out GCC_JIT_TYPE_BFLOAT16 support.
> > > > > I also think the vector support should be in a different
> > > > > patch
> > > > > too.
> > > > > 
> > > > > Splitting out these parts would definitely make it easier for
> > > > > review
> > > > > and make incremental improvements.
> > > > > 
> > > > > Thanks,
> > > > > Andrew Pinski
> > > > > 
> > > > > 
> > > > > 
> > > > > > 
> > > > > > Thanks for the review.
> > > > 
> > > 
> > 
> 



Re: [PATCH] libgccjit: Add support for machine-dependent builtins

2024-02-08 Thread Antoni Boucher
David: Ping.

On Wed, 2024-01-10 at 18:58 -0500, Antoni Boucher wrote:
> Here it is: https://gcc.gnu.org/pipermail/jit/2023q4/001725.html
> 
> On Wed, 2024-01-10 at 18:44 -0500, David Malcolm wrote:
> > On Wed, 2024-01-10 at 18:29 -0500, Antoni Boucher wrote:
> > > David: Ping in case you missed this patch.
> > 
> > For some reason it's not showing up in patchwork (or, at least, I
> > can't
> > find it there).  Do you have a URL for it there?
> > 
> > Sorry about this
> > Dave
> > 
> > > 
> > > On Sat, 2023-02-11 at 17:37 -0800, Andrew Pinski wrote:
> > > > On Sat, Feb 11, 2023 at 4:31 PM Antoni Boucher via Gcc-patches
> > > >  wrote:
> > > > > 
> > > > > Hi.
> > > > > This patch adds support for machine-dependent builtins in
> > > > > libgccjit
> > > > > (bug 108762).
> > > > > 
> > > > > There are two things I don't like in this patch:
> > > > > 
> > > > >  1. There are a few functions copied from the C frontend
> > > > > (common_mark_addressable_vec and a few others).
> > > > > 
> > > > >  2. Getting a target builtin only works from the second
> > > > > compilation
> > > > > since the type information is recorded at the first
> > > > > compilation.
> > > > > I
> > > > > couldn't find a way to get the builtin data without using the
> > > > > langhook.
> > > > > It is necessary to get the type information for type checking
> > > > > and
> > > > > instrospection.
> > > > > 
> > > > > Any idea how to fix these issues?
> > > > 
> > > > Seems like you should do this patch in a few steps; that is
> > > > split
> > > > it
> > > > up.
> > > > Definitely split out GCC_JIT_TYPE_BFLOAT16 support.
> > > > I also think the vector support should be in a different patch
> > > > too.
> > > > 
> > > > Splitting out these parts would definitely make it easier for
> > > > review
> > > > and make incremental improvements.
> > > > 
> > > > Thanks,
> > > > Andrew Pinski
> > > > 
> > > > 
> > > > 
> > > > > 
> > > > > Thanks for the review.
> > > 
> > 
> 



Re: [PATCH] libgccjit: Add support for machine-dependent builtins

2024-01-10 Thread Antoni Boucher
Here it is: https://gcc.gnu.org/pipermail/jit/2023q4/001725.html

On Wed, 2024-01-10 at 18:44 -0500, David Malcolm wrote:
> On Wed, 2024-01-10 at 18:29 -0500, Antoni Boucher wrote:
> > David: Ping in case you missed this patch.
> 
> For some reason it's not showing up in patchwork (or, at least, I
> can't
> find it there).  Do you have a URL for it there?
> 
> Sorry about this
> Dave
> 
> > 
> > On Sat, 2023-02-11 at 17:37 -0800, Andrew Pinski wrote:
> > > On Sat, Feb 11, 2023 at 4:31 PM Antoni Boucher via Gcc-patches
> > >  wrote:
> > > > 
> > > > Hi.
> > > > This patch adds support for machine-dependent builtins in
> > > > libgccjit
> > > > (bug 108762).
> > > > 
> > > > There are two things I don't like in this patch:
> > > > 
> > > >  1. There are a few functions copied from the C frontend
> > > > (common_mark_addressable_vec and a few others).
> > > > 
> > > >  2. Getting a target builtin only works from the second
> > > > compilation
> > > > since the type information is recorded at the first
> > > > compilation.
> > > > I
> > > > couldn't find a way to get the builtin data without using the
> > > > langhook.
> > > > It is necessary to get the type information for type checking
> > > > and
> > > > instrospection.
> > > > 
> > > > Any idea how to fix these issues?
> > > 
> > > Seems like you should do this patch in a few steps; that is split
> > > it
> > > up.
> > > Definitely split out GCC_JIT_TYPE_BFLOAT16 support.
> > > I also think the vector support should be in a different patch
> > > too.
> > > 
> > > Splitting out these parts would definitely make it easier for
> > > review
> > > and make incremental improvements.
> > > 
> > > Thanks,
> > > Andrew Pinski
> > > 
> > > 
> > > 
> > > > 
> > > > Thanks for the review.
> > 
> 



Re: [PATCH] libgccjit: Add support for machine-dependent builtins

2024-01-10 Thread David Malcolm
On Wed, 2024-01-10 at 18:29 -0500, Antoni Boucher wrote:
> David: Ping in case you missed this patch.

For some reason it's not showing up in patchwork (or, at least, I can't
find it there).  Do you have a URL for it there?

Sorry about this
Dave

> 
> On Sat, 2023-02-11 at 17:37 -0800, Andrew Pinski wrote:
> > On Sat, Feb 11, 2023 at 4:31 PM Antoni Boucher via Gcc-patches
> >  wrote:
> > > 
> > > Hi.
> > > This patch adds support for machine-dependent builtins in
> > > libgccjit
> > > (bug 108762).
> > > 
> > > There are two things I don't like in this patch:
> > > 
> > >  1. There are a few functions copied from the C frontend
> > > (common_mark_addressable_vec and a few others).
> > > 
> > >  2. Getting a target builtin only works from the second
> > > compilation
> > > since the type information is recorded at the first compilation.
> > > I
> > > couldn't find a way to get the builtin data without using the
> > > langhook.
> > > It is necessary to get the type information for type checking and
> > > instrospection.
> > > 
> > > Any idea how to fix these issues?
> > 
> > Seems like you should do this patch in a few steps; that is split
> > it
> > up.
> > Definitely split out GCC_JIT_TYPE_BFLOAT16 support.
> > I also think the vector support should be in a different patch too.
> > 
> > Splitting out these parts would definitely make it easier for
> > review
> > and make incremental improvements.
> > 
> > Thanks,
> > Andrew Pinski
> > 
> > 
> > 
> > > 
> > > Thanks for the review.
> 



Re: [PATCH] libgccjit: Add support for machine-dependent builtins

2024-01-10 Thread Antoni Boucher
David: Ping in case you missed this patch.

On Sat, 2023-02-11 at 17:37 -0800, Andrew Pinski wrote:
> On Sat, Feb 11, 2023 at 4:31 PM Antoni Boucher via Gcc-patches
>  wrote:
> > 
> > Hi.
> > This patch adds support for machine-dependent builtins in libgccjit
> > (bug 108762).
> > 
> > There are two things I don't like in this patch:
> > 
> >  1. There are a few functions copied from the C frontend
> > (common_mark_addressable_vec and a few others).
> > 
> >  2. Getting a target builtin only works from the second compilation
> > since the type information is recorded at the first compilation. I
> > couldn't find a way to get the builtin data without using the
> > langhook.
> > It is necessary to get the type information for type checking and
> > instrospection.
> > 
> > Any idea how to fix these issues?
> 
> Seems like you should do this patch in a few steps; that is split it
> up.
> Definitely split out GCC_JIT_TYPE_BFLOAT16 support.
> I also think the vector support should be in a different patch too.
> 
> Splitting out these parts would definitely make it easier for review
> and make incremental improvements.
> 
> Thanks,
> Andrew Pinski
> 
> 
> 
> > 
> > Thanks for the review.



Re: [PATCH] libgccjit: Add support for machine-dependent builtins

2023-11-23 Thread Antoni Boucher
I will need to not forget to update the function tree_type_to_jit_type
in dummy-frontend.cc to add back the support for bfloat16 when the
patch for it is merged.

On Thu, 2023-11-23 at 17:17 -0500, Antoni Boucher wrote:
> Hi.
> I did split the patch and sent one for the bfloat16 support and
> another
> one for the vector support.
> 
> Here's the updated patch for the machine-dependent builtins.
> 
> Regards.
> 
> On Sat, 2023-02-11 at 17:37 -0800, Andrew Pinski wrote:
> > On Sat, Feb 11, 2023 at 4:31 PM Antoni Boucher via Gcc-patches
> >  wrote:
> > > 
> > > Hi.
> > > This patch adds support for machine-dependent builtins in
> > > libgccjit
> > > (bug 108762).
> > > 
> > > There are two things I don't like in this patch:
> > > 
> > >  1. There are a few functions copied from the C frontend
> > > (common_mark_addressable_vec and a few others).
> > > 
> > >  2. Getting a target builtin only works from the second
> > > compilation
> > > since the type information is recorded at the first compilation.
> > > I
> > > couldn't find a way to get the builtin data without using the
> > > langhook.
> > > It is necessary to get the type information for type checking and
> > > instrospection.
> > > 
> > > Any idea how to fix these issues?
> > 
> > Seems like you should do this patch in a few steps; that is split
> > it
> > up.
> > Definitely split out GCC_JIT_TYPE_BFLOAT16 support.
> > I also think the vector support should be in a different patch too.
> > 
> > Splitting out these parts would definitely make it easier for
> > review
> > and make incremental improvements.
> > 
> > Thanks,
> > Andrew Pinski
> > 
> > 
> > 
> > > 
> > > Thanks for the review.
> 



Re: [PATCH] libgccjit: Add support for machine-dependent builtins

2023-11-23 Thread Antoni Boucher
Hi.
I did split the patch and sent one for the bfloat16 support and another
one for the vector support.

Here's the updated patch for the machine-dependent builtins.

Regards.

On Sat, 2023-02-11 at 17:37 -0800, Andrew Pinski wrote:
> On Sat, Feb 11, 2023 at 4:31 PM Antoni Boucher via Gcc-patches
>  wrote:
> > 
> > Hi.
> > This patch adds support for machine-dependent builtins in libgccjit
> > (bug 108762).
> > 
> > There are two things I don't like in this patch:
> > 
> >  1. There are a few functions copied from the C frontend
> > (common_mark_addressable_vec and a few others).
> > 
> >  2. Getting a target builtin only works from the second compilation
> > since the type information is recorded at the first compilation. I
> > couldn't find a way to get the builtin data without using the
> > langhook.
> > It is necessary to get the type information for type checking and
> > instrospection.
> > 
> > Any idea how to fix these issues?
> 
> Seems like you should do this patch in a few steps; that is split it
> up.
> Definitely split out GCC_JIT_TYPE_BFLOAT16 support.
> I also think the vector support should be in a different patch too.
> 
> Splitting out these parts would definitely make it easier for review
> and make incremental improvements.
> 
> Thanks,
> Andrew Pinski
> 
> 
> 
> > 
> > Thanks for the review.

From e025f95f4790ae861e709caf23cbc0723c1a3804 Mon Sep 17 00:00:00 2001
From: Antoni Boucher 
Date: Mon, 23 Jan 2023 17:21:15 -0500
Subject: [PATCH] libgccjit: Add support for machine-dependent builtins

gcc/ChangeLog:
	PR jit/108762
	* config/i386/i386-builtins.cc: New function (clear_builtin_types).

gcc/jit/ChangeLog:
	PR jit/108762
	* docs/topics/compatibility.rst (LIBGCCJIT_ABI_26): New ABI tag.
	* docs/topics/functions.rst: Add documentation for the function
	gcc_jit_context_get_target_builtin_function.
	* dummy-frontend.cc: Include headers target.h, jit-recording.h,
	print-tree.h, unordered_map and string, new variables (target_builtins,
	target_function_types, and target_builtins_ctxt), new function
	(tree_type_to_jit_type).
	* jit-builtins.cc: Specify that the function types are not from
	target builtins.
	* jit-playback.cc: New argument is_target_builtin to new_function.
	* jit-playback.h: New argument is_target_builtin to
	new_function.
	* jit-recording.cc: New argument is_target_builtin to
	new_function_type, function_type constructor and function
	constructor, new function
	(get_target_builtin_function).
	* jit-recording.h: Include headers string and unordered_map, new
	variable target_function_types, new argument is_target_builtin
	to new_function_type, function_type and function, new functions
	(get_target_builtin_function, copy).
	* libgccjit.cc: New function
	(gcc_jit_context_get_target_builtin_function).
	* libgccjit.h: New function
	(gcc_jit_context_get_target_builtin_function).
	* libgccjit.map: New functions
	(gcc_jit_context_get_target_builtin_function).

gcc/testsuite:
	PR jit/108762
	* jit.dg/all-non-failing-tests.h: New test test-target-builtins.c.
	* jit.dg/test-target-builtins.c: New test.
---
 gcc/config/i386/i386-builtins.cc |  18 ++
 gcc/jit/docs/topics/compatibility.rst|   9 +
 gcc/jit/docs/topics/functions.rst|  19 ++
 gcc/jit/dummy-frontend.cc| 204 ++-
 gcc/jit/jit-builtins.cc  |   6 +-
 gcc/jit/jit-playback.cc  |  11 +-
 gcc/jit/jit-playback.h   |   5 +-
 gcc/jit/jit-recording.cc |  76 ++-
 gcc/jit/jit-recording.h  | 111 +-
 gcc/jit/libgccjit.cc |  18 ++
 gcc/jit/libgccjit.h  |  13 ++
 gcc/jit/libgccjit.map|   4 +
 gcc/testsuite/jit.dg/all-non-failing-tests.h |   3 +
 gcc/testsuite/jit.dg/test-target-builtins.c  |  77 +++
 14 files changed, 554 insertions(+), 20 deletions(-)
 create mode 100644 gcc/testsuite/jit.dg/test-target-builtins.c

diff --git a/gcc/config/i386/i386-builtins.cc b/gcc/config/i386/i386-builtins.cc
index 42fc3751676..5cc1d6f4d2e 100644
--- a/gcc/config/i386/i386-builtins.cc
+++ b/gcc/config/i386/i386-builtins.cc
@@ -225,6 +225,22 @@ static GTY(()) tree ix86_builtins[(int) IX86_BUILTIN_MAX];
 
 struct builtin_isa ix86_builtins_isa[(int) IX86_BUILTIN_MAX];
 
+static void
+clear_builtin_types (void)
+{
+  for (int i = 0 ; i < IX86_BT_LAST_CPTR + 1 ; i++)
+ix86_builtin_type_tab[i] = NULL;
+
+  for (int i = 0 ; i < IX86_BUILTIN_MAX ; i++)
+  {
+ix86_builtins[i] = NULL;
+ix86_builtins_isa[i].set_and_not_built_p = true;
+  }
+
+  for (int i = 0 ; i < IX86_BT_LAST_ALIAS + 1 ; i++)
+ix86_builtin_func_type_tab[i] = NULL;
+}
+
 tree get_ix86_builtin (enum ix86_builtins c)
 {
   return ix86_builtins[c];
@@ -1483,6 +1499,8 @@ ix86_init_builtins (void)
 {
   tree ftype, decl;
 
+  clear_builtin_types ();
+
   ix86_init_builtin_types ();
 
   /* Builtins to get CPU type and features. */
diff 

Re: [PATCH] libgccjit: Add support for machine-dependent builtins

2023-02-11 Thread Andrew Pinski via Gcc-patches
On Sat, Feb 11, 2023 at 4:31 PM Antoni Boucher via Gcc-patches
 wrote:
>
> Hi.
> This patch adds support for machine-dependent builtins in libgccjit
> (bug 108762).
>
> There are two things I don't like in this patch:
>
>  1. There are a few functions copied from the C frontend
> (common_mark_addressable_vec and a few others).
>
>  2. Getting a target builtin only works from the second compilation
> since the type information is recorded at the first compilation. I
> couldn't find a way to get the builtin data without using the langhook.
> It is necessary to get the type information for type checking and
> instrospection.
>
> Any idea how to fix these issues?

Seems like you should do this patch in a few steps; that is split it up.
Definitely split out GCC_JIT_TYPE_BFLOAT16 support.
I also think the vector support should be in a different patch too.

Splitting out these parts would definitely make it easier for review
and make incremental improvements.

Thanks,
Andrew Pinski



>
> Thanks for the review.


Re: [PATCH] libgccjit: Add support for machine-dependent builtins

2023-02-11 Thread Antoni Boucher via Gcc-patches
I forgot to attach the patch.
Here it is.

On Sat, 2023-02-11 at 19:30 -0500, Antoni Boucher via Jit wrote:
> Hi.
> This patch adds support for machine-dependent builtins in libgccjit
> (bug 108762).
> 
> There are two things I don't like in this patch:
> 
>  1. There are a few functions copied from the C frontend
> (common_mark_addressable_vec and a few others).
> 
>  2. Getting a target builtin only works from the second compilation
> since the type information is recorded at the first compilation. I
> couldn't find a way to get the builtin data without using the
> langhook.
> It is necessary to get the type information for type checking and
> instrospection.
> 
> Any idea how to fix these issues?
> 
> Thanks for the review.

From f1f4a113853b416776253b596d7feeb87e608bfd Mon Sep 17 00:00:00 2001
From: Antoni Boucher 
Date: Mon, 23 Jan 2023 17:21:15 -0500
Subject: [PATCH] libgccjit: Add support for machine-dependent builtins

gcc/config:
	PR jit/108762
	* i386/i386-builtins.cc: New function (clear_builtin_types).

gcc/jit:
	PR jit/108762
	* docs/topics/compatibility.rst (LIBGCCJIT_ABI_25): New ABI tag.
	* docs/topics/expressions.rst: Add documentation for the
	functions gcc_jit_context_new_rvalue_vector_perm and
	gcc_jit_context_new_vector_access.
	* docs/topics/functions.rst: Add documentation for the function
	gcc_jit_context_get_target_builtin_function.
	* docs/topics/types.rst: Add documentation for GCC_JIT_TYPE_BFLOAT16.
	* dummy-frontend.cc: Include headers target.h, jit-recording.h,
	print-tree.h, unordered_map and string, new variables (target_builtins,
	target_function_types, and target_builtins_ctxt), new function
	(tree_type_to_jit_type).
	* jit-builtins.cc: Specify that the function types are not from
	target builtins.
	* jit-playback.cc: New argument is_target_builtin to new_function, new
	functions (new_rvalue_vector_perm, common_mark_addressable_vec,
	gnu_vector_type_p, lvalue_p, convert_vector_to_array_for_subscript,
	new_vector_access).
	* jit-playback.h: New argument is_target_builtin to
	new_function, new functions (new_rvalue_vector_perm,
	new_vector_access).
	* jit-recording.cc: New argument is_target_builtin to
	new_function_type, function_type constructor and function
	constructor, new functions
	(get_target_builtin_function, new_rvalue_vector_perm,
	new_vector_access, memento_of_new_rvalue_vector_perm,
	memento_of_new_rvalue_vector_perm::replay_into,
	memento_of_new_rvalue_vector_perm::visit_children,
	memento_of_new_rvalue_vector_perm::make_debug_string,
	memento_of_new_rvalue_vector_perm::write_reproducer,
	vector_access::replay_into, vector_access::visit_children,
	vector_access::make_debug_string, vector_access::write_reproducer).
	* jit-recording.h: Include headers string and unordered_map, new
	variable target_function_types, new argument is_target_builtin
	to new_function_type, function_type and function, new classes
	memento_of_new_rvalue_vector_perm and vector_access, new functions
	(get_target_builtin_function, new_rvalue_vector_perm,
	new_vector_access, copy, memento_of_new_rvalue_vector_perm,
	memento_of_new_rvalue_vector_perm::replay_into,
	memento_of_new_rvalue_vector_perm::visit_children,
	memento_of_new_rvalue_vector_perm::make_debug_string,
	memento_of_new_rvalue_vector_perm::write_reproducer,
	vector_access::replay_into, vector_access::visit_children,
	vector_access::make_debug_string, vector_access::write_reproducer).
	* libgccjit.cc: New functions
	(gcc_jit_context_get_target_builtin_function,
	gcc_jit_context_new_vector_access,
	gcc_jit_context_new_rvalue_vector_perm).
	* libgccjit.h: New variant GCC_JIT_TYPE_BFLOAT16 en enum
	gcc_jit_types, new functions
	(gcc_jit_context_get_target_builtin_function,
	gcc_jit_context_new_vector_access,
	gcc_jit_context_new_rvalue_vector_perm).
	* libgccjit.map: New functions
	(gcc_jit_context_get_target_builtin_function,
	gcc_jit_context_new_rvalue_vector_perm,
	gcc_jit_context_new_vector_access).

gcc/testsuite:
	PR jit/108762
	* jit.dg/all-non-failing-tests.h: New test test-target-builtins.c.
	* jit.dg/test-target-builtins.c: New test.
---
 gcc/config/i386/i386-builtins.cc |  18 ++
 gcc/jit/docs/topics/compatibility.rst|  10 +
 gcc/jit/docs/topics/expressions.rst  |  45 
 gcc/jit/docs/topics/functions.rst|  19 ++
 gcc/jit/docs/topics/types.rst|   2 +
 gcc/jit/dummy-frontend.cc| 203 ++-
 gcc/jit/jit-builtins.cc  |   6 +-
 gcc/jit/jit-common.h |   2 +-
 gcc/jit/jit-playback.cc  | 166 +++-
 gcc/jit/jit-playback.h   |  16 +-
 gcc/jit/jit-recording.cc | 255 ++-
 gcc/jit/jit-recording.h  | 176 -
 gcc/jit/libgccjit.cc | 127 +
 gcc/jit/libgccjit.h  |  44 +++-
 gcc/jit/libgccjit.map|   7 +