All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Chuck Ebbert <76306.1226@compuserve.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Chris Lesiak <chris.lesiak@licor.com>,
	Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>
Subject: Re: [patch 2.6.17-rc5 1/2] i386 memcpy: use as few moves as  possible for I/O
Date: Tue, 30 May 2006 18:36:47 -0700	[thread overview]
Message-ID: <447CF32F.1050309@zytor.com> (raw)
In-Reply-To: <200605302103_MC3-1-BF0E-59B@compuserve.com>

One concern: this is not the standard return value for memcpy().  It either needs a 
comment to that effect (stating it returns a pointer to the end of the area), or just make 
it return void.

Also, the formatting looks nonstandard.

>  
>  /*
> + * Do memcpy with as few moves as possible (for transfers to/from IO space.)
> + */
> +static inline void * __minimal_memcpy(void * to, const void * from, size_t n)
> +{
> +int d0, d1, d2;
> +__asm__ __volatile__(
> +	"rep ; movsl\n\t"
> +	"testb $2,%b4\n\t"
> +	"jz 1f\n\t"
> +	"movsw\n"
> +	"1:\n\t"
> +	"testb $1,%b4\n\t"
> +	"jz 2f\n\t"
> +	"movsb\n"
> +	"2:"
> +	: "=&c" (d0), "=&D" (d1), "=&S" (d2)
> +	:"0" (n/4), "q" (n), "1" ((long) to), "2" ((long) from)
> +	: "memory");
> +return to;
> +}


	-hpa

  reply	other threads:[~2006-05-31  1:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-31  0:59 [patch 2.6.17-rc5 1/2] i386 memcpy: use as few moves as possible for I/O Chuck Ebbert
2006-05-31  1:36 ` H. Peter Anvin [this message]
2006-05-31  3:42 ` H. Peter Anvin
2006-05-31 11:39 ` linux-os (Dick Johnson)
  -- strict thread matches above, loose matches on Subject: below --
2006-05-31 23:01 Chuck Ebbert

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=447CF32F.1050309@zytor.com \
    --to=hpa@zytor.com \
    --cc=76306.1226@compuserve.com \
    --cc=akpm@osdl.org \
    --cc=chris.lesiak@licor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.