public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: Basile Starynkevitch <basile@starynkevitch.net>
To: jit@gcc.gnu.org, David Malcolm <dmalcolm@redhat.com>
Subject: Re: wish: gcc_jit_type_get_atomic
Date: Fri, 01 Jan 2016 00:00:00 -0000	[thread overview]
Message-ID: <573EFC6E.2020004@starynkevitch.net> (raw)
In-Reply-To: <573EF903.2050007@starynkevitch.net>

On 05/20/2016 01:46 PM, Basile Starynkevitch wrote:
>
> My feeling (but I might be wrong) is that GCCJIT should give some way 
> to retrieve that __ATOMIC_SEQ_CST. Apparently it is a magic 
> preprocessor symbol (perhaps GCC specific!) implemented in 
> gcc/cppbuiltin.c (near line 68, defined as MEMMODEL_SEQ_CST); but if I 
> understand correctly GCCJIT does not give access to the compiler's 
> magic preprocessor symbols.
>
> I feel that GCCJIT might want to have a function like
> int gccjit_atomic_seq_cst_value(); // value of __ATOMIC_SEQ_CST in the 
> GCC used by GCCJIT
> or perhaps a more general function
> int gccjit_compiler_magic_int(const char*);
> that I would call as gccjit_compiler_magic_int("__ATOMIC_SEQ_CST");

FWIW, there is a dirty hack to get that. On a Debian system with both 
libgccjit-6-dev & gcc-6-plugin-dev packages installed the 
/usr/lib/gcc/x86_64-linux-gnu/6/plugin/include/coretypes.h header file 
(provided by libgccjit-6-dev) defines an enum memmodel with 
MEMMODEL_SEQ_CST = 5; So I guess that I could use that MEMMODEL_SEQ_CST 
as an argument to gcc_jit_context_new_rvalue_from_int.

But some distributions don't package GCC plugin headers (in particular, 
in the past, some GCC versions on some Redhat systems disabled plugins 
in GCC; I don't know if that is true today). And at least, it is not 
documented that GCCJIT is related to GCC plugins.

Regards.

-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***

  reply	other threads:[~2016-05-20 12:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-01  0:00 Basile Starynkevitch
2016-01-01  0:00 ` David Malcolm
2016-01-01  0:00   ` Basile Starynkevitch
2016-01-01  0:00 ` Basile Starynkevitch
2016-01-01  0:00   ` Basile Starynkevitch [this message]
2019-01-01  0:00   ` Marc Nieper-Wißkirchen

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=573EFC6E.2020004@starynkevitch.net \
    --to=basile@starynkevitch.net \
    --cc=dmalcolm@redhat.com \
    --cc=jit@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).