3 ms·
People are making the (valid) assumption that LE is far more common than BE. On x86 swapping endianness is one instruction (BSWAP), but AFAIK it can't be SIMD'
by userbinator 11y ago
People are making the (valid) assumption that LE is far more common than BE.
On x86 swapping endianness is one instruction (BSWAP), but AFAIK it can't be SIMD'd easily. Given that SIMD is one of the things that can greatly speed up image processing, I don't think it "won't hurt performance too much"...
- nightcracker 11y agoFor SIMD you can use _mm<width>_shuffle_epi8 to swap endianness in a single cycle.
- mtklein 11y ago(Just FYI, this only works with SSSE3+, which to be fair is essentially all x86 machines. It's also >1 cycle on mobile x86 chips, which is very frustrating.)