Skip to content

Commit 954b692

Browse files
authored
[flang] Allow derf as alternate spelling for erf (llvm#95784)
This patch adds derf as an alternate spelling for the erf intrinsic. This spelling is supported by multiple other compilers and used by WRF.
1 parent a2d340b commit 954b692

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

flang/lib/Evaluate/intrinsics.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,7 @@ static const SpecificIntrinsicInterface specificIntrinsicFunction[]{
11131113
{{"ddim", {{"x", DoublePrecision}, {"y", DoublePrecision}},
11141114
DoublePrecision},
11151115
"dim"},
1116+
{{"derf", {{"x", DoublePrecision}}, DoublePrecision}, "erf"},
11161117
{{"dexp", {{"x", DoublePrecision}}, DoublePrecision}, "exp"},
11171118
{{"dfloat", {{"a", AnyInt}}, DoublePrecision}, "real", true},
11181119
{{"dim", {{"x", DefaultReal}, {"y", DefaultReal}}, DefaultReal}},

flang/unittests/Evaluate/intrinsics.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ void TestIntrinsics() {
344344
TEST(table.GetGenericIntrinsicName("dcos") == "cos");
345345
TEST(table.GetGenericIntrinsicName("dcosh") == "cosh");
346346
TEST(table.GetGenericIntrinsicName("ddim") == "dim");
347+
TEST(table.GetGenericIntrinsicName("derf") == "erf");
347348
TEST(table.GetGenericIntrinsicName("dexp") == "exp");
348349
TEST(table.GetGenericIntrinsicName("dint") == "aint");
349350
TEST(table.GetGenericIntrinsicName("dlog") == "log");

0 commit comments

Comments
 (0)