[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 Apr 24 08:27:00 PDT 2017
jvesely added inline comments.
================
Comment at: lib/Target/AMDGPU/AMDGPUISelLowering.cpp:1895
+SDValue AMDGPUTargetLowering::LowerFLOG(SDValue Op, SelectionDAG &DAG) const {
+ EVT VT = Op.getValueType();
----------------
You can pass the log2base constant here to avoid second switch and simplify the code. Just a nitpick
================
Comment at: lib/Target/AMDGPU/AMDGPUISelLowering.cpp:1914
+
+ return DAG.getNode(ISD::FDIV, SL, VT, Log2Operand, Log2Base);
+}
----------------
Using FMUL and inverted Log2Base should be both faster and more precise.
https://reviews.llvm.org/D29942
More information about the llvm-commits
mailing list