[PATCH] Refactor reciprocal and reciprocal square root estimate into target-independent functions (part 2).

Sanjay Patel spatel at rotateright.com
Fri Sep 26 14:09:35 PDT 2014


Instead of making different functions for each estimate possibility, I think it's better to make the getEstimate() interface in TargetLowering as generic as possible and let the targets do whatever they want under that. Eg, Altivec provides estimates for log() and exp(). These could conceivably be used to replace libm calls. GPUs might have instructions for those too.

As part of the minimization, I rolled the refinement steps parameter into the single API. Please let me know if you see a better or more elegant way.

http://reviews.llvm.org/D5484

Files:
  include/llvm/Target/TargetLowering.h
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  lib/Target/PowerPC/PPCISelLowering.cpp
  lib/Target/PowerPC/PPCISelLowering.h
  test/CodeGen/PowerPC/recipest.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5484.14136.patch
Type: text/x-patch
Size: 21543 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140926/cee47cbf/attachment.bin>


More information about the llvm-commits mailing list