[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZO9j9WhSj7PmsM8b@biznet-home.integral.gnuweeb.org>
Date: Wed, 30 Aug 2023 22:44:53 +0700
From: Ammar Faizi <ammarfaizi2@...weeb.org>
To: Willy Tarreau <w@....eu>
Cc: Alviro Iskandar Setiawan <alviro.iskandar@...weeb.org>,
Thomas Weißschuh <linux@...ssschuh.net>,
Nicholas Rosenberg <inori@...x.org>,
Michael William Jonathan <moe@...weeb.org>,
GNU/Weeb Mailing List <gwml@...r.gnuweeb.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH v1 2/5] tools/nolibc: x86-64: Use `rep stosb` for
`memset()`
On Wed, Aug 30, 2023 at 05:23:22PM +0200, Willy Tarreau wrote:
> Then "xchg %esi, %eax" is just one byte with no memory access ;-)
Perfect!
Now I got this, shorter than "movl %esi, %eax":
```
0000000000001500 <memset>:
1500: 96 xchg %eax,%esi
1501: 48 89 d1 mov %rdx,%rcx
1504: 57 push %rdi
1505: f3 aa rep stos %al,%es:(%rdi)
1507: 58 pop %rax
1508: c3 ret
```
Unfortunately, the xchg trick doesn't yield smaller machine code for
%rdx, %rcx. Lol.
--
Ammar Faizi
Powered by blists - more mailing lists