1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-16 16:50:21 +02:00

Add `load-unsigned-integer' instruction.

* libguile/vm-i-loader.c (load_unsigned_integer): New loader.

* module/language/assembly.scm (byte-length): Handle
  `load-unsigned-integer'.

* module/language/assembly/compile-bytecode.scm (write-bytecode):
  Likewise.

* module/language/glil/compile-assembly.scm (dump-object): Emit a
  `load-unsigned-integer' instruction for positive integers.  This fixes
  loading of integers greater than 2^31 - 1.

* testsuite/Makefile.am (vm_test_files): Add `t-literal-integers.scm'.

* doc/ref/vm.texi (Loading Instructions): Add `load-unsigned-integer'.
This commit is contained in:
Ludovic Courtès 2009-02-18 00:54:05 +01:00
parent 4e29767187
commit b912a1cd6b
7 changed files with 37 additions and 6 deletions

View file

@ -1,6 +1,6 @@
;;; Guile VM assembler
;; Copyright (C) 2001 Free Software Foundation, Inc.
;; Copyright (C) 2001, 2009 Free Software Foundation, Inc.
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@ -107,6 +107,7 @@
(if (> i 0) (write-byte x))))
(get-addr (lambda () i)))
(write-bytecode meta write get-addr '()))))
((load-unsigned-integer ,str) (write-loader str))
((load-integer ,str) (write-loader str))
((load-number ,str) (write-loader str))
((load-string ,str) (write-loader str))