diff options
author | Andy Wingo <wingo@pobox.com> | 2013-11-03 21:45:34 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-11-03 21:48:48 +0100 |
commit | d65514a2de2ef922d3613f0e35dea27a88313392 (patch) | |
tree | 7019c09ba8b323b0de16c0871a4b1b1373eb2226 /libguile/bitvectors.c | |
parent | 9ae9debbd35505ef4040c1a876f7bd64434d6d14 (diff) | |
download | guile-d65514a2de2ef922d3613f0e35dea27a88313392.tar.gz |
RTL compiler supports static bitvectors
* libguile/arrays.c (scm_from_contiguous_typed_array):
* libguile/bytevectors.c (scm_uniform_array_to_bytevector): For
bitvectors, round up the length to 32-bit units, as they are stored
internally. Otherwise I think this probably does the wrong thing for
the last word on big-endian systems.
* libguile/bitvectors.c (BITVECTOR_LENGTH, BITVECTOR_BITS):
(scm_c_make_bitvector): Reorder the length and pointer words to match
the layout of bytevectors.
* module/language/cps/primitives.scm (*branching-primcall-arities*):
* module/system/vm/assembler.scm (br-if-bitvector):
* module/system/vm/disassembler.scm (code-annotation): Add bitvector
test support.
* module/system/vm/assembler.scm (<uniform-vector-backing-store>): Add
an element-size field.
(intern-constant): Adapt make-uniform-vector-backing-store call. Use
uniform-array->bytevector, as the old compiler did.
(link-data): Add bitvector cases.
Diffstat (limited to 'libguile/bitvectors.c')
-rw-r--r-- | libguile/bitvectors.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libguile/bitvectors.c b/libguile/bitvectors.c index ffea6d182..2eef1dc56 100644 --- a/libguile/bitvectors.c +++ b/libguile/bitvectors.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1997,1998,2000,2001,2002,2003,2004, 2005, 2006, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1997,1998,2000,2001,2002,2003,2004, 2005, 2006, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -39,8 +39,8 @@ */ #define IS_BITVECTOR(obj) SCM_TYP16_PREDICATE(scm_tc7_bitvector,(obj)) -#define BITVECTOR_BITS(obj) ((scm_t_uint32 *)SCM_CELL_WORD_1(obj)) -#define BITVECTOR_LENGTH(obj) ((size_t)SCM_CELL_WORD_2(obj)) +#define BITVECTOR_LENGTH(obj) ((size_t)SCM_CELL_WORD_1(obj)) +#define BITVECTOR_BITS(obj) ((scm_t_uint32 *)SCM_CELL_WORD_2(obj)) int scm_i_print_bitvector (SCM vec, SCM port, scm_print_state *pstate) @@ -110,7 +110,7 @@ scm_c_make_bitvector (size_t len, SCM fill) bits = scm_gc_malloc_pointerless (sizeof (scm_t_uint32) * word_len, "bitvector"); - res = scm_double_cell (scm_tc7_bitvector, (scm_t_bits)bits, len, 0); + res = scm_double_cell (scm_tc7_bitvector, len, (scm_t_bits)bits, 0); if (!SCM_UNBNDP (fill)) scm_bitvector_fill_x (res, fill); |