From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Dirk Herrmann Newsgroups: gmane.lisp.guile.devel Subject: Re: scm_remember_upto_here asm volatile Date: Wed, 27 Aug 2003 06:28:21 +0200 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <3F4C3365.60507@dirk-herrmanns-seiten.de> References: <874r4186ty.fsf@zip.com.au> <87znll48wr.fsf@zagadka.ping.de> <87he7rwzox.fsf@zip.com.au> <87znl1ocrn.fsf@zagadka.ping.de> <878ypx2rk3.fsf@zip.com.au> <3F4742BD.9090704@dirk-herrmanns-seiten.de> <87r8398fk5.fsf@zip.com.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1061955678 19878 80.91.224.253 (27 Aug 2003 03:41:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 27 Aug 2003 03:41:18 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Aug 27 05:41:17 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19rrBM-0005zR-01 for ; Wed, 27 Aug 2003 05:41:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 19rrAC-0008MI-T3 for guile-devel@m.gmane.org; Tue, 26 Aug 2003 23:40:04 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.22) id 19rr9e-0008M1-M8 for guile-devel@gnu.org; Tue, 26 Aug 2003 23:39:30 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.22) id 19rr98-0008G0-NT for guile-devel@gnu.org; Tue, 26 Aug 2003 23:39:29 -0400 Original-Received: from [212.227.126.184] (helo=moutng.kundenserver.de) by monty-python.gnu.org with esmtp (Exim 4.22) id 19rr98-0008Eo-66 for guile-devel@gnu.org; Tue, 26 Aug 2003 23:38:58 -0400 Original-Received: from [212.227.126.155] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 19rr93-000091-00; Wed, 27 Aug 2003 05:38:53 +0200 Original-Received: from [80.131.43.202] (helo=dirk-herrmanns-seiten.de) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 19rr93-000437-00; Wed, 27 Aug 2003 05:38:53 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: de, en Original-To: Kevin Ryde In-Reply-To: <87r8398fk5.fsf@zip.com.au> X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 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 Xref: main.gmane.org gmane.lisp.guile.devel:2721 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2721 Kevin Ryde wrote: >How about the tweak below. No doubt the gcc manual describes the >overall syntax better than a bit of a comment could do, the aim I >guess would be just to cover the reasoning for why this form does >what's wanted in this context. > > > >/* In GCC we can force a reference to an SCM with a little do-nothing asm, > avoiding the code size and slowdown of an actual function call. > Unfortunately there doesn't seem to be any way to do the varargs > scm_remember_upto_here similarly. > > __volatile__ ensures nothing will be moved across the asm, and it won't > be optimized away (or only if proved unreachable). Constraint "g" can be > used on all processors, it allows any memory, general register, or > immediate operand. The actual asm syntax which comes out for it doesn't > matter, we don't want to use it, just ensure the operand is still > alive. */ > > Well, I still don't know what the "g" means, just that it can be used on all processors. But, if you think that the GCC manual describes it clearly enough and don't want to copy that documentation, I would suggest to add a note 'for an explanation of the asm expression see GCC manual of GCC-version xx.xx, chapter xx'. This makes it easy to find the necessary explanation plus has the advantage that in case of changes in GCC to that syntax, it is clearly stated to which version of GCC the implementation was tailored. If the GCC folks enumerate the versions of their assembly syntax definition, this version number would even be better. Suggestion: /* In GCC we can force a reference to an SCM with a little do-nothing asm, avoiding the code size and slowdown of an actual function call. Unfortunately there doesn't seem to be any way to do the varargs scm_remember_upto_here similarly. __volatile__ ensures nothing will be moved across the asm, and it won't be optimized away (or only if proved unreachable). For an explanation of the asm expression see GCC manual of GCC-version xx.xx, chapter xx. */ Friendly regards Dirk Herrmann _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel