This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH 1/5] PowerPC: Consolidate NPTL/non versions of vfork
- From: Richard Henderson <rth at twiddle dot net>
- To: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>, libc-alpha at sourceware dot org
- Date: Fri, 23 May 2014 11:46:27 -0700
- Subject: Re: [PATCH 1/5] PowerPC: Consolidate NPTL/non versions of vfork
- Authentication-results: sourceware.org; auth=none
- References: <537F4C7E dot 4020005 at linux dot vnet dot ibm dot com> <537F939A dot 8080002 at twiddle dot net> <537F9680 dot 9070308 at linux dot vnet dot ibm dot com>
On 05/23/2014 11:42 AM, Adhemerval Zanella wrote:
> On 23-05-2014 15:29, Richard Henderson wrote:
>> On 05/23/2014 06:26 AM, Adhemerval Zanella wrote:
>>> + /* Load the TCB-cached PID value and negates it. If It it is zero
>>> + sets it to 0x800000. And then sets its value again on TCB field.
>>> + See raise.c for the logic that relies on this value. */
>>> + lwz r0,PID(r13)
>>> + cmpwi cr0,r0,0
>>> + neg r0,r0
>>> + bne- cr0,1f
>>> + lis r0,0x8000
>>> +1: stw r0,PID(r13)
>> I was thinking about this when I did the alpha port:
>> Why don't we use ~pid instead of -pid? That way we still get high-bit set
>> semantics, but don't have to special-case 0, and so don't need a branch here
>> (or a conditional move on other hosts)?
>> There is a tiny matter of updating all of the architectures all at once though...
> I don't see why not, however I think such change would be better suited for a following
> patch. Also, do you see this code sequence as a hotspot for such optimization?
Of course a following patch, and of course it's not a hotspot.
It just seems like an oddity that could be done better.