guile-devel
[Top][All Lists]
Advanced

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

Re: [Guile-commits] GNU Guile branch, master, updated. a9b0f876c12bbbca9


From: Ludovic Courtès
Subject: Re: [Guile-commits] GNU Guile branch, master, updated. a9b0f876c12bbbca9bdf1890eb014a30f004d9f8
Date: Fri, 05 Jun 2009 15:21:33 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (gnu/linux)

Hello!

"Andy Wingo" <address@hidden> writes:

>  @deffn Instruction object-ref n
> -Push @var{n}th value from the current program's object vector.
> address@hidden Instruction long-object-ref n
> +Push @var{n}th value from the current program's object vector. The
> +``long'' variant has a 16-bit index instead of an 8-bit index.
>  @end deffn

Good that you fixed it!  However, I'm wondering whether it's really a
good idea to keep both the long and short instruction variants, instead
of having a single 16-bit variant.  What do you think?

> +VM_DEFINE_INSTRUCTION (52, long_object_ref, "long-object-ref", 2, 0, 1)
> +{
> +  unsigned int objnum = FETCH ();
> +  objnum <<= 8;
> +  objnum += FETCH ();

Perhaps a FETCH32() macro would actually be handy, and possibly more
efficient on platforms with 32-bit GP registers.

Actually, it would be even better if OBJNUM was encoded as part of the
instruction, since it would reside on the same cache line as the
instruction that's just been read.  It'd look like:

#v+
objnum = ((* (ip - 1)) & ~SCM_VM_INSTRUCTION_MASK)
         >> SCM_VM_INSTRUCTION_MASK_LOG2;
#v-

Also, I've forgotten about the details, but I was expecting one of the
fields in `scm_objcode' to become 16-bit after this change.  Probably
I'm just confused?  :-)

Thanks,
Ludo'.




reply via email to

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