The bug occurs only if ROTATE-RIGHT-64 is inlined -- when the %64bit-rotate-byte/c version of the VOP is used.
Here's the fixed version -- commit coming tomorrowish.
(define-vop (%64bit-rotate-byte/c) (:policy :fast-safe) (:translate %unsigned-64-rotate-byte) (:note "inline 64-bit constant rotation") (:args (integer :scs (sb-vm::unsigned-reg) :target result)) (:info count) (:arg-types (:constant (integer -63 63)) sb-vm::unsigned-num) (:results (result :scs (sb-vm::unsigned-reg))) (:result-types sb-vm::unsigned-num) (:generator 5 (aver (not (= count 0))) (move result integer) (if (> count 0) (inst rol result count) (inst ror result (- count)))))
The bug occurs only if ROTATE-RIGHT-64 is inlined -- when the %64bit- rotate- byte/c version of the VOP is used.
Here's the fixed version -- commit coming tomorrowish.
(define-vop (%64bit- rotate- byte/c) 64-rotate- byte) :unsigned- reg) :target result)) unsigned- num) :unsigned- reg))) unsigned- num)
(:policy :fast-safe)
(:translate %unsigned-
(:note "inline 64-bit constant rotation")
(:args (integer :scs (sb-vm:
(:info count)
(:arg-types (:constant (integer -63 63)) sb-vm::
(:results (result :scs (sb-vm:
(:result-types sb-vm::
(:generator 5
(aver (not (= count 0)))
(move result integer)
(if (> count 0)
(inst rol result count)
(inst ror result (- count)))))