This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v3 7/7] powerpc64le: Enable float128
On 27/06/17 22:41, Florian Weimer wrote:
> * Peter Bergner:
>
>> On 6/27/17 2:17 PM, Florian Weimer wrote:
>>> * Peter Bergner:
>>>> bergner@pike:~$ cat float128.c
>>>> int
>>>> float128 (void)
>>>> {
>>>> return __builtin_cpu_supports ("ieee128");
>>>> }
>>>> bergner@pike:~$ gcc -O2 -S float128.c
>>>> bergner@pike:~$ cat float128.s
>>>> [snip]
>>>> float128:
>>>> lwz 3,-28776(13)
>>>> rldicl 3,3,42,63
>>>> blr
>>>
>>> Nice. I guess the next question is: what would ensure that this code
>>> only runs on a glibc which sets up the TCB in the expected way? Is
>>> there a symbol reference which prevents that?
>>>
>>> __parse_hwcap_and_convert_at_platform isn't that symbol, as far as I
>>> can tell.
>>
>> Yes, we emit a symbol only defined by libcs that support this and
>> yes, __parse_hwcap_and_convert_at_platform is that symbol:
>>
>> if (cpu_builtin_p)
>> {
>> /* We have expanded a CPU builtin, so we need to emit a reference to
>> the special symbol that LIBC uses to declare it supports the
>> AT_PLATFORM and AT_HWCAP/AT_HWCAP2 in the TCB feature. */
>> switch_to_section (data_section);
>> fprintf (asm_out_file, "\t.align %u\n", TARGET_32BIT ? 2 : 3);
>> fprintf (asm_out_file, "\t%s %s\n",
>> TARGET_32BIT ? ".long" : ".quad", tcb_verification_symbol);
>> }
>
> I see, so everything is fine. Nice!
>
well using the new builtin means glibc build will fail with old gcc.