#ifndef _WIMLIB_DECOMPRESS_COMMON_H
#define _WIMLIB_DECOMPRESS_COMMON_H
-#include "wimlib/assert.h"
#include "wimlib/compiler.h"
-#include "wimlib/endianness.h"
#include "wimlib/types.h"
#include "wimlib/unaligned.h"
unsigned num_bits, const u8 lens[],
unsigned max_codeword_len);
+static inline void
+copy_word_unaligned(const void *src, void *dst)
+{
+ store_word_unaligned(load_word_unaligned(src), dst);
+}
+
+static inline machine_word_t
+repeat_byte(u8 b)
+{
+ machine_word_t v;
+
+ BUILD_BUG_ON(WORDSIZE != 4 && WORDSIZE != 8);
+
+ v = b;
+ v |= v << 8;
+ v |= v << 16;
+ v |= v << ((WORDSIZE == 8) ? 32 : 0);
+ return v;
+}
/*
* Copy an LZ77 match at (dst - offset) to dst.