4 ms·
using a bit more arcane (but not crazy) method for determining sorted-ness - https://godbolt.org/g/MKN9HP https://godbolt.org/g/MKN9HP - clang, and icc seem to
by foxhill 9y ago
using a bit more arcane (but not crazy) method for determining sorted-ness - https://godbolt.org/g/MKN9HP https://godbolt.org/g/MKN9HP - clang, and icc seem to have no problem vectorising the inner loop.
gcc manages it too, but emits a huge amount of code, though. and setting -Os seems to stop it from vectorising the code. shame.
edit: replaced with more correct version..