Hello,

I'm implementing in C++ a semi-portable portable bit vector based on
SIMD extensions
available on the platform. GCC automatically vectorizes it to a large
extent, but much
better code could have been generated it there were a way to annotate
the source code somehow.
Namely, in many places I know that a pointer points to an 8-bytes
aligned array of std::uint64_t
(hence the compiler should use movdqu), but the number of elements is
divisible by 2, so no fixup
code needs to be generated and only the SSE2-based variant should be emitted.

Is there a way to tell the compiler about it via some attribute or
pragma? Of course a full-blown
platform-specific variant of the source code is possible, but as the
vectorizer does a good job
(relatively to its limited knowledge), I would prefer to help it
instead of reimplementing the vector.

    Best regards
    Piotr Wyderski

Reply via email to