All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Zachary Amsden <zach@vmware.com>
Cc: Andi Kleen <ak@suse.de>,
	akpm@osdl.org, chrisl@vmware.com, chrisw@osdl.org,
	Keir.Fraser@cl.cam.ac.uk, linux-kernel@vger.kernel.org,
	m+Ian.Pratt@cl.cam.ac.uk, mbligh@mbligh.org, pratap@vmware.com,
	virtualization@lists.osdl.org, zwame@arm.linux.org.uk
Subject: Re: [PATCH 5/14] i386 / Use early clobber to eliminate rotate in desc
Date: Tue, 16 Aug 2005 17:06:04 -0700	[thread overview]
Message-ID: <43027F6C.4070801@zytor.com> (raw)
In-Reply-To: <43027D20.7020907@vmware.com>

Zachary Amsden wrote:
> 
> This one in particular is non-optimal looking from C because the 
> compiler misses the potential for rotation.  But, composing into 
> temporaries and then issuing two writes to memory instead of multiple 
> writes within the same word could actually get you a better cycle count, 
> and that is something GCC just might be able to do :)
> 

At least i386 and x86-64 gcc should recognize

	((foo << x) + (foo >> (32-x)))

... as a 32-bit rotate; similar for 8-, 16- and 64-bit rotates of 
appropriate sized items.  Also, it seems it could just be an inline 
function instead of a macro.

	-hpa


  reply	other threads:[~2005-08-17  0:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-11  4:54 [PATCH 5/14] i386 / Use early clobber to eliminate rotate in desc zach
2005-08-16 23:45 ` Andi Kleen
2005-08-16 23:56   ` Zachary Amsden
2005-08-17  0:06     ` H. Peter Anvin [this message]
2005-08-17 14:22       ` Alan Cox
2005-08-17 15:54         ` H. Peter Anvin

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=43027F6C.4070801@zytor.com \
    --to=hpa@zytor.com \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=chrisl@vmware.com \
    --cc=chrisw@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m+Ian.Pratt@cl.cam.ac.uk \
    --cc=mbligh@mbligh.org \
    --cc=pratap@vmware.com \
    --cc=virtualization@lists.osdl.org \
    --cc=zach@vmware.com \
    --cc=zwame@arm.linux.org.uk \
    /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.