[LLVMdev] Other Intrinsics?

Jon Sargeant delta17 at cox.net
Tue Nov 27 09:50:03 PST 2007


 > > Do you have plans to add other intrinsics?  I'm curious as to why there
 > > is an llvm.sin intrinsic and an llvm.cos intrinsic, but no llvm.atan
 > > intrinsic.  Why is there an llvm.pow intrinsic but no llvm.log
 > > intrinsic?
 >
 > Intrinsics get added on demand.  Generally there has to be a good reason
 > to add them.  llvm.sin was implemented (for example) to allow generation
 > of code that uses vector sin operations.

What is the criteria for adding an intrinsic or a built-in operation?
For example, could the 'frem' instruction be an intrinsic?  Could you 
remove it from LLVM entirely and make it an external function?  What 
distinguishes 'frem' from 'sin', 'pow', 'atan2', etc.?

Regards,
Jon



More information about the llvm-dev mailing list