From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] comp.c: Use the newly added bitcast API for type coercion, when available. (feature/jit-improved-type-punning) Date: Tue, 04 Oct 2022 18:39:33 +0000 Message-ID: References: <359f42c0c165c4b00c84a7818a89697e7cd28d50.camel@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10075"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Vibhav Pant Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 04 20:43:55 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ofmtW-0002Mq-QO for ged-emacs-devel@m.gmane-mx.org; Tue, 04 Oct 2022 20:43:54 +0200 Original-Received: from localhost ([::1]:52404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofmtV-0005at-Oc for ged-emacs-devel@m.gmane-mx.org; Tue, 04 Oct 2022 14:43:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofmph-0002j4-6j for emacs-devel@gnu.org; Tue, 04 Oct 2022 14:39:57 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:59136) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofmpU-0004Jf-T3 for emacs-devel@gnu.org; Tue, 04 Oct 2022 14:39:46 -0400 Original-Received: from ma.sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 294IdWMa011100 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Tue, 4 Oct 2022 18:39:33 GMT In-Reply-To: <359f42c0c165c4b00c84a7818a89697e7cd28d50.camel@gmail.com> (Vibhav Pant's message of "Sun, 02 Oct 2022 22:57:40 +0530") Received-SPF: pass client-ip=205.166.94.24; envelope-from=akrl@sdf.org; helo=mx.sdf.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:296919 Archived-At: Vibhav Pant writes: > On Wed, 2022-09-28 at 12:37 +0000, Andrea Corallo wrote: >> thanks for the patch, please find some comments below. > Hi Andrea, > > Thanks for the feedback. > >> >> Could you clarify why we need this double cast in both cases here? >> > > gcc_jit_context_new_bitcast requires that the types being converted > between have the same layout and as such, doesn't allow converting > between an arbitrarily sized integer/boolean and a pointer. Casting it > to a uintptr/void* is still necessary, to ensure that it can be bitcast > into a void*/uintptr respectively. I see thanks, I'd like to have a comment recording this in the code. >> > >> >> Are this and the following new line added voluntarily? >> > > Oops, fixed. The patch is okay for me with the suggestions implemented. I assume you have write access, if is not the case just post the patch here and I'll install it. Thanks for your work. Bests Andrea