<p dir="ltr">Hi Joerg, </p>
<p dir="ltr">Daniel also pointed out this usage. :-) </p>
<p dir="ltr">My point was: it's a very limited usage. </p>
<p dir="ltr">AFAIK, the only part of the kernel that had it was arch/arm, and that was removed because of Clang back then. </p>
<p dir="ltr">Embedded or RTOS usage is different. But the tools are usually different, too. </p>
<p dir="ltr">Cheers, <br>
Renato </p>
<div class="gmail_quote">On 6 Oct 2015 9:36 pm, "Joerg Sonnenberger via cfe-dev" <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, Oct 06, 2015 at 10:07:45AM +0100, Renato Golin via cfe-dev wrote:<br>
> As David said, the only *real* use for global named registers is for<br>
> registers that have a specific meaning throughout the program: the<br>
> stack pointer being the only one that has a useful meaning. You don't<br>
> want to be changing the PC that easily, but if you really do, doing so<br>
> in inline asm is perfectly valid.<br>
<br>
This is simplifying things too much. The classic use case for a global<br>
named register is to hold an extremely hot thread local variable. This<br>
is primarily from a time when (a) thread local variable didn't exist and<br>
(b) the overhead typically associated with them on some platforms is too<br>
high. Consider older ARM or MIPS system, where any access to the thread<br>
register would involve a trap. Things like Lisp engines often have a<br>
global context pointer which is easily hot enough to justify burning a<br>
register on it.<br>
<br>
Joerg<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>