* module/language/cps/slot-allocation.scm (allocate-slots): Avoid
allocating locals in the range [253,255].
* module/system/vm/assembler.scm: List exports explicitly. For
operations with limited-range operands, export wrapper assemblers that
handle shuffling their operands into and out of their range.
(define-assembler): Get rid of enclosing begin.
(shuffling-assembler, define-shuffling-assembler): New helpers to
define shuffling wrapper assemblers.
(emit-mov*, emit-receive*): New functions.
(shuffle-up-args): New helper.
(standard-prelude, opt-prelude, kw-prelude): Call shuffle-up-args
after finishing.
* test-suite/tests/compiler.test ("limits"): Add test cases.
* module/system/vm/frame.scm (frame-call-representation): Fix to work
for primitives.
* test-suite/tests/eval.test ("stacks"): Update expected result for
substring.
* test-suite/tests/coverage.test ("line-execution-counts"): Update
expectations. Since there's nothing to do at the loop header and the
renaming of X happens at the end of the loops, the compiled code only
sees the loop header once.
* test-suite/tests/signals.test: Update setitimer tests to sloppily
match both times -- it seems that the interval can also be sloppy on
some platforms, sadly.
This is a follow-up to e26ab06.
* libguile/print.c (scm_simple_format): Pass 1 to
SCM_VALIDATE_OPORT_VALUE, for 'destination'.
* test-suite/tests/format.test ("simple-format"): Add test.
* module/texinfo.scm (read-char-data): Preserve newlines in @example and
similar environments in the case when the next line starts with an @.
* test-suite/tests/texinfo.test ("test-texinfo->stexinfo"): Add a test.
* libguile/srfi-60.c (scm_srfi60_rotate_bit_field): Avoid division by
zero in the (start == end) case. Rewrite inum case to work with
unsigned integers in two's complement format.
* test-suite/tests/srfi-60.test ("rotate-bit-field"): Add more tests.
* module/ice-9/boot-9.scm (for-each): Fix detection of not-a-list in the
unrolled one-argument case.
* test-suite/tests/eval.test ("for-each"): Add a test.
* test-suite/tests/statprof.test ("statistical sample counts within
expected range"): Increase number of calls, as the computer speed
increases and VM/compiler speed increases have meant that we get fewer
samples than before. Also, compare the maximum deviation to the
square root of the expected value. I don't actually know what the
right statistical check is here, but this is closer to an "all points
fall within a standard deviation" than our previous 30% check. Print
a nicer warning when the check fails.
* doc/ref/posix.texi (Signals): Fix the documentation for setitimer; it
was wrong.
* libguile/scmsigs.c (pack_tv): New helper. Allow usecs >= 1e6.
(unpack_tv): New helper.
(scm_setitimer): Use the new helpers.
* test-suite/tests/signals.test: Add setitimer tests.
* module/texinfo.scm (read-char-data): Preserve newlines in @example and
similar environments in the case when the next line starts with an @.
* test-suite/tests/texinfo.test ("test-texinfo->stexinfo"): Add a test.
* module/language/tree-il/peval.scm (peval): When going to peval a call
whose operator isn't just a lambda but is a let-bound lambda, as one
bound via define-inlinable, don't create a new counter if the lambda
is only referenced once in the source. Avoids needless failure to
inline once-referenced procedures.
* test-suite/tests/peval.test ("partial evaluation"): Wheeeee
This fixes a compiler issue where (uniform-array->bytevector #2f64())
failed because of the stricter definition of uniform-vector? on this branch.
Perhaps it would be better if uniform-array->bytevector didn't require
a contiguous argument.
* libguile/arrays.c: (scm_array_contents): return the root regardless of
the value of SCM_I_ARRAY_DIMS (ra)->inc.
* test-suite/tests/arrays.test: check.
* libguile/array-map.c
- (scm_array_index_map_x): preallocate the index list instead of
constructing it on each rank-1 iteration.
- (ramap, rafe): use SCM_I_ARRAY_V just once.
* libguile/array-map.c
- (scm_ramapc): mismatched axes limit unrollk (kroll). Reorganize
the function to do all checking as we go.
- (scm_ra_matchp): unused; remove.
- (find_unrollk): inlined in scm_ramapc; remove.
- (klen): inlined in scm_ramapc; remove.
- (rafill): n is size_t.
- (racp): n is size_t. Use n and not i0end to bound the loop.
- (ramap): Use n and not i0end to bound the loop. This is needed for the rank
0 case to work with the new scm_ramapc, as inc may be set to 0 in that case.
- (rafe): idem.
* test-suite/tests/ramap.test
- check that size mismatch prevents unrolling (matching behavior III) with
both array-copy! and array-map!.
- check that non-contiguous stride in non-ref args prevents unrolling
(rank 2, discontinuous) with both array-copy! and array-map!.
- check rank 0 cases with array-for-each, array-map!.
- Test the 0-inc, non empty case for both array-map! and array-copy!.
* libguile/array-map.c
- (cind): replace by cindk, that operates only on the unrolled index set.
- (klen): new function.
- (make1array): take extra inc argument.
- (scm_ramapc): rewrite to unroll as many axes as possible instead of just all
or one.
- (AREF): lbnd is known to be 0: remove.
- (ASET): v is known to come from SCM_I_ARRAY_V; assume base, inc, lbnd.
- (racp): use ssize_t instead of long for the indices.
- (scm_array_index_map_x): build the index list at the last-but-one axis, then
set the car of the last element, instead of building the list at the last axis.
* test-suite/tests/ramap.test
- add array-map! test with offset arguments.
* libguile/arrays.c (scm_array_contents): Branch cases not on
scm_is_generalized_vector but on SCM_I_ARRAYP. Thus lbnd!=0, which
could happen with scm_is_generalized_vector, never appears in the
output.
* test-suite/tests/arrays.test: Test array-contents.
* test-suite/tests/arrays.test: move array-copy! tests to ramap.test.
* test-suite/tests/ramap.test: check the dissimilar matching behavior of
array-copy! and array-map! with arguments of different size.
* libguile/array-map.c
- scm_ra_matchp: look for empty axes and return new case 5 if so. Use
array handles to remove the SCM_I_ARRAYP / not branch.
- scm_ramapc: Heed case 5.
* test-suite/tests/ramap.test
- test empty arguments for array-copy! and array-for-each. Note those
that failed in 2.0.9.
* libguile/array-map.c: (scm_array_index_map_x): bail out if any one of the
axes is empty.
* test-suite/tests/ramap.test: add tests for empty array-case of
array-index-map!. The 'f64 case with not-last emtpy axis is broken in 2.0.9.
This commit also renames uniform-vector-element-type-code to
array-type-code.
Conflicts:
libguile/uniform.c
libguile/uniform.h
test-suite/tests/arrays.test
* libguile/uniform.h:
* libguile/uniform.c (scm_is_uniform_vector, scm_uniform_vector_p)
(scm_c_uniform_vector_length, scm_uniform_vector_length)
(scm_uniform_vector_element_type, scm_uniform_vector_element_size)
(scm_c_uniform_vector_ref, scm_uniform_vector_ref):
(scm_c_uniform_vector_set_x, scm_uniform_vector_set_x):
(scm_uniform_vector_to_list)
(scm_uniform_vector_elements, scm_uniform_vector_writable_elements):
Deprecate. This interface lacked both generality and specificity.
The general replacement is array-length, array-ref, and friends on the
scheme side, or the array handle interface on the C side. On the
specific side of things, there are the specific bytevector, srfi-4,
and bitvector interfaces.
* test-suite/tests/arrays.test:
* test-suite/tests/bitvectors.test:
* test-suite/tests/ports.test:
* test-suite/tests/srfi-4.test: Update to use array interfaces.
* doc/ref/api-foreign.texi (Void Pointers and Byte Access):
* doc/ref/srfi-modules.texi (SRFI-4): Update.
* test-suite/guile-test (run-tests): Load each test file within
(with-locale "C" ...).
* test-suite/tests/encoding-iso88591.test:
* test-suite/tests/encoding-iso88597.test:
* test-suite/tests/encoding-utf8.test:
* test-suite/tests/srfi-14.test: Remove broken code to save and restore
the previous locale.
* test-suite/tests/bytevectors.test:
* test-suite/tests/format.test:
* test-suite/tests/regexp.test:
* test-suite/tests/srfi-19.test:
* test-suite/tests/tree-il.test: Make sure 'setlocale' is defined before
calling it.
* libguile/vectors.c (scm_vector_length, scm_c_vector_length):
(scm_c_vector_ref, scm_c_vector_set_x): Deprecate the use of these
procedures on weak vectors.
* test-suite/tests/guardians.test:
* test-suite/tests/weaks.test: Adapt test suites.