diff options
author | Andy Wingo <wingo@pobox.com> | 2009-06-06 15:45:00 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-06-07 00:53:48 +0200 |
commit | 586cfdecfa4021e725287a02b57624418e597354 (patch) | |
tree | 50ce0db4be4867481948eb3c9f5d9b5fb4581362 /libguile/vm-i-system.c | |
parent | 4bcc952d4500d484cc43df47e2f7d64e5bc14ff3 (diff) | |
download | guile-586cfdecfa4021e725287a02b57624418e597354.tar.gz |
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.
Diffstat (limited to 'libguile/vm-i-system.c')
-rw-r--r-- | libguile/vm-i-system.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c index 36ff5bde8..6b130e7e1 100644 --- a/libguile/vm-i-system.c +++ b/libguile/vm-i-system.c @@ -138,6 +138,36 @@ VM_DEFINE_INSTRUCTION (13, make_int16, "make-int16", 2, 0, 1) NEXT; } +VM_DEFINE_INSTRUCTION (55, make_int64, "make-int64", 8, 0, 1) +{ + scm_t_uint64 v = 0; + v += FETCH (); + v <<= 8; v += FETCH (); + v <<= 8; v += FETCH (); + v <<= 8; v += FETCH (); + v <<= 8; v += FETCH (); + v <<= 8; v += FETCH (); + v <<= 8; v += FETCH (); + v <<= 8; v += FETCH (); + PUSH (scm_from_int64 ((scm_t_int64) v)); + NEXT; +} + +VM_DEFINE_INSTRUCTION (56, make_uint64, "make-uint64", 8, 0, 1) +{ + scm_t_uint64 v = 0; + v += FETCH (); + v <<= 8; v += FETCH (); + v <<= 8; v += FETCH (); + v <<= 8; v += FETCH (); + v <<= 8; v += FETCH (); + v <<= 8; v += FETCH (); + v <<= 8; v += FETCH (); + v <<= 8; v += FETCH (); + PUSH (scm_from_uint64 (v)); + NEXT; +} + VM_DEFINE_INSTRUCTION (14, make_char8, "make-char8", 1, 0, 1) { PUSH (SCM_MAKE_CHAR (FETCH ())); |