[cfe-dev] CGBuiltin.cpp?

reed kotler rkotler at mips.com
Mon Feb 9 15:36:50 PST 2015


You want me to submit the patches for these changes?

It would be nice to clean up this module.

There are probably dejagnu tests worth porting to llvm test suite for 
this too.

My manager gave me approval to work on it.

On 02/08/2015 11:02 AM, Eric Christopher wrote:
>
>
> On Sun Feb 08 2015 at 9:57:05 AM Reid Kleckner <rnk at google.com 
> <mailto: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 <mailto: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
>         <mailto: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 <mailto: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 <mailto: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/20150209/8d9681b3/attachment.html>


More information about the cfe-dev mailing list