public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
* Interfacing with external code using libgccjit
@ 2023-06-15 19:59 Anselm Schüler
  2023-06-16 17:27 ` David Malcolm
  0 siblings, 1 reply; 4+ messages in thread
From: Anselm Schüler @ 2023-06-15 19:59 UTC (permalink / raw)
  To: jit

[-- Attachment #1: Type: text/plain, Size: 815 bytes --]

Hi, I’m very new to libgccjit and was hoping to use it to implement a 
DSL that abstracts over some high-precision mathematics.
However, to do that, I need to interface with a high-precision library 
such as GMP or MPFR.
I’m wondering if that’s possible. Can I use 
gcc_jit_context_new_function with GCC_JIT_FUNCTION_IMPORTED to define 
such functions from e.g. MPFR? If so, is the function retrieved from 
the binary itself or does it need to be installed on the target 
machine? Do I need to pass -lmpfr to libgccjit or does it suffice to 
use it during the compilation of the host program?
Additionally, it seems to be necessary to redefine all the types 
defined by the library in order to be able to pass and receive them. Is 
there some facility for automating this? It seems rather laborious.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-16 19:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-15 19:59 Interfacing with external code using libgccjit Anselm Schüler
2023-06-16 17:27 ` David Malcolm
2023-06-16 19:07   ` Basile Starynkevitch
2023-06-16 19:15     ` Marc Nieper-Wißkirchen

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