[Flang] Lower atan, sinh, cosh intrinsics
authorKiran Chandramohan <kiran.chandramohan@arm.com>
Wed, 23 Mar 2022 14:39:11 +0000 (14:39 +0000)
committerKiran Chandramohan <kiran.chandramohan@arm.com>
Wed, 23 Mar 2022 14:46:41 +0000 (14:46 +0000)
commit3d9485173556c4e52426bc18239c2fb423d43ac3
tree5ad306ff0411c52d309219d539fcd02bd1e5972f
parent30cb49b44e4e2af2e0627b2aa33df0ba57ab9e55
[Flang] Lower atan, sinh, cosh intrinsics

The intrinsic computes the tan and hyperbolic sin, cosine values. By
default they are lowered to runtime calls to the math library. Not all
types are supported currently. The generic and llvm lowering does not
lower floating point types with kind greater than 8, the llvm lowering
does not support the complex types.

Note: tanh is not present in fir-dev hence ignoring for now. We can add
support after upstreaming is complete. sin and cos will come in separate
patches since they have llvm intrinsic 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/D122264

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