[flang] evaluate: Fold SQRT, HYPOT, & CABS
authorpeter klausler <pklausler@nvidia.com>
Mon, 30 Aug 2021 16:36:33 +0000 (09:36 -0700)
committerpeter klausler <pklausler@nvidia.com>
Tue, 7 Sep 2021 17:33:11 +0000 (10:33 -0700)
commitc9e9635ffef781c32a839a77d122d7930edfc9b2
tree29e8abeaa97248a500bf3a4f6731725afecf630a
parentea04bf302cf8f32bef62208e123d9d0cb99fa55c
[flang] evaluate: Fold SQRT, HYPOT, & CABS

Implement IEEE Real::SQRT() operation, then use it to
also implement Real::HYPOT(), which can then be used directly
to implement Complex::ABS().

Differential Revision: https://reviews.llvm.org/D109250
flang/include/flang/Evaluate/complex.h
flang/include/flang/Evaluate/real.h
flang/lib/Evaluate/fold-real.cpp
flang/lib/Evaluate/intrinsics-library.cpp
flang/lib/Evaluate/real.cpp
flang/test/Evaluate/folding28.f90 [new file with mode: 0644]