X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-rotate-byte%2Fcompiler.lisp;h=2d0f1954c4ae0e96705effe484218264b10150c7;hb=a28e5039d2a5087ca3c04376fd423ec0cedb64ad;hp=2e7d5e1d7f1bc179613d2cab5aab069bc57458c5;hpb=939275c1bc2f18ef93cd1dd4ab35a18f6008cfd9;p=sbcl.git diff --git a/contrib/sb-rotate-byte/compiler.lisp b/contrib/sb-rotate-byte/compiler.lisp index 2e7d5e1..2d0f195 100644 --- a/contrib/sb-rotate-byte/compiler.lisp +++ b/contrib/sb-rotate-byte/compiler.lisp @@ -56,3 +56,15 @@ ;; FIXME: What happens when, as here, the two type specifiers for ;; COUNT overlap? Which gets to run first? '(%unsigned-32-rotate-byte count integer)) + +;; Generic implementation for platforms that don't supply VOPs for 32-bit +;; rotate. +#-(or x86 ppc) +(deftransform %unsigned-32-rotate-byte ((.count. .integer.) + ((integer -31 31) + (unsigned-byte 32)) *) + '(if (< .count. 0) + (logior (ldb (byte 32 0) (ash .integer. (+ .count. 32))) + (ash .integer. .count.)) + (logior (ldb (byte 32 0) (ash .integer. .count.)) + (ash .integer. (- .count. 32)))))