Hardware sorting