[cfe-dev] CGBuiltin.cpp?

Reid Kleckner rnk at google.com
Sun Feb 8 09:57:05 PST 2015


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.

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.

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/d7086ed9/attachment.html>


More information about the cfe-dev mailing list