lkml.org 
[lkml]   [2006]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC/PATCH] Make powerpc64 use __thread for per-cpu variables
On Thu, May 11, 2006 at 11:21:15AM +1000, Paul Mackerras wrote:
> Alan Modra writes:
>
> > gcc shouldn't think there is any reason to cache the address.
>
> Can I rely on that being true in the future?

It isn't true in the *present*, except with a compiler on my home
machine. :-)

__thread int i1;
void
f3 (void)
{
int x = i1;
__asm__ __volatile__ ("#dragons be here. %0" : "+r" (x));
i1 = x;
}

current mainline with -O2 -S -mtls-size=16

f3:
addi 9,2,i1@tprel
lwz 0,0(9)
#APP
#dragons be here. 0
#NO_APP
stw 0,0(9)
blr

Same thing with my modified compiler.

f3:
lwz 0,i1@tprel(2)
#APP
#dragons be here. 0
#NO_APP
stw 0,i1@tprel(2)
blr

--
Alan Modra
IBM OzLabs - Linux Technology Centre
-
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: 2006-05-11 04:03    [W:0.077 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site