This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] powerpc: New feature - HWCAP/HWCAP2 bits in the TCB
- From: Carlos Eduardo Seo <cseo at linux dot vnet dot ibm dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 09 Jun 2015 11:56:35 -0300
- Subject: Re: [PATCH] powerpc: New feature - HWCAP/HWCAP2 bits in the TCB
- Authentication-results: sourceware.org; auth=none
- References: <55760314 dot 6070601 at linux dot vnet dot ibm dot com> <5576F6B8 dot 4020109 at linaro dot org>
On 06/09/2015 11:22 AM, Adhemerval Zanella wrote:
>
>> @@ -203,6 +214,32 @@ register void *__thread_register __asm__
>> # define THREAD_SET_TM_CAPABLE(value) \
>> (THREAD_GET_TM_CAPABLE () = (value))
>>
>> +/* hwcap & hwcap2 fields in TCB head. */
>> +# define THREAD_GET_HWCAP() \
>> + (((tcbhead_t *) ((char *) __thread_register \
>> + - TLS_TCB_OFFSET))[-1].hwcap)
>> +# define THREAD_SET_HWCAP(value) \
>> + if (value & PPC_FEATURE_ARCH_2_06) \
>> + value |= PPC_FEATURE_ARCH_2_05 | \
>> + PPC_FEATURE_POWER5_PLUS | \
>> + PPC_FEATURE_POWER5 | \
>> + PPC_FEATURE_POWER4; \
>> + else if (value & PPC_FEATURE_ARCH_2_05) \
>> + value |= PPC_FEATURE_POWER5_PLUS | \
>> + PPC_FEATURE_POWER5 | \
>> + PPC_FEATURE_POWER4; \
>> + else if (value & PPC_FEATURE_POWER5_PLUS) \
>> + value |= PPC_FEATURE_POWER5 | \
>> + PPC_FEATURE_POWER4; \
>> + else if (value & PPC_FEATURE_POWER5) \
>> + value |= PPC_FEATURE_POWER4; \
>
> This very logic is already presented at other powerpc32 sysdep file [1].
> Instead of duplicate the logic, I think it is better to move it in a common
> file.
>
> [1] sysdeps/powerpc/powerpc32/power4/multiarch/init-arch.h
>
So, do you suggest a cleanup patch first to move this to a common file, then a rewrite of this patch on top of that? If so, in which header should I put that?
Thanks,
Carlos Eduardo Seo
Software Engineer - Linux on Power Toolchain
cseo@linux.vnet.ibm.com