(inst mov mask #x0101010101010101)
(inst imul result mask)
(inst shr result 56)))
+
+;; only marginally faster then the regular one, but shorter
+;; might be unavailable though
+(define-vop (unsigned-byte-64-count/popcnt)
+ (:translate logcount)
+ (:note "inline (unsigned-byte 64) logcount using popcnt instruction")
+ (:policy :fast-safe)
+ (:guard (member :popcnt *backend-subfeatures*))
+ (:args (arg :scs (unsigned-reg) :target result))
+ (:arg-types unsigned-num)
+ (:results (result :scs (unsigned-reg)))
+ (:result-types positive-fixnum)
+ (:generator 1
+ (inst popcnt arg result)))
\f
;;;; binary conditional VOPs