From: Taylor R Campbell Date: Sun, 17 Oct 2010 20:32:28 +0000 (+0000) Subject: Add previously omitted SRFI 33 operation TEST-BIT-FIELD?. X-Git-Tag: 20101212-Gtk~32 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=c959547a6fe067a7268271a79aba103a94183451;p=mit-scheme.git Add previously omitted SRFI 33 operation TEST-BIT-FIELD?. --- diff --git a/src/runtime/integer-bits.scm b/src/runtime/integer-bits.scm index a0313df25..0949eec9d 100644 --- a/src/runtime/integer-bits.scm +++ b/src/runtime/integer-bits.scm @@ -88,6 +88,9 @@ USA. (bitwise-ior (shift-left (extract-bit-field size 0 field) position) (bitwise-andc2 integer (bit-mask size position)))) +(define-integrable (test-bit-field? size position integer) + (not (zero? (extract-bit-field size position integer)))) + (declare (integrate-operator test-bit-field)) (define (test-bit-field size position integer mask) (declare (integrate position integer mask)) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index 4caf653ab..15edbc165 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -314,6 +314,7 @@ USA. shift-right splice-bit-field test-bit-field + test-bit-field? ;; Truth table order bitwise-and