+
+;; Generic implementation for platforms that don't supply VOPs for 32-bit
+;; rotate.
+#-(or x86 x86-64 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)))))
+
+#+x86-64
+(deftransform %rotate-byte ((count size pos integer)
+ ((integer -63 63)
+ (constant-arg (member 64))
+ (constant-arg (member 0))
+ (unsigned-byte 64)) *)
+ "inline 64-bit rotation"
+ '(%unsigned-64-rotate-byte count integer))
+
+;;; This transform needs to come after the others to ensure it gets
+;;; first crack at a zero COUNT, since transforms are currently run
+;;; latest-defined first.
+(deftransform %rotate-byte ((count size pos integer)
+ ((constant-arg (member 0)) * * *) *)
+ "fold identity operation"
+ 'integer)