[cfe-dev] CGBuiltin.cpp?

Eric Christopher echristo at gmail.com
Sun Feb 8 11:02:59 PST 2015


On Sun Feb 08 2015 at 9:57:05 AM Reid Kleckner <rnk at google.com> wrote:

> The question isn't about the Intel _mm_* intrinsics, it's about the C math
> builtins we provide under __builtin_pow, etc. I think most of them are
> mapped to their libc calls for convenience. Some have been added on an
> ad-hoc basis as needed.
>
>
Right. Same general principle :)


> I believe that GCC lowers most calls to __builtin_sqrt and such to
> instructions before library calls, so we can go ahead and map most of those
> down to LLVM intrinsics without worrying about things like errno. It's
> worth checking as you go, though, rather than blindly mapping everything to
> LLVM intrinsics.
>
>
Agreed.

-eric


> On Sat, Feb 7, 2015 at 9:29 PM, Eric Christopher <echristo at gmail.com>
> wrote:
>
>> The idea is that the builtins are wrapped by portable intrinsics (e.g.
>> _mm_* on x86) and therefore those should be used as an interface in
>> programming. If there's no suitable intrinsic then we'll expose the builtin.
>>
>> -eric
>>
>> On Fri Feb 06 2015 at 6:34:35 PM reed kotler <rkotler at mips.com> wrote:
>>
>>> Why is that many of the gcc builtins are not mapped to the llvm ir
>>> builtins, in cases
>>> where there is a corresponding llvm ir builtin/intrinsic.
>>>
>>> For example, sin, cos, log, log2, exp, exp2.....??
>>>
>>> Of the normal math functions is seems that just pow and fabs are there.
>>>
>>> Reed
>>> _______________________________________________
>>> cfe-dev mailing list
>>> cfe-dev at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>>
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150208/b4eda489/attachment.html>


More information about the cfe-dev mailing list