lkml.org 
[lkml]   [2021]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2021-04-17 16:26    [W:2.215 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site