Comment 2 for bug 882151

Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

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)))))