]> wimlib.net Git - wimlib/commitdiff
lzms_common.c: support x32 ABI in find_next_opcode_sse4_2()
authorEric Biggers <ebiggers3@gmail.com>
Tue, 19 Jul 2016 16:00:17 +0000 (09:00 -0700)
committerEric Biggers <ebiggers3@gmail.com>
Tue, 19 Jul 2016 16:45:48 +0000 (09:45 -0700)
src/lzms_common.c

index 380b74319b1a1b7cb8fe9e7ffa894d77bff6b160..fb13a4358c5469a79d0c4c5e101c03ee2f9e59db 100644 (file)
@@ -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
  *
  * 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
@@ -391,7 +391,11 @@ find_next_opcode_sse4_2(u8 *p)
                "  pcmpestri $0x0, (%[p]), %[potential_opcodes]      \n"
                "  jnc 1b                                            \n"
                "2:                                                  \n"
                "  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"
                "  add %%rcx, %[p]                                   \n"
+       #endif
                : [p] "+r" (p)
                : [potential_opcodes] "x" (potential_opcodes), "a" (6), "d" (16)
                : "rcx", "cc"
                : [p] "+r" (p)
                : [potential_opcodes] "x" (potential_opcodes), "a" (6), "d" (16)
                : "rcx", "cc"