2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -0,0 +1,9 @@
|
|||
(defun shl (x width bits)
|
||||
"Compute bitwise left shift of x by 'bits' bits, represented on 'width' bits"
|
||||
(logand (ash x bits)
|
||||
(1- (ash 1 width))))
|
||||
|
||||
(defun shr (x width bits)
|
||||
"Compute bitwise right shift of x by 'bits' bits, represented on 'width' bits"
|
||||
(logand (ash x (- bits))
|
||||
(1- (ash 1 width))))
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
(defun rotl (x width bits)
|
||||
"Compute bitwise left rotation of x by 'bits' bits, represented on 'width' bits"
|
||||
(logior (logand (ash x (mod bits width))
|
||||
(1- (ash 1 width)))
|
||||
(logand (ash x (- (- width (mod bits width))))
|
||||
(1- (ash 1 width)))))
|
||||
|
||||
(defun rotr (x width bits)
|
||||
"Compute bitwise right rotation of x by 'bits' bits, represented on 'width' bits"
|
||||
(logior (logand (ash x (- (mod bits width)))
|
||||
(1- (ash 1 width)))
|
||||
(logand (ash x (- width (mod bits width)))
|
||||
(1- (ash 1 width)))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue