qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2] host-utils: Use __int128 for mul[us]64


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 1/2] host-utils: Use __int128 for mul[us]64
Date: Mon, 28 Jan 2013 19:02:03 +0000

On 28 January 2013 18:52, Richard Henderson <address@hidden> wrote:
> Replace some x86_64 specific inline assembly with something that
> all 64-bit hosts ought to optimize well.  At worst this becomes a
> call to the gcc __multi3 routine, which is no worse than our
> implementation in util/host-utils.c.

Hurrah for dropping inline assembly.

> +########################################
> +# check if __int128 is usable.
> +
> +int128=no
> +cat > $TMPC << EOF
> +int main (void) {
> +  __int128 a = 0;
> +  unsigned __int128 b = 1;
> +  a = a + b;
> +  a = a * b;
> +  return 0;
> +}

Have you written the test like this because you know
there are compilers out there that implement addition
but not multiplication (or unsigned but not signed, or
whatever), or just out of a vague sense of caution?

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]