From c959547a6fe067a7268271a79aba103a94183451 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sun, 17 Oct 2010 20:32:28 +0000 Subject: [PATCH] Add previously omitted SRFI 33 operation TEST-BIT-FIELD?. --- src/runtime/integer-bits.scm | 3 +++ src/runtime/runtime.pkg | 1 + 2 files changed, 4 insertions(+) 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 -- 2.25.1