From: Bodo Eggert <7eggert@gmx.de>
To: "Jan Engelhardt" <jengelh@linux01.gwdg.de>,
"Daniel Marjamäki" <daniel.marjamaki@gmail.com>,
"Arjan van de Ven" <arjan@infradead.org>,
linux-kernel@vger.kernel.org
Subject: Re: Want comments regarding patch
Date: Sat, 30 Dec 2006 01:00:50 +0100 [thread overview]
Message-ID: <E1H0Rec-00011Y-55@be1.lrz> (raw)
In-Reply-To: <7xn0j-6rY-7@gated-at.bofh.it>
Jan Engelhardt <jengelh@linux01.gwdg.de> wrote:
> On Dec 29 2006 07:57, Daniel Marjamäki wrote:
>> It was my goal to improve the readability. I failed.
>>
>> I personally prefer to use standard functions instead of writing code.
>> In my opinion using standard functions means less code that is easier to
>> read.
>
> Hm in that case, what about having something like
>
> void *memset_int(void *a, int x, int n) {
> asm("mov %0, %%esi;
> mov %1, %%eax;
> mov %2, %%ecx;
> repz movsd;",
> a,x,n);
> }
This would copy the to-be-initialized buffer somewhere, if it compiles.
1) You want stosd, "store string", not "move string"
2) You'll want to set %%di (destination index) instead of %%si.
3) repz should be illegal for movs, it might be interpreted as rep by
defective assemblers, since it generates the same prefix. "rep" is
correct here, since you don't want to break on (non-)zero-words.
4) Mind the direction flag.
next parent reply other threads:[~2006-12-30 0:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <7x8ul-7NU-7@gated-at.bofh.it>
[not found] ` <7x8E5-80F-13@gated-at.bofh.it>
[not found] ` <7xdkq-7tB-25@gated-at.bofh.it>
[not found] ` <7xjSQ-1fR-13@gated-at.bofh.it>
[not found] ` <7xn0j-6rY-7@gated-at.bofh.it>
2006-12-30 0:00 ` Bodo Eggert [this message]
2006-12-30 11:07 ` Jan Engelhardt
2006-12-30 11:42 ` Arjan van de Ven
2006-12-28 18:41 Daniel Marjamäki
2006-12-28 18:53 ` Arjan van de Ven
2006-12-28 23:52 ` Jan Engelhardt
2006-12-29 6:57 ` Daniel Marjamäki
2006-12-29 10:13 ` Jan Engelhardt
2006-12-28 20:07 ` Horst H. von Brand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1H0Rec-00011Y-55@be1.lrz \
--to=7eggert@gmx.de \
--cc=arjan@infradead.org \
--cc=daniel.marjamaki@gmail.com \
--cc=jengelh@linux01.gwdg.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®