This was missed in #1831. The RLE methods compare a string of bytes
directly with itself to directly derive a simple run length encoding.
They use similar but not identical methods to compare256. This needs
a similar endianness check at compile time to know which compare bit
count to use (leading or trailing).
#include "zbuild.h"
#include "fallback_builtins.h"
+#include "zendian.h"
typedef uint32_t (*compare256_rle_func)(const uint8_t* src0, const uint8_t* src1);
diff = sv ^ mv;
if (diff) {
+#if BYTE_ORDER == LITTLE_ENDIAN
uint32_t match_byte = __builtin_ctz(diff) / 8;
+#else
+ uint32_t match_byte = __builtin_clz(diff) / 8;
+#endif
return len + match_byte;
}
diff = sv ^ mv;
if (diff) {
+#if BYTE_ORDER == LITTLE_ENDIAN
uint64_t match_byte = __builtin_ctzll(diff) / 8;
+#else
+ uint64_t match_byte = __builtin_clzll(diff) / 8;
+#endif
return len + (uint32_t)match_byte;
}