Add previously omitted SRFI 33 operation TEST-BIT-FIELD?.
authorTaylor R Campbell <campbell@mumble.net>
Sun, 17 Oct 2010 20:32:28 +0000 (20:32 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Sun, 17 Oct 2010 20:32:28 +0000 (20:32 +0000)
src/runtime/integer-bits.scm
src/runtime/runtime.pkg

index a0313df25d0e89c01d95d8bd40ade85002d08c69..0949eec9d0fd7f217cb586ed15a629288427acb2 100644 (file)
@@ -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))
index 4caf653ab5647488bd4df17e6cf500ae5a783783..15edbc165ba9cd7f39213e63ed014befc46b9182 100644 (file)
@@ -314,6 +314,7 @@ USA.
          shift-right
          splice-bit-field
          test-bit-field
+         test-bit-field?
 
          ;; Truth table order
          bitwise-and