From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: Register VM WIP Date: Mon, 14 May 2012 23:09:05 +0200 Message-ID: <873972zczy.fsf@gnu.org> References: <871umqr8q0.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1337030241 17506 80.91.229.3 (14 May 2012 21:17:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 14 May 2012 21:17:21 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon May 14 23:17:21 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SU2do-0003md-0s for guile-devel@m.gmane.org; Mon, 14 May 2012 23:17:16 +0200 Original-Received: from localhost ([::1]:33347 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SU2XD-00048G-Rd for guile-devel@m.gmane.org; Mon, 14 May 2012 17:10:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SU2WK-0001uL-6J for guile-devel@gnu.org; Mon, 14 May 2012 17:09:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SU2WH-0007Fs-1A for guile-devel@gnu.org; Mon, 14 May 2012 17:09:31 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:34145) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SU2WG-0007EJ-Qg for guile-devel@gnu.org; Mon, 14 May 2012 17:09:28 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SU2WD-0005ra-Ue for guile-devel@gnu.org; Mon, 14 May 2012 23:09:25 +0200 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 May 2012 23:09:25 +0200 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 May 2012 23:09:25 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 36 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 26 =?iso-8859-1?Q?Flor=E9al?= an 220 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.93 (gnu/linux) Cancel-Lock: sha1:REwV0PXIKNS9C17veJ/vVh2DTP0= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:14425 Archived-At: Hi Andy! This all looks pretty exciting! Being able to get rid of all repeated ‘local-{ref,set}’ instructions sounds compelling. And it does seem to bring us one step closer to native code. Presumably the tricky part will be the register allocator, right? Looking at the ‘countdown’ example, I wonder how much could be achieved in the stack VM by using well-chosen super-instructions: 0 (assert-nargs-ee/locals 17) 2 (br :L186) ;; -> 30 6 (local-ref 1) 8 (make-int8:0) 9 (ee?) 10 (local-set 2) ;; 12 (local-ref 2) ;; → use ‘local-set* 2’, which doesn’t pop 14 (br-if-not :L187) ;; -> 21 18 (local-ref 2) 20 (return) 21 (local-ref 1) ;; 23 (sub1) ;; → use ‘local-sub1 1’ 24 (local-set 1) ;; 26 (br :L188) ;; -> 6 30 (local-ref 0) ;; 32 (local-set 1) ;; → use ‘local-mov 0 1’ 34 (br :L188) ;; -> 6 This would amount to making some of the instructions like those of a register VM, but it could be done incrementally. Anyway, this is inspiring, and promising! Thanks, Ludo’.