mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-24 20:30:28 +02:00
new instructions: make-int64, make-uint64
* doc/ref/vm.texi (Loading Instructions): Remove references to load-integer and load-unsigned-integer -- they're still in the VM but will be removed at some point. (Data Control Instructions): Add make-int64 and make-uint64. * libguile/vm-i-loader.c (load-unsigned-integer): Allow 8-byte values. But this instruction is on its way out, yo. * libguile/vm-i-system.c (make-int64, make-uint64): New instructions. * module/language/assembly.scm (object->assembly): Write out make-int64 and make-uint64 instructions, using bytevectors to do the endianness conversion. (assembly->object): And pretty-print them back, for disassembly. * module/language/glil/compile-assembly.scm: Don't generate load-integer / load-unsigned-integer instructions.
This commit is contained in:
parent
4bcc952d45
commit
586cfdecfa
5 changed files with 65 additions and 18 deletions
|
@ -24,13 +24,13 @@ VM_DEFINE_LOADER (59, load_unsigned_integer, "load-unsigned-integer")
|
|||
size_t len;
|
||||
|
||||
FETCH_LENGTH (len);
|
||||
if (SCM_LIKELY (len <= 4))
|
||||
if (SCM_LIKELY (len <= 8))
|
||||
{
|
||||
unsigned int val = 0;
|
||||
scm_t_uint64 val = 0;
|
||||
while (len-- > 0)
|
||||
val = (val << 8U) + FETCH ();
|
||||
SYNC_REGISTER ();
|
||||
PUSH (scm_from_uint (val));
|
||||
PUSH (scm_from_uint64 (val));
|
||||
NEXT;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue