Skip to content

Commit

Permalink
add erfinv (#2182)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored Dec 4, 2024
1 parent 7b97a9b commit 06367e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions enzyme/Enzyme/InstructionDerivatives.td
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,15 @@ def : CallPattern<(Op $x),
[ReadNone, NoUnwind]
>;

def : CallPattern<(Op $x),
["erfinv","erfinvf","erfinfvl", "__nv_erfinv","__nv_erfinvf","__nv_erfinfvl", ],
[
(FMul (FMul (ConstantFP<"0.8862269254527580136490837416705725913987747280611935641069038949264556422955160906874753283692723327"> $x), (FMul (Call<(SameFunc), [ReadNone, NoUnwind]> $x):$ei, $ei)), (DiffeRet))
],
(ForwardFromSummedReverse),
[ReadNone, NoUnwind]
>;

def ToStruct2 : SubRoutine<(Op (Op $re, $im):$z),
(RetMultiReturnRet $re, $im)
>;
Expand Down
1 change: 1 addition & 0 deletions enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ const llvm::StringMap<llvm::Intrinsic::ID> LIBM_FUNCTIONS = {
{"erf", Intrinsic::not_intrinsic},
{"erfi", Intrinsic::not_intrinsic},
{"erfc", Intrinsic::not_intrinsic},
{"erfinv", Intrinsic::not_intrinsic},

{"__fd_sincos_1", Intrinsic::not_intrinsic},
{"sincospi", Intrinsic::not_intrinsic},
Expand Down

0 comments on commit 06367e4

Please sign in to comment.