diff options
author | David Truby <david.truby@arm.com> | 2024-06-25 01:24:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-25 01:24:49 +0100 |
commit | 954b692bd74b4e7571bb4a8045f4b488d504a6ba (patch) | |
tree | 8f062e5f99af0b658506148ffefebf0107fa5cae | |
parent | a2d340ba161fe48ee4ff736c6e7877038a7388cd (diff) | |
download | llvm-954b692bd74b4e7571bb4a8045f4b488d504a6ba.zip llvm-954b692bd74b4e7571bb4a8045f4b488d504a6ba.tar.gz llvm-954b692bd74b4e7571bb4a8045f4b488d504a6ba.tar.bz2 |
[flang] Allow derf as alternate spelling for erf (#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.
-rw-r--r-- | flang/lib/Evaluate/intrinsics.cpp | 1 | ||||
-rw-r--r-- | flang/unittests/Evaluate/intrinsics.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/flang/lib/Evaluate/intrinsics.cpp b/flang/lib/Evaluate/intrinsics.cpp index 2733f99..80752d0 100644 --- a/flang/lib/Evaluate/intrinsics.cpp +++ b/flang/lib/Evaluate/intrinsics.cpp @@ -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}}, diff --git a/flang/unittests/Evaluate/intrinsics.cpp b/flang/unittests/Evaluate/intrinsics.cpp index 0bbc7fe..86c471d 100644 --- a/flang/unittests/Evaluate/intrinsics.cpp +++ b/flang/unittests/Evaluate/intrinsics.cpp @@ -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"); |