typedef uint8x16_t chunk_t;
+#define CHUNK_SIZE 16
+
#define HAVE_CHUNKMEMSET_1
#define HAVE_CHUNKMEMSET_2
#define HAVE_CHUNKMEMSET_4
typedef __m256i chunk_t;
+#define CHUNK_SIZE 32
+
#define HAVE_CHUNKMEMSET_1
#define HAVE_CHUNKMEMSET_2
#define HAVE_CHUNKMEMSET_4
typedef __m128i chunk_t;
+#define CHUNK_SIZE 16
+
#define HAVE_CHUNKMEMSET_1
#define HAVE_CHUNKMEMSET_2
#define HAVE_CHUNKMEMSET_4
typedef struct chunk_t { uint8_t u8[8]; } chunk_t;
#endif
+#define CHUNK_SIZE 8
+
#define HAVE_CHUNKMEMSET_1
#define HAVE_CHUNKMEMSET_4
#define HAVE_CHUNKMEMSET_8
Z_INTERNAL uint8_t* CHUNKCOPY_SAFE(uint8_t *out, uint8_t const *from, unsigned len, uint8_t *safe) {
len = MIN(len, safe - out + 1);
if (len < sizeof(chunk_t)) {
- int32_t use_chunk16 = sizeof(chunk_t) > 16 && (len & 16);
- if (use_chunk16) {
+#if CHUNK_SIZE > 16
+ if (len & 16) {
memcpy(out, from, 16);
out += 16;
from += 16;
}
+#endif
+#if CHUNK_SIZE > 8
if (len & 8) {
memcpy(out, from, 8);
out += 8;
from += 8;
}
+#endif
if (len & 4) {
memcpy(out, from, 4);
out += 4;