From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64654 invoked by alias); 20 May 2016 12:01:10 -0000 Mailing-List: contact jit-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: jit-owner@gcc.gnu.org Received: (qmail 64018 invoked by uid 89); 20 May 2016 12:01:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.1 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=dirty, france, les, France X-Spam-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: ovh.starynkevitch.net Authentication-Results: ovh.starynkevitch.net (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=starynkevitch.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= starynkevitch.net; h=content-transfer-encoding:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:to:subject:subject; s=dkim; t= 1463745649; x=1464609650; bh=kkve68isOL3PjA9Ps/+V8bMUC9jD/3I09Ll 1/BtNM3s=; b=AhDDFjZPjA2CwGeQK9IA0fZYk86RQBrZ30TS2rQjBojfnWkB5Ru /yVo1daspn2+2hNfR6tycaaB0hXqvstRTAAkJd10syMY1/Fxo5wVzZmEofdzqGpg 7sSf5kAeyS9TJvPhK2+Of8cRWN8bxKRdXzYA6wSTC8peLwgevZVHlVs8= X-Virus-Scanned: Debian amavisd-new at ovh.starynkevitch.net Subject: Re: wish: gcc_jit_type_get_atomic To: jit@gcc.gnu.org, David Malcolm References: <5734193A.2040903@starynkevitch.net> <573EF903.2050007@starynkevitch.net> From: Basile Starynkevitch Message-ID: <573EFC6E.2020004@starynkevitch.net> Date: Fri, 01 Jan 2016 00:00:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0 MIME-Version: 1.0 In-Reply-To: <573EF903.2050007@starynkevitch.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2016-q2/txt/msg00043.txt.bz2 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: basilestarynkevitchnet mobile: +33 6 8501 2359 8, rue de la Faiencerie, 92340 Bourg La Reine, France *** opinions {are only mine, sont seulement les miennes} ***