Skip to content

Commit 46acff1

Browse files
committed
fix ftanh
1 parent 970780b commit 46acff1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

llvm/lib/Target/NVPTX/NVPTXInstrInfo.td

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,19 @@ def TANH_APPROX_f16x2 :
12421242
[(set v2f16:$dst, (int_nvvm_tanh_approx_f16x2 v2f16:$src))]>,
12431243
Requires<[hasPTX<70>, hasSM<75>]>;
12441244

1245+
// Patterns for ftanh SDNode
1246+
def : Pat<(f32 (UnaryOpAllowsApproxFn<ftanh> f32:$src)),
1247+
(TANH_APPROX_f32 f32:$src)>,
1248+
Requires<[hasPTX<70>, hasSM<75>]>;
1249+
1250+
def : Pat<(f16 (UnaryOpAllowsApproxFn<ftanh> f16:$src)),
1251+
(TANH_APPROX_f16 f16:$src)>,
1252+
Requires<[hasPTX<70>, hasSM<75>]>;
1253+
1254+
def : Pat<(v2f16 (UnaryOpAllowsApproxFn<ftanh> v2f16:$src)),
1255+
(TANH_APPROX_f16x2 v2f16:$src)>,
1256+
Requires<[hasPTX<70>, hasSM<75>]>;
1257+
12451258
//-----------------------------------
12461259
// Bitwise operations
12471260
//-----------------------------------

0 commit comments

Comments
 (0)