[flang-commits] [PATCH] D110002: [flang] Put intrinsic function table back into order
Peter Klausler via Phabricator via flang-commits
flang-commits at lists.llvm.org
Fri Sep 17 14:03:31 PDT 2021
klausler created this revision.
klausler added a reviewer: jeanPerier.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
klausler requested review of this revision.
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.
https://reviews.llvm.org/D110002
Files:
flang/lib/Evaluate/intrinsics.cpp
flang/unittests/Evaluate/intrinsics.cpp
Index: flang/unittests/Evaluate/intrinsics.cpp
===================================================================
--- flang/unittests/Evaluate/intrinsics.cpp
+++ flang/unittests/Evaluate/intrinsics.cpp
@@ -237,7 +237,9 @@
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());
Index: flang/lib/Evaluate/intrinsics.cpp
===================================================================
--- flang/lib/Evaluate/intrinsics.cpp
+++ flang/lib/Evaluate/intrinsics.cpp
@@ -936,18 +936,16 @@
{"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 @@
"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"},
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110002.373330.patch
Type: text/x-patch
Size: 2468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20210917/4973261f/attachment.bin>
More information about the flang-commits
mailing list