New operations on the two's-complement representation of integers.
authorTaylor R Campbell <campbell@mumble.net>
Sun, 17 Oct 2010 20:00:34 +0000 (20:00 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Sun, 17 Oct 2010 20:00:34 +0000 (20:00 +0000)
commitf175e3ee886e7fbef84661c9a3618ed68bd4479f
treec247a615a2a213b294ee4a3470097d237aa1f4ba
parent6741e538324f2ecea5d6ebeb28792f0e223c7e9f
New operations on the two's-complement representation of integers.

These include the SRFI 33 operations, as well as some other useful
operations.

Although these are implemented as primitives with native definitions
for bignums, the primitives are not yet open-coded for the fixnum
case.  Eventually they should be open-coded, so that you don't need
to make a choice between safe code using the integer operations and
fast code using FIX:AND, FIX:LSH, &c.  Some operations are easy to
open-code for the fixnum case, such as all the bitwise operations.
Others are not so easy, such as SHIFT-LEFT, and it would be better to
open-code common aggregate operations such as EXTRACT-BIT-FIELD for
the fixnum case.  In any case, at least we now have names for the
safe operations.
src/microcode/artutl.c
src/microcode/bignmint.h
src/microcode/bignum.c
src/microcode/bignum.h
src/microcode/bits.h [new file with mode: 0644]
src/microcode/extern.h
src/microcode/intprm.c
src/runtime/integer-bits.scm [new file with mode: 0644]
src/runtime/runtime.pkg
tests/runtime/test-integer-bits.scm [new file with mode: 0644]