From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60852 invoked by alias); 26 Jun 2019 13:17:22 -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 60835 invoked by uid 89); 26 Jun 2019 13:17:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-19.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-Spam-Status: No, score=-19.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Jun 2019 13:17:21 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 884BF8110B; Wed, 26 Jun 2019 13:16:56 +0000 (UTC) Received: from ovpn-116-166.phx2.redhat.com (ovpn-116-166.phx2.redhat.com [10.3.116.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id D5D7760C80; Wed, 26 Jun 2019 13:16:55 +0000 (UTC) Message-ID: <1561555015.13494.10.camel@redhat.com> Subject: Re: [PATCH][gcc] libgccjit: add bitfield support From: David Malcolm To: Andrea Corallo Cc: "gcc-patches@gcc.gnu.org" , "jit@gcc.gnu.org" , nd Date: Tue, 01 Jan 2019 00:00:00 -0000 In-Reply-To: References: <1560865833.3885.8.camel@redhat.com> <1561410326.3885.34.camel@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 26 Jun 2019 13:17:04 +0000 (UTC) X-IsSubscribed: yes X-SW-Source: 2019-q2/txt/msg00015.txt.bz2 On Wed, 2019-06-26 at 11:07 +0000, Andrea Corallo wrote: > Hi David, > thanks for the suggestions. > Updated version for the bitfield libgccjit support patch here > addressing comments. > > test-error-gcc_jit_context_new_bitfield-invalid-width.c is reworked > and now assume that the long of the compiler compiling the test is of > the same size of the libgccjit long. > I'm not sure this assumption is sufficent, in case is not we have to > find another way around this. > > Checked with make check-jit runs clean. > > Bests > > Andrea > > > 2019-06-20 Andrea Corallo andrea.corallo@arm.com > > * docs/topics/compatibility.rst (LIBGCCJIT_ABI_12): New ABI tag. > * docs/topics/types.rst: Add gcc_jit_context_new_bitfield. > * jit-common.h (namespace recording): Add class bitfield. > * jit-playback.c: > (DECL_C_BIT_FIELD, SET_DECL_C_BIT_FIELD): Add macros. > (playback::context::new_bitfield): New method. > (playback::compound_type::set_fields): Add bitfield support. > (playback::lvalue::mark_addressable): Was jit_mark_addressable make > this > a method of lvalue plus return a bool to communicate success. > (playback::lvalue::get_address): Check for jit_mark_addressable > return > value. > * jit-playback.h (new_bitfield): New method. > (class bitfield): New class. > (class lvalue): Add jit_mark_addressable method. > * jit-recording.c (recording::context::new_bitfield): New method. > (recording::bitfield::replay_into): New method. > (recording::bitfield::write_to_dump): Likewise. > (recording::bitfield::make_debug_string): Likewise. > (recording::bitfield::write_reproducer): Likewise. > * jit-recording.h (class context): Add new_bitfield method. > (class field): Make it derivable by class bitfield. > (class bitfield): Add new class. > * libgccjit++.h (class context): Add new_bitfield method. > * libgccjit.c (struct gcc_jit_bitfield): New structure. > (gcc_jit_context_new_bitfield): New function. > * libgccjit.h > (LIBGCCJIT_HAVE_gcc_jit_context_new_bitfield) New macro. > (gcc_jit_context_new_bitfield): New function. > * libgccjit.map (LIBGCCJIT_ABI_12) New ABI tag. > > > 2019-06-20 Andrea Corallo andrea.corallo@arm.com > > * jit.dg/all-non-failing-tests.h: Add test-accessing-bitfield.c. > * jit.dg/test-accessing-bitfield.c: New testcase. > * jit.dg/test-error-gcc_jit_context_new_bitfield-invalid-type.c: > Likewise. > * jit.dg/test-error-gcc_jit_context_new_bitfield-invalid-width.c: > Likewise. > * jit.dg/test-error-gcc_jit_lvalue_get_address-bitfield.c: > Likewise. Thanks for the updated patch. One last nit: [...] > diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c > index b74495c..ae8a732 100644 > --- a/gcc/jit/jit-playback.c > +++ b/gcc/jit/jit-playback.c > @@ -47,6 +47,12 @@ along with GCC; see the file COPYING3. If not see > #include "jit-builtins.h" > #include "jit-tempdir.h" > > +/* Compare with gcc/c-family/c-common.h We should say what to compare it against: Compare with "DECL_C_BIT_FIELD" etc in gcc/c-family/c-common.h > + This is redefined here to avoid depending from the C frontend. */ s/from/on/ also, FWIW > +#define DECL_JIT_BIT_FIELD(NODE) \ > + (DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) == 1) > +#define SET_DECL_JIT_BIT_FIELD(NODE) \ > + (DECL_LANG_FLAG_4 (FIELD_DECL_CHECK (NODE)) = 1) With that change, the patch is good for trunk - thanks for all your work on this. Are you working on getting SVN commit access, or do you want me to commit your two patches on your behalf? Dave