[flang-commits] [flang] 5661317 - [flang] Put intrinsic function table back into order
peter klausler via flang-commits
flang-commits at lists.llvm.org
Mon Sep 20 08:40:36 PDT 2021
Author: peter klausler
Date: 2021-09-20T08:40:28-07:00
New Revision: 5661317f864abf750cf893c6a4cc7a977be0995a
URL: https://github.com/llvm/llvm-project/commit/5661317f864abf750cf893c6a4cc7a977be0995a
DIFF: https://github.com/llvm/llvm-project/commit/5661317f864abf750cf893c6a4cc7a977be0995a.diff
LOG: [flang] Put intrinsic function table back into order
Some intrinsic functions weren't findable because the table
wasn't strictly in order of names.
And complete a missing generalization of the extension DCONJG
to accept any kind of complex argument, like DREAL and DIMAG
were.
Differential Revision: https://reviews.llvm.org/D110002
Added:
Modified:
flang/lib/Evaluate/intrinsics.cpp
flang/unittests/Evaluate/intrinsics.cpp
Removed:
################################################################################
diff --git a/flang/lib/Evaluate/intrinsics.cpp b/flang/lib/Evaluate/intrinsics.cpp
index 949c7c2cc170..9ba5c04300b8 100644
--- a/flang/lib/Evaluate/intrinsics.cpp
+++ b/flang/lib/Evaluate/intrinsics.cpp
@@ -936,18 +936,16 @@ static const SpecificIntrinsicInterface specificIntrinsicFunction[]{
{"y", AnyIntOrReal, Rank::elementalOrBOZ, Optionality::optional}},
DoublePrecisionComplex},
"cmplx", true},
- {{"dfloat", {{"i", AnyInt}}, DoublePrecision}, "real", true},
- {{"dreal", {{"a", AnyComplex}}, DoublePrecision}, "real", true},
- {{"dconjg", {{"a", DoublePrecisionComplex}}, DoublePrecisionComplex},
- "conjg"},
+ {{"dconjg", {{"a", AnyComplex}}, DoublePrecisionComplex}, "conjg"},
{{"dcos", {{"x", DoublePrecision}}, DoublePrecision}, "cos"},
{{"dcosh", {{"x", DoublePrecision}}, DoublePrecision}, "cosh"},
{{"ddim", {{"x", DoublePrecision}, {"y", DoublePrecision}},
DoublePrecision},
"dim"},
- {{"dimag", {{"a", DoublePrecisionComplex}}, DoublePrecision}, "aimag"},
{{"dexp", {{"x", DoublePrecision}}, DoublePrecision}, "exp"},
+ {{"dfloat", {{"i", AnyInt}}, DoublePrecision}, "real", true},
{{"dim", {{"x", DefaultReal}, {"y", DefaultReal}}, DefaultReal}},
+ {{"dimag", {{"a", AnyComplex}}, DoublePrecision}, "aimag"},
{{"dint", {{"a", DoublePrecision}}, DoublePrecision}, "aint"},
{{"dlog", {{"x", DoublePrecision}}, DoublePrecision}, "log"},
{{"dlog10", {{"x", DoublePrecision}}, DoublePrecision}, "log10"},
@@ -966,6 +964,7 @@ static const SpecificIntrinsicInterface specificIntrinsicFunction[]{
"mod"},
{{"dnint", {{"a", DoublePrecision}}, DoublePrecision}, "anint"},
{{"dprod", {{"x", DefaultReal}, {"y", DefaultReal}}, DoublePrecision}},
+ {{"dreal", {{"a", AnyComplex}}, DoublePrecision}, "real", true},
{{"dsign", {{"a", DoublePrecision}, {"b", DoublePrecision}},
DoublePrecision},
"sign"},
diff --git a/flang/unittests/Evaluate/intrinsics.cpp b/flang/unittests/Evaluate/intrinsics.cpp
index a36dbf581822..dd1a8a5a8f0e 100644
--- a/flang/unittests/Evaluate/intrinsics.cpp
+++ b/flang/unittests/Evaluate/intrinsics.cpp
@@ -237,7 +237,9 @@ void TestIntrinsics() {
TestCall{defaults, table, "conjg"}
.Push(Const(Scalar<Complex8>{}))
.DoCall(Complex8::GetType());
- TestCall{defaults, table, "dconjg"}.Push(Const(Scalar<Complex4>{})).DoCall();
+ TestCall{defaults, table, "dconjg"}
+ .Push(Const(Scalar<Complex4>{}))
+ .DoCall(Complex8::GetType());
TestCall{defaults, table, "dconjg"}
.Push(Const(Scalar<Complex8>{}))
.DoCall(Complex8::GetType());
More information about the flang-commits
mailing list