[Top][All Lists]

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

Re: scm_remember_upto_here asm volatile

From: Kevin Ryde
Subject: Re: scm_remember_upto_here asm volatile
Date: Tue, 26 Aug 2003 09:48:10 +1000
User-agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.3 (gnu/linux)

Dirk Herrmann <address@hidden> writes:
> would you mind to add an explanation of the syntax of that construct?
> For example, what does the "g" mean? Since we don't have many asm
> instructions in guile, it is fair to assume that most of the
> developers don't know about the exact meaning of that construct.

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.  */

reply via email to

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