[LLVMdev] Other Intrinsics?

Zack Rusin zack at tungstengraphics.com
Wed Nov 28 02:10:01 PST 2007


On Tuesday 27 November 2007 06:01:34 pm Chris Lattner wrote:
> > The main reason for adding intrinsics instead of just using C library
> > calls is for support for vector types. @llvm.sin.* can be overloaded as
> > @llvm.sin.v4f32, for example, which is very useful for some users.
>
> My question is "how can these be used" by people.  Specifically, these
> need to be lowered to some sort of runtime calls (no hardware has support
> for these) and llvm doesn't provide a standard runtime yet.  Unless the
> codegen has a way to lower these, it seems strange to add them as
> intrinsics.  IOW, if llvm.sin.v4f32 ends up being 4 calls to sinf, why not
> encode 4 calls to sinf in the bytecode?

Some of the hardware that we target has extensive support for these. Granted 
that instead of overloading llvm.sin and others for my vectors it'd be nicer 
to just have llvm.sin that accepts arbitrary vectors but it's still useful. 
Of course we could also do regexp matching for multiple sinf's in a row that 
operate on the same vector to code-gen something meaningful but with 
intrinsics outputting and visually inspecting the IR before feeding it to 
code-gen gives one a better idea of what's supposed to happen.

z



More information about the llvm-dev mailing list