[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: |
Thu, 28 Aug 2003 09:49:09 +1000 |
User-agent: |
Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.3 (gnu/linux) |
Dirk Herrmann <address@hidden> writes:
>
> Well, I still don't know what the "g" means,
Oh, well, it's pretty easy actually, a string for the asm instruction,
then output operands and input operands, with operand constraints
saying what register or memory etc is acceptable. In this case "g" (x)
means an input operand, located anywhere.
> changes in GCC to that syntax,
I wouldn't be too worried about that, asm has been a documented
feature for a long time and unlikely to change in incompatible ways.
It certainly goes back to gcc 2.7.2 in this form, and probably
earlier.
In any case I amended to:
/* In GCC we can force a reference to an SCM by making it an input to an
empty asm. This avoids 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 like this.
__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 and allows any memory or general register (or
immediate) operand. The actual asm syntax doesn't matter, we don't want
to use it, just ensure the operand is still alive. See "Extended Asm" in
the GCC manual for more. */