This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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, i386]: Implement PR 71246, Missing built-in functions for float128 NaNs


On Mon, Jun 13, 2016 at 10:01 AM, Richard Biener <rguenther@suse.de> wrote:
> On Fri, 10 Jun 2016, Uros Bizjak wrote:
>
>> Hello!
>>
>> Attached patch implements __builtin_nanq and __builtin_nansq
>> __float128 functions.
>>
>> 2016-06-10  Uros Bizjak  <ubizjak@gmail.com>
>>
>>     PR target/71241
>>     * config/i386/i386.i386-builtin-types.def (CONST_STRING):
>>     New primitive type.
>>     (FLOAT128_FTYPE_CONST_STRING): New function type.
>>     * config/i386/i386.c (enum ix86_builtins) [IX86_BUILTIN_NANQ]: New.
>>     [IX86_BUILTIN_NANSQ]: Ditto.
>>     (ix86_fold_builtin): Handle IX86_BUILTIN_NANQ and IX86_BUILTIN_NANSQ.
>>     (ix86_init_builtin_types) Declare const_string_type_node.
>>     Add __builtin_nanq and __builtin_nansq builtin functions.
>>     (ix86_expand_builtin): Handle IX86_BUILTIN_NANQ and IX86_BUILTIN_NANSQ.
>>     * doc/extend.texi (x86 Built-in Functions): Document
>>     __builtin_nanq and __builtin_nansq.
>>
>> Patch was bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.
>>
>> Joseph, does it look OK to you? Richi, I hope I got tree stuff
>> implemented correctly.
>
> Hmm, as we already have BUILT_IN_NAN[S] why not add NAN128 and NANS128
> variants in the middle-end as we already have NAND128 (for decimal float
> 128)?
>
> I don't see why we need target specific builtins for this given you
> simply use middle-end functionality to construct the result.

This goes together with __builtin_infq. These functions are not
standardized yet, so we have to resort to target-dependent semi-hacks.
Once _f128 functions are standardized, this functionality can be moved
to the middle end as a generic expander.

Uros.


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