X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=host-utils.c;h=dc9612387b3ebe46ce52be2e5bc9104b2999da4f;hb=924ef7ee640bd32b0c7dcde3bbfcf41768491a98;hp=d0d780e54ef2588229dde1f3c94751269770aba6;hpb=e494ead52114e9d7baa9f33bca0e5b15b577c16b;p=qemu.git diff --git a/host-utils.c b/host-utils.c index d0d780e54..dc9612387 100644 --- a/host-utils.c +++ b/host-utils.c @@ -23,9 +23,14 @@ * THE SOFTWARE. */ -#include "vl.h" +#include +#include +#include "host-utils.h" + +//#define DEBUG_MULDIV /* Long integer helpers */ +#if !defined(__x86_64__) static void add128 (uint64_t *plow, uint64_t *phigh, uint64_t a, uint64_t b) { *plow += a; @@ -67,17 +72,10 @@ static void mul64 (uint64_t *plow, uint64_t *phigh, uint64_t a, uint64_t b) *phigh += v; } - /* Unsigned 64x64 -> 128 multiplication */ void mulu64 (uint64_t *plow, uint64_t *phigh, uint64_t a, uint64_t b) { -#if defined(__x86_64__) - __asm__ ("mul %0\n\t" - : "=d" (*phigh), "=a" (*plow) - : "a" (a), "0" (b)); -#else mul64(plow, phigh, a, b); -#endif #if defined(DEBUG_MULDIV) printf("mulu64: 0x%016llx * 0x%016llx = 0x%016llx%016llx\n", a, b, *phigh, *plow); @@ -87,11 +85,6 @@ void mulu64 (uint64_t *plow, uint64_t *phigh, uint64_t a, uint64_t b) /* Signed 64x64 -> 128 multiplication */ void muls64 (uint64_t *plow, uint64_t *phigh, int64_t a, int64_t b) { -#if defined(__x86_64__) - __asm__ ("imul %0\n\t" - : "=d" (*phigh), "=a" (*plow) - : "a" (a), "0" (b)); -#else int sa, sb; sa = (a < 0); @@ -104,9 +97,9 @@ void muls64 (uint64_t *plow, uint64_t *phigh, int64_t a, int64_t b) if (sa ^ sb) { neg128(plow, phigh); } -#endif #if defined(DEBUG_MULDIV) printf("muls64: 0x%016llx * 0x%016llx = 0x%016llx%016llx\n", a, b, *phigh, *plow); #endif } +#endif /* !defined(__x86_64__) */