* Added fxcopy-bit.
This commit is contained in:
parent
edb0abd366
commit
d977720ae6
|
@ -2889,7 +2889,8 @@
|
||||||
(export fxfirst-bit-set bitwise-first-bit-set
|
(export fxfirst-bit-set bitwise-first-bit-set
|
||||||
fxbit-count bitwise-bit-count
|
fxbit-count bitwise-bit-count
|
||||||
fxlength
|
fxlength
|
||||||
fxbit-set?)
|
fxbit-set?
|
||||||
|
fxcopy-bit)
|
||||||
(import
|
(import
|
||||||
(ikarus system $fx)
|
(ikarus system $fx)
|
||||||
(ikarus system $bignums)
|
(ikarus system $bignums)
|
||||||
|
@ -2898,7 +2899,8 @@
|
||||||
fxfirst-bit-set bitwise-first-bit-set
|
fxfirst-bit-set bitwise-first-bit-set
|
||||||
fxbit-count bitwise-bit-count
|
fxbit-count bitwise-bit-count
|
||||||
fxlength
|
fxlength
|
||||||
fxbit-set?))
|
fxbit-set?
|
||||||
|
fxcopy-bit))
|
||||||
|
|
||||||
(module (bitwise-first-bit-set fxfirst-bit-set)
|
(module (bitwise-first-bit-set fxfirst-bit-set)
|
||||||
(define (byte-first-bit-set x i)
|
(define (byte-first-bit-set x i)
|
||||||
|
@ -3012,6 +3014,18 @@
|
||||||
(error who "index is not a fixnum" i))
|
(error who "index is not a fixnum" i))
|
||||||
(error who "not a fixnum" x)))
|
(error who "not a fixnum" x)))
|
||||||
|
|
||||||
|
(define (fxcopy-bit x i b)
|
||||||
|
(define who 'fxcopy-bit)
|
||||||
|
(if (fixnum? x)
|
||||||
|
(if (fixnum? i)
|
||||||
|
(if (and ($fx<= 0 i) ($fx< i (fixnum-width)))
|
||||||
|
(case b
|
||||||
|
[(0) ($fxlogand x ($fxlognot ($fxsll 1 i)))]
|
||||||
|
[(1) ($fxlogor x ($fxsll 1 i))]
|
||||||
|
[else (error who "invalid bit value" b)])
|
||||||
|
(error who "index out of range" i))
|
||||||
|
(error who "index is not a fixnum" i))
|
||||||
|
(error who "not a fixnum" x)))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -789,7 +789,7 @@
|
||||||
[fxbit-count i r fx]
|
[fxbit-count i r fx]
|
||||||
[fxbit-field r fx]
|
[fxbit-field r fx]
|
||||||
[fxbit-set? i r fx]
|
[fxbit-set? i r fx]
|
||||||
[fxcopy-bit r fx]
|
[fxcopy-bit i r fx]
|
||||||
[fxcopy-bit-field r fx]
|
[fxcopy-bit-field r fx]
|
||||||
[fxdiv i r fx]
|
[fxdiv i r fx]
|
||||||
[fxdiv-and-mod i r fx]
|
[fxdiv-and-mod i r fx]
|
||||||
|
|
|
@ -291,7 +291,7 @@
|
||||||
[fxbit-count C fx]
|
[fxbit-count C fx]
|
||||||
[fxbit-field S fx]
|
[fxbit-field S fx]
|
||||||
[fxbit-set? C fx]
|
[fxbit-set? C fx]
|
||||||
[fxcopy-bit S fx]
|
[fxcopy-bit C fx]
|
||||||
[fxcopy-bit-field S fx]
|
[fxcopy-bit-field S fx]
|
||||||
[fxdiv C fx]
|
[fxdiv C fx]
|
||||||
[fxdiv-and-mod C fx]
|
[fxdiv-and-mod C fx]
|
||||||
|
|
Loading…
Reference in New Issue