Skip to content

Commit

Permalink
[flang] Allow derf as alternate spelling for erf (llvm#95784)
Browse files Browse the repository at this point in the history
This patch adds derf as an alternate spelling for the erf intrinsic.
This spelling is supported by multiple other compilers and used by WRF.
  • Loading branch information
DavidTruby authored and AlexisPerry committed Jun 27, 2024
1 parent a3bb35a commit 0042528
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions flang/lib/Evaluate/intrinsics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,7 @@ static const SpecificIntrinsicInterface specificIntrinsicFunction[]{
{{"ddim", {{"x", DoublePrecision}, {"y", DoublePrecision}},
DoublePrecision},
"dim"},
{{"derf", {{"x", DoublePrecision}}, DoublePrecision}, "erf"},
{{"dexp", {{"x", DoublePrecision}}, DoublePrecision}, "exp"},
{{"dfloat", {{"a", AnyInt}}, DoublePrecision}, "real", true},
{{"dim", {{"x", DefaultReal}, {"y", DefaultReal}}, DefaultReal}},
Expand Down
1 change: 1 addition & 0 deletions flang/unittests/Evaluate/intrinsics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ void TestIntrinsics() {
TEST(table.GetGenericIntrinsicName("dcos") == "cos");
TEST(table.GetGenericIntrinsicName("dcosh") == "cosh");
TEST(table.GetGenericIntrinsicName("ddim") == "dim");
TEST(table.GetGenericIntrinsicName("derf") == "erf");
TEST(table.GetGenericIntrinsicName("dexp") == "exp");
TEST(table.GetGenericIntrinsicName("dint") == "aint");
TEST(table.GetGenericIntrinsicName("dlog") == "log");
Expand Down

0 comments on commit 0042528

Please sign in to comment.