This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v3 7/7] powerpc64le: Enable float128

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);

Why do you think that isn't the symbol we're using?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]