optimize endian operation for x86