From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: On elisp running native Date: Sat, 28 Dec 2019 22:13:13 +0000 Message-ID: References: <838smzq9iz.fsf@gnu.org> <8336d6rfgy.fsf@gnu.org> <83woagonl9.fsf@gnu.org> <83sgl4ojci.fsf@gnu.org> <83png8o9pz.fsf@gnu.org> <83h81knvlv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="235821"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 28 23:13:31 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ilKKw-000zDe-To for ged-emacs-devel@m.gmane.org; Sat, 28 Dec 2019 23:13:31 +0100 Original-Received: from localhost ([::1]:46692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ilKKv-000214-HR for ged-emacs-devel@m.gmane.org; Sat, 28 Dec 2019 17:13:29 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49153) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ilKKp-00020y-LU for emacs-devel@gnu.org; Sat, 28 Dec 2019 17:13:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ilKKo-0006wG-8H for emacs-devel@gnu.org; Sat, 28 Dec 2019 17:13:23 -0500 Original-Received: from mx.sdf.org ([205.166.94.20]:60910) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ilKKl-00063U-O8; Sat, 28 Dec 2019 17:13:19 -0500 Original-Received: from sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id xBSMDEF1021686 (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits) verified NO); Sat, 28 Dec 2019 22:13:14 GMT Original-Received: (from akrl@localhost) by sdf.org (8.15.2/8.12.8/Submit) id xBSMDDMo005329; Sat, 28 Dec 2019 22:13:13 GMT In-Reply-To: <83h81knvlv.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 28 Dec 2019 20:38:52 +0200") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 205.166.94.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:243742 Archived-At: Eli Zaretskii writes: >> From: Andrea Corallo >> Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org >> Date: Sat, 28 Dec 2019 14:35:46 +0000 >> >> I guess it's easier to read in code than to explain (is really not >> much). In case you can find 'load_comp_unit' into: >> >> https://gitlab.com/koral/gccemacs/raw/dev/src/comp.c > > Well, it's a 34K-line file full of calls to gcc_jit functions. It's > hard to figure out what it does unless one is already familiar with > libgccjit. Sure I was just talking about the load process. > Can you describe what happens using a simple example? Suppose I have > a simple function whose body does > > (let ((i 0)) > (while (< i something) > (foobar i) > (setq i (1+ i)))) > > When this is compiled with libgccjit using your code, will the > resulting native code include calls to Fwhile, Fsetq, and Fadd1? Or > will it convert the above to the equivalent machine-language loop? If > the latter, how does it know what to produce for Fwhile, for example? > > P.S. Pointers to your code where it does something that answers the > above questions are very fine. > > Thanks. I think would be helpful to try writing something more than just a single mail. I'll try to come-up with something written on the web page describing the compilation process for your example and post the update here to discuss. I'll try to do it in the next days (I apologize I'm a little task saturated). Thanks Andrea -- akrl@sdf.org