public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roland Dreier <roland@topspin.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Andrew Morton <akpm@osdl.org>,
	anton@au.ibm.com,
	linuxppc64-dev <linuxppc64-dev@lists.linuxppc.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Fix ppc64 out_be64
Date: 14 Jun 2004 13:26:28 -0700	[thread overview]
Message-ID: <52wu2928ej.fsf@topspin.com> (raw)
In-Reply-To: <1087146682.8697.184.camel@gaston>

    Benjamin> Well, I may know ppc asm, but gcc inline asm still
    Benjamin> drives me nuts :)

Speaking of gcc asm, is there a reason why out_le64 (specifically the
constraints) isn't written in this (simpler) way?  It seems to me we
can just let val be an input, as long as the "&" constraint for tmp
makes sure it doesn't share the same register.  This seems to generate
the same code for me as the current kernel version, at least with gcc
3.4.0/binutils 2.15.

	static inline void out_le64(volatile unsigned long *addr, unsigned long val)
	{
		unsigned long tmp;
	
		__asm__ __volatile__(
				     "rldimi %0,%2,5*8,1*8\n"
				     "rldimi %0,%2,3*8,2*8\n"
				     "rldimi %0,%2,1*8,3*8\n"
				     "rldimi %0,%2,7*8,4*8\n"
				     "rldicl %2,%2,32,0\n"
				     "rlwimi %0,%2,8,8,31\n"
				     "rlwimi %0,%2,24,16,23\n"
				     "std %0,%1\n"
				     "sync"
				     : "=&r" (tmp), "=m" (*addr) : "r" (val));
	}

  reply	other threads:[~2004-06-14 20:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-12 22:00 [PATCH] Fix ppc64 out_be64 Roland Dreier
2004-06-13 15:50 ` Benjamin Herrenschmidt
2004-06-13 16:21   ` Anton Blanchard
2004-06-13 17:08     ` Benjamin Herrenschmidt
2004-06-13 16:48   ` Roland Dreier
2004-06-13 17:11     ` Benjamin Herrenschmidt
2004-06-14 20:26       ` Roland Dreier [this message]
2004-06-14 21:10         ` Benjamin Herrenschmidt

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=52wu2928ej.fsf@topspin.com \
    --to=roland@topspin.com \
    --cc=akpm@osdl.org \
    --cc=anton@au.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc64-dev@lists.linuxppc.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