lkml.org 
[lkml]   [2004]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Fix ppc64 out_be64
From
Date
    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));
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.272 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site