[Flang] Lower the exp, log, log10 intrinsics
authorKiran Chandramohan <kiran.chandramohan@arm.com>
Tue, 22 Mar 2022 14:04:02 +0000 (14:04 +0000)
committerKiran Chandramohan <kiran.chandramohan@arm.com>
Tue, 22 Mar 2022 14:04:27 +0000 (14:04 +0000)
commitdb925d08dedbfcf4b329358c84e6bbc35c0cb85c
tree2bfbdeb70e9b0f7ea1d7e1c76035d0be8a1b86e1
parent73c0d05e6a90612399de06a98201e9d6a9059797
[Flang] Lower the exp, log, log10 intrinsics

The intrinsic computes the exponent, log real and complex numbers and
log10 for real numbers. By default they are lowered to runtime calls to
libpgmath. kind=10 and 16 are not supported. With the llvm option, it
can be lowered to llvm intrinsics (not all types .eg. complex are
supported for llvm lowering).

This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D122132

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: William S Moses <gh@wsmoses.com>
flang/lib/Lower/IntrinsicCall.cpp
flang/test/Lower/Intrinsics/exp.f90 [new file with mode: 0644]
flang/test/Lower/Intrinsics/log.f90 [new file with mode: 0644]
flang/test/Lower/llvm-math.f90