From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sender4-pp-o90.zoho.com (sender4-pp-o90.zoho.com [136.143.188.90]) by sourceware.org (Postfix) with ESMTPS id A5C843858C52; Fri, 2 Dec 2022 14:30:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A5C843858C52 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=zoho.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=zoho.com ARC-Seal: i=1; a=rsa-sha256; t=1669991397; cv=none; d=zohomail.com; s=zohoarc; b=DCMQBxsdZ8EiNm2CeCy0k+13WpROPcRXSVDAa7sIli68RHyUay9U03W+azLF4LBtkR0wSwYa0YnJZIonYVBQT4liYRGsIumlUuRQ5KTdMLR/JjwbMesuxg6pxTjKD1Za8MyvXTWotcU3pl4JLG04ASOyvbANxPs6SUVN2hqFd5I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1669991397; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=RIvnFPthN60U9o14NYeZ6z5rOIhrkKCg+VGV+xRlE6A=; b=ByWPJylfopxNktjcUSpWph298zR9w9F31mtUQmCgX6f5z8wUWpT/ubDreRRrUlPp/efTj+ntwWPeGrZwKkIIN8mRAX+5hvc+gCROyikpBHD24V3cQjodXZyZr6pGCIubKrYcCHZEPceQZgbVz1xOsqTW8Zk4rYdrWCxpYWPXlcY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=zoho.com; spf=pass smtp.mailfrom=bouanto@zoho.com; dmarc=pass header.from= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=message-id:subject:from:to:cc:date:in-reply-to:references:content-type:user-agent:mime-version; b=ZP24SjNTeILnlZmoXHxjAfT9dqtli3VRi7H8UDG0//mO8p4QEf2DW8nYuzgxs39+lLp8gmZc4nay vEJLjdjeIjn/O45Mi9ZdHKZy4RypRyKShl4KYlqP49t495bcHMW7 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1669991397; s=zm2022; d=zoho.com; i=bouanto@zoho.com; h=Message-ID:Subject:Subject:From:From:To:To:Cc:Cc:Date:Date:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:MIME-Version:Message-Id:Reply-To; bh=RIvnFPthN60U9o14NYeZ6z5rOIhrkKCg+VGV+xRlE6A=; b=C1hkXDdSoi6ZNB9/RFcaFDf9Pt4tgBAK9T4VS9b0U7wCbnKRErFSfe8n04LBivHI HEhW/OfVIl16nd1bANv1iJ0WB2zm7QEC9nTkZGmxlV9dYjRxOH3PpfwdGDzEnI9rp5L WGdBI6hbkH6TZzzUyeRSrf9G208l60p2T6sN4X7w= Received: from [192.168.1.174] (38.87.11.6 [38.87.11.6]) by mx.zohomail.com with SMTPS id 1669991396261900.7789494022229; Fri, 2 Dec 2022 06:29:56 -0800 (PST) Message-ID: Subject: Re: [PATCH] libgccjit: Fix float vector comparison From: Antoni Boucher To: David Malcolm , gcc-patches@gcc.gnu.org, jit@gcc.gnu.org Cc: Guillaume Gomez Date: Fri, 02 Dec 2022 09:29:54 -0500 In-Reply-To: <138f2f9ca9eeee76f3fc7532e32a535ac8884fe2.camel@redhat.com> References: <30eb27a08792e1e2b92e663753f22e31f65c7791.camel@redhat.com> <15fbee19972751bfa05c24ec95bc441c621c98ad.camel@zoho.com> <74150b934836583a532d310c68d29384daf2fbd0.camel@redhat.com> <5827fc95314506387b9b0e5c5da865eb28cf28e8.camel@zoho.com> <138f2f9ca9eeee76f3fc7532e32a535ac8884fe2.camel@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.1 MIME-Version: 1.0 X-ZohoMailClient: External X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, 2022-12-01 at 11:57 -0500, David Malcolm wrote: > On Thu, 2022-12-01 at 10:33 -0500, Antoni Boucher wrote: > > On Thu, 2022-12-01 at 10:25 -0500, David Malcolm wrote: > > > On Thu, 2022-12-01 at 10:01 -0500, Antoni Boucher wrote: > > > > Thanks, David. > > > > Since we're not in phase 1 anymore, do we need an approval > > > > before > > > > I > > > > merge like last year or can I merge immediately? > > >=20 > > > I think it counts as a bug fix and thus you can go ahead and > > > merge > > > (assuming you've done the usual testing). > > >=20 > > > > I also have many other patches (all in jit) that I need to > > > > prepare > > > > and > > > > post to this mailing list. > > > > What do you think? > > >=20 > > > Given that you're one of the main users of libgccjit I think > > > there's > > > a > > > case for stretching the deadlines a bit here. > > >=20 > > > Do you have a repo I can look at? > >=20 > > Yes! The commits are in my fork: > > https://github.com/antoyo/gcc > >=20 > > The only big one is the one adding support for target-dependent > > builtins: > > https://github.com/antoyo/gcc/commit/6d4313d4c02dd878f43917c978f299f511= 9330f0 > >=20 > > Regarding this one, there's the issue that since we record the > > builtins > > on the first context run, we only have access to the builtins from > > the > > second run. > > Do you have any idea how to fix this? > > Or do you consider this is acceptable? >=20 > This is implemented behind the new > gcc_jit_context_get_target_builtin_function entrypoint, right? Yes. >=20 > If so, perhaps that recording::context::get_target_builtin_function > could detect if it's the first time it's been called on this context, > and if so make a playback::context to do the detection?=C2=A0 That way it > would be transparent to the user, and work first time. Oh, the issue is actually with the type reflection API and also the type checking of function calls, so it's in the recording phase. While I could think of a workaround for the type checking (e.g. delayed type checking at the playback phase), I could not think of any better solution for the type reflection. >=20 >=20 > I see you have patches to add function and variable attributes; I > wonder if this would be cleaner internally if there was a > recording::attribute class, rather than the std::pair currently in > use > (some attributes have int arguments rather than string, others have > multiple args). >=20 > I also wondered if a "gcc_jit_attribute" type could be exposed to the > user, e.g.: >=20 > =C2=A0 attr1 =3D gcc_jit_context_new_attribute (ctxt, "noreturn"); > =C2=A0 attr2 =3D gcc_jit_context_new_attribute_with_string (ctxt, "alias"= , > "__foo"); > =C2=A0 gcc_jit_function_add_attribute (ctxt, attr1); > =C2=A0 gcc_jit_function_add_attribute (ctxt, attr2); >=20 > or somesuch?=C2=A0 But I think the API you currently have is OK. Thanks for the suggestion; I'll look into that. >=20 >=20 > >=20 > > I also have a WIP branch which adds support for try/catch: > > https://github.com/antoyo/gcc/commit/6219339fcacb079431596a0bc6cf8d430a= 1bd5a1 > > I'm not sure if this one is going to be ready soon or not. >=20 > I see that the new entrypoints have e.g.: >=20 > /* Add a try/catch statement. > =C2=A0=C2=A0 This is equivalent to this C++ code: > =C2=A0=C2=A0=C2=A0=C2=A0 try { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 try_block > =C2=A0=C2=A0=C2=A0=C2=A0 } > =C2=A0=C2=A0=C2=A0=C2=A0 catch { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 catch_block > =C2=A0=C2=A0=C2=A0=C2=A0 } > */ >=20 > void > gcc_jit_block_add_try_catch (gcc_jit_block *block, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 gcc_jit_location *loc, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 gcc_jit_block *try_block, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 gcc_jit_block *catch_block); >=20 > but I'm not sure how this is meant to interact with the CFG-like > model > used by the rest of the gcc_jit_block_* API.=C2=A0 What happens at the en= d > of the blocks?=C2=A0 Does the generated code use the C++ ABI for > exception- > handling? Currently, it requires the try and catch blocks to be terminated, but also require the block containing the try/catch to be terminated. That doesn't make sense. Would it be OK if it doesn't require the try and catch blocks to be terminated? For the ABI, I'm not sure it's necessarily tied to C++, but I might be wrong. From what I understand, GCC will use the dwarf-2 exception handling model if it's available or the sjlj otherwise (perhaps that can be configured). And the user can change the personality function via the API I added. Thanks for your feedback. >=20 > Dave >=20 > >=20 > > Thanks. > >=20 > > >=20 > > > Dave > > >=20 > > >=20 > > > >=20 > > > > On Thu, 2022-12-01 at 09:28 -0500, David Malcolm wrote: > > > > > On Sun, 2022-11-20 at 14:03 -0500, Antoni Boucher via Jit > > > > > wrote: > > > > > > Hi. > > > > > > This fixes bug 107770. > > > > > > Thanks for the review. > > > > >=20 > > > > > Thanks, the patch looks good to me. > > > > >=20 > > > > > Dave > > > > >=20 > > > >=20 > > >=20 > >=20 >=20