[PATCH] D80706: [DAGCombine] Add hook to allow target specific test for sqrt input
Qiu Chaofan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 10 22:14:06 PST 2020
qiucf added inline comments.
================
Comment at: llvm/include/llvm/CodeGen/TargetLowering.h:4274
+ /// result should be used as the condition operand for a select or branch.
+ virtual SDValue getSqrtInputTest(SDValue Operand, SelectionDAG &DAG,
+ const DenormalMode &Mode) const {
----------------
`testSqrtEstimate`?
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:21959
+ // Try the target specific test first.
+ SDValue Test = TLI.getSqrtInputTest(Op, DAG, DenormMode);
+ if (!Test) {
----------------
Will it be better if put logic below into base `getSqrtInputTest` implementation?
================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:12684-12691
+ // ftsqrt BF,FRB
+ // Let e_b be the unbiased exponent of the double-precision
+ // floating-point operand in register FRB.
+ // fe_flag is set to 1 if either of the following conditions occurs.
+ // - The double-precision floating-point operand in register FRB is a zero,
+ // a NaN, or an infinity, or a negative value.
+ // - e_b is less than or equal to -970.
----------------
================
Comment at: llvm/lib/Target/PowerPC/PPCInstrFormats.td:643
let FRA = 0;
+ let Pattern = pattern;
}
----------------
Typo: extra space
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80706/new/
https://reviews.llvm.org/D80706
More information about the llvm-commits
mailing list