[PATCH] D29942: Add custom lowering for llvm.log{, 10}.{f16, f32} intrinsics

Jan Vesely via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 20 09:59:09 PST 2017


jvesely added inline comments.


================
Comment at: lib/Target/AMDGPU/AMDGPUISelLowering.cpp:250
+  setOperationAction(ISD::FLOG10, MVT::v2f32, Expand);
+  setOperationAction(ISD::FLOG10, MVT::v4f32, Expand);
+
----------------
v2f32 and v4f32 can be moved to 
for (MVT VT : FloatVectorTypes) {
block  (line ~398)


================
Comment at: lib/Target/AMDGPU/AMDGPUISelLowering.cpp:1891
+
+  return DAG.getNode(ISD::FDIV, SL, VT, Log2Operand, Log2Base);
+}
----------------
Does FDIV have good enough precision to do this? OCL requires 2.5 ULP, and I'm not sure how good the EG/CM hw is.
libclc uses precomputed constants and multiplication, maybe the same can be applied here.


https://reviews.llvm.org/D29942





More information about the llvm-commits mailing list