guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scm_remember_upto_here asm volatile


From: Dirk Herrmann
Subject: Re: scm_remember_upto_here asm volatile
Date: Wed, 27 Aug 2003 06:28:21 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]