[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YHrvq6/d4iw8SLAc@hirez.programming.kicks-ass.net>
Date: Sat, 17 Apr 2021 16:24:43 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Willy Tarreau <w@....eu>
Cc: Matthew Wilcox <willy@...radead.org>,
Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
Wedson Almeida Filho <wedsonaf@...gle.com>,
Miguel Ojeda <ojeda@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
rust-for-linux@...r.kernel.org,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Linux Doc Mailing List <linux-doc@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 00/13] [RFC] Rust support
On Sat, Apr 17, 2021 at 01:46:23PM +0200, Willy Tarreau wrote:
> For me the old trick of casting one side as long long still works:
>
> unsigned long long mul3264(unsigned int a, unsigned int b)
> {
> return (unsigned long long)a * b;
> }
>
> i386:
> 00000000 <mul3264>:
> 0: 8b 44 24 08 mov 0x8(%esp),%eax
> 4: f7 64 24 04 mull 0x4(%esp)
> 8: c3 ret
>
> x86_64:
> 0000000000000000 <mul3264>:
> 0: 89 f8 mov %edi,%eax
> 2: 89 f7 mov %esi,%edi
> 4: 48 0f af c7 imul %rdi,%rax
> 8: c3 retq
>
> Or maybe you had something else in mind ?
Last time I tried it, the thing refused :/ which is how we ended up with
mul_u32_u32() in asm.
Powered by blists - more mailing lists