Make CONTAINING-INTEGER-TYPE take N-WORD-BITS into account.
authorLutz Euler <lutz.euler@freenet.de>
Mon, 6 May 2013 17:37:23 +0000 (19:37 +0200)
committerLutz Euler <lutz.euler@freenet.de>
Mon, 6 May 2013 17:37:23 +0000 (19:37 +0200)
commit47c73b316a434da5bab4e39b746bbe9a0f17aa8c
treea43079f54356d541e46b195b9296d2dc779b3b19
parent61ca6a411cc0e8c746e480d7a05423242e49ea45
Make CONTAINING-INTEGER-TYPE take N-WORD-BITS into account.

Replace the hardcoded 32s in the function with N-WORD-BITS. This in turn
allows SOURCE-TRANSFORM-NUMERIC-TYPEP to find better transformations
for type checks for types larger than fixnum but smaller than a machine
word also under 64-bit word size. The most important improvement this
achieves is to avoid generic arithmetic for the bounds tests in these
cases.

For example, the test (TYPEP X '(UNSIGNED-BYTE 63)) runs about four
times as fast on x86-64 with this change.

(Tests for the exact types (SIGNED-BYTE 64) and (UNSIGNED-BYTE 64) are
unaffected as compiling them takes another code path, which already
generates well optimized code.)
NEWS
src/compiler/generic/vm-type.lisp