Some ABIs (x86/x86-64) allow garbage in unused upper bits of return
values; take that into account when converting BOOLEAN return types
to CL BOOLEANs.
modular arithemtic (mostly to exploit fixnum-width VOPs). (lp#1026634)
* bug fix: a combination of inlined local function with &optional and
recursion no longer causes undescriptive compiler errors. (lp#1180992)
+ * bug fix: sub-word BOOLEAN alien types now disregard higher order bits
+ when testing for non-zero-ness.
* optimization: faster ISQRT on fixnums and small bignums
* optimization: faster and smaller INTEGER-LENGTH on fixnums on x86-64.
* optimization: On x86-64, the number of multi-byte NOP instructions used
`(member t nil))
(define-alien-type-method (boolean :naturalize-gen) (type alien)
- (declare (ignore type))
- `(not (zerop ,alien)))
+ (let ((bits (alien-boolean-type-bits type)))
+ (if (= bits sb!vm:n-word-bits)
+ `(not (zerop ,alien))
+ `(logtest ,alien ,(ldb (byte bits 0) -1)))))
(define-alien-type-method (boolean :deport-gen) (type value)
(declare (ignore type))