[LLVMdev] FP Intrinsics

Morten Ofstad morten at hue.no
Fri Mar 11 02:33:22 PST 2005


I am trying to make the FP intrinsics (abs, sin, cos, sqrt) I've added 
work with the X86ISelPattern, but I'm having some difficulties 
understanding what needs to be done. I assume I have to add new 
nodetypes for the FP instructions to SelectionDAGNodes.h, and make nodes 
for these in SelectionDAGLowering::visitCall when I find the intrinsic...

The part I don't quite understand is what to do for targets that don't 
have these instructions (although I'm only interested in X86 myself, I 
would like to see these patches in the official LLVM version as it's 
some work to maintain them) -- for me it would make most sense to lower 
the intrinsic to a call if it's not supported. However I notice that for 
other intrinsics (memcpy etc.) this is done in LegalizeDAG where the 
node is expanded to a call if it's not directly supported for the target.

To illustrate what I have been doing so far I attach the diff to this 
mail -- if someone could have a look at it and tell me what needs to be 
done to get it working I would be very grateful... (Note that if you use 
the X86ISelSimple it's already working...)


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: temp.patch
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050311/ee9c30d4/attachment.ksh>

More information about the llvm-dev mailing list