diff options
author | Andy Wingo <wingo@pobox.com> | 2009-07-26 14:01:56 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-07-26 14:01:56 +0200 |
commit | e5dc27b86d0eaa470f92cdaa9f4ed2a961338c49 (patch) | |
tree | c8c46f9c5995fd22c42f072faefacd7d075193fb /module/language/assembly/decompile-bytecode.scm | |
parent | 28b119ee3da0f4b14cb87e638794d22843778cda (diff) | |
download | guile-e5dc27b86d0eaa470f92cdaa9f4ed2a961338c49.tar.gz |
increase range of relative jumps by aligning blocks to 8-byte boundaries
* libguile/objcodes.c (OBJCODE_COOKIE): Bump again, as our jump offsets
are now multiplied by 8.
* libguile/vm-i-system.c (BR): Interpret the 16-bit offset as a relative
jump to the nearest 8-byte-aligned block -- increasing relative jump
range from +/-32K to +/-240K.
(mvra): Do the same for the mvra jump.
* libguile/vm.c (really_make_boot_program): Align the mvra.
* module/language/assembly.scm (align-block): New export, for aligning
blocks.
* module/language/assembly/compile-bytecode.scm (write-bytecode): Emit
jumps to the nearest 8-byte-aligned block. Effectively our range is 18
bits in either direction. I would like to do this differently -- have
long-br and long-br-if, and all the other br instructions go to 8 bits
only. But the assembler doesn't have an appropriate representation to
allow me to do this yet, so for now this is what we have.
* module/language/assembly/decompile-bytecode.scm (decode-load-program):
Decode the 19-bit jumps.
Diffstat (limited to 'module/language/assembly/decompile-bytecode.scm')
-rw-r--r-- | module/language/assembly/decompile-bytecode.scm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/module/language/assembly/decompile-bytecode.scm b/module/language/assembly/decompile-bytecode.scm index 82459fc6f..0e34ab4a2 100644 --- a/module/language/assembly/decompile-bytecode.scm +++ b/module/language/assembly/decompile-bytecode.scm @@ -61,7 +61,8 @@ (labels '()) (i 0)) (define (ensure-label rel1 rel2) - (let ((where (+ i (bytes->s16 rel1 rel2)))) + (let ((where (+ (logand i (lognot #x7)) + (* (bytes->s16 rel1 rel2) 8)))) (or (assv-ref labels where) (begin (let ((l (gensym ":L"))) |