From a82a0fbc625a96aabd2a11e79fb6aedf1fe313b3 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 6 Feb 2016 09:47:11 -0600 Subject: [PATCH] compiler.h: remove concept of different unaligned access speeds Just having fast and slow seems to be enough. --- include/wimlib/compiler.h | 10 +++++----- include/wimlib/decompress_common.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/wimlib/compiler.h b/include/wimlib/compiler.h index 102deb73..c469010b 100644 --- a/include/wimlib/compiler.h +++ b/include/wimlib/compiler.h @@ -107,12 +107,12 @@ #endif #define CPU_IS_LITTLE_ENDIAN (!CPU_IS_BIG_ENDIAN) -#if defined(__x86_64__) || defined(__i386__) -# define UNALIGNED_ACCESS_SPEED 3 -#elif defined(__ARM_FEATURE_UNALIGNED) && (__ARM_FEATURE_UNALIGNED == 1) -# define UNALIGNED_ACCESS_SPEED 2 +/* UNALIGNED_ACCESS_IS_FAST should be defined to 1 if unaligned memory accesses + * can be performed efficiently on the target platform. */ +#if defined(__x86_64__) || defined(__i386__) || defined(__ARM_FEATURE_UNALIGNED) +# define UNALIGNED_ACCESS_IS_FAST 1 #else -# define UNALIGNED_ACCESS_SPEED 0 +# define UNALIGNED_ACCESS_IS_FAST 0 #endif /* Get the type of the specified expression. */ diff --git a/include/wimlib/decompress_common.h b/include/wimlib/decompress_common.h index 4bfaf251..54241b36 100644 --- a/include/wimlib/decompress_common.h +++ b/include/wimlib/decompress_common.h @@ -299,7 +299,7 @@ lz_copy(u8 *dst, u32 length, u32 offset, const u8 *winend, u32 min_length) * beyond the end of the output buffer, hence the check for (winend - * end >= WORDSIZE - 1). */ - if (UNALIGNED_ACCESS_IS_VERY_FAST && + if (UNALIGNED_ACCESS_IS_FAST && likely(winend - end >= WORDSIZE - 1)) { -- 2.43.0