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

2013-01-28 Thread Blue Swirl
On Mon, Jan 28, 2013 at 6:52 PM, Richard Henderson 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. > >

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

2013-01-28 Thread Richard Henderson
On 01/28/2013 11:02 AM, Peter Maydell wrote: 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? Vague sense of caution. I tried to

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

2013-01-28 Thread Peter Maydell
On 28 January 2013 18:52, Richard Henderson 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 fo

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

2013-01-28 Thread Richard Henderson
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. With gcc 4.7, we get identical code generation for x86_64. We now ge