X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Flzms_common.c;h=50176847f8b042cd20b1600342c5ee0fad0805da;hb=9811a0b1088004bf2b8631d22cc8a2626b15c3b4;hp=380b74319b1a1b7cb8fe9e7ffa894d77bff6b160;hpb=4a20aae0dd8469a352517a0b107416ffa99ccc55;p=wimlib diff --git a/src/lzms_common.c b/src/lzms_common.c index 380b7431..50176847 100644 --- a/src/lzms_common.c +++ b/src/lzms_common.c @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 2013, 2014 Eric Biggers + * Copyright (C) 2013-2016 Eric Biggers * * This file is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free @@ -16,16 +16,16 @@ * details. * * You should have received a copy of the GNU Lesser General Public License - * along with this file; if not, see http://www.gnu.org/licenses/. + * along with this file; if not, see https://www.gnu.org/licenses/. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif +#include "wimlib/cpu_features.h" #include "wimlib/lzms_common.h" #include "wimlib/unaligned.h" -#include "wimlib/x86_cpu_features.h" #ifdef __x86_64__ # include @@ -391,7 +391,11 @@ find_next_opcode_sse4_2(u8 *p) " pcmpestri $0x0, (%[p]), %[potential_opcodes] \n" " jnc 1b \n" "2: \n" + #ifdef __ILP32__ /* x32 ABI (x86_64 with 32-bit pointers) */ + " add %%ecx, %[p] \n" + #else " add %%rcx, %[p] \n" + #endif : [p] "+r" (p) : [potential_opcodes] "x" (potential_opcodes), "a" (6), "d" (16) : "rcx", "cc" @@ -610,7 +614,7 @@ lzms_x86_filter(u8 data[restrict], s32 size, tail_ptr = &data[size - 16]; #ifdef __x86_64__ - if (x86_have_cpu_feature(X86_CPU_FEATURE_SSE4_2)) { + if (cpu_features & X86_CPU_FEATURE_SSE4_2) { u8 saved_byte = *tail_ptr; *tail_ptr = 0xE8; for (;;) {