History log of /llvm-project/flang/lib/Evaluate/intrinsics-library.cpp (Results 1 – 25 of 25)
Revision Date Author Comments
# 71d4f343 12-Nov-2024 Kelvin Li <kkwli@users.noreply.github.com>

[flang] Use libm routine for compile-time folding on AIX (#114106)

On AIX, the implementation of `std::sqrt` is different from that of
`csqrtf`, it leads to different results in compile-time foldin

[flang] Use libm routine for compile-time folding on AIX (#114106)

On AIX, the implementation of `std::sqrt` is different from that of
`csqrtf`, it leads to different results in compile-time folding and
runtime evaluation. This patch is to make the routine calls using
the same implementation.

show more ...


# 91b5bef3 16-Oct-2024 David Truby <david.truby@arm.com>

[flang] Tighten requirements on some glibc float128 functions (#110651)

j0l, j1l, jnl, y0l, y1l and ynl are glibc extensions rather than
standard POSIX functions, and so are not available in every

[flang] Tighten requirements on some glibc float128 functions (#110651)

j0l, j1l, jnl, y0l, y1l and ynl are glibc extensions rather than
standard POSIX functions, and so are not available in every Linux libc.
This patch checks if `__GLIBC__` and `_GNU_SOURCE` are defined before
using
these functions.

This patch allows the float128 runtime to build with musl libc on Linux.

show more ...


# 38b9dd7a 15-Oct-2024 Peter Klausler <pklausler@nvidia.com>

[flang] Fold ERFC_SCALED (#112287)

Move the ErfcScaled template function from the runtime into a new header
file in flang/include/Common, then use it in constant folding to
implement folding for t

[flang] Fold ERFC_SCALED (#112287)

Move the ErfcScaled template function from the runtime into a new header
file in flang/include/Common, then use it in constant folding to
implement folding for the erfc_scaled() intrinsic function.

show more ...


# fc51c7f0 19-Sep-2024 Slava Zakharin <szakharin@nvidia.com>

[flang][runtime] Disable LDBL_MANT_DIG == 113 for the offload builds. (#109339)

When compiling on aarch64 some `LDBL_MANT_DIG == 113` entries
end up trying to use `complex<long double>` for which t

[flang][runtime] Disable LDBL_MANT_DIG == 113 for the offload builds. (#109339)

When compiling on aarch64 some `LDBL_MANT_DIG == 113` entries
end up trying to use `complex<long double>` for which there are
no certain specializations in `libcudacxx`. This change-set
includes a clean-up for `LDBL_MANT_DIG == 113` usage, which is replaced
with `HAS_LDBL128` that is set in `float128.h`.

show more ...


# 4a10b4c0 30-Aug-2024 jeanPerier <jperier@nvidia.com>

[flang] fix flang builds with clang 20 after #100692 (#106718)

#100692 changes clang template deduction, and an error was now emitted
when building flang with top of the tree clang when mapping std

[flang] fix flang builds with clang 20 after #100692 (#106718)

#100692 changes clang template deduction, and an error was now emitted
when building flang with top of the tree clang when mapping std::pow in
intrinsics-library.cpp for constant folding `error: address of
overloaded function 'pow' is ambiguous`

See https://lab.llvm.org/buildbot/#/builders/4/builds/1670

I I am not expert enough to understand if the new error is justified or
not here, but it is easy to help the compiler here with explicit
wrappers to fix the builds.

show more ...


# bf5a2a99 02-Jul-2024 Pete Steinfeld <47540744+psteinfeld@users.noreply.github.com>

[flang] Fix build problem caused by #96807 (#97450)

I had erroneously used a bitwise '&' with boolean operands which caused
a warning on the ARM build. This change fixes that.


# 70969df7 02-Jul-2024 Pete Steinfeld <47540744+psteinfeld@users.noreply.github.com>

[flang] Improve warnings for invalid arguments when folding host runtime (#96807)

This is another attempt at a change that Jean made to Phabricator in
https://reviews.llvm.org/D116934. That attempt

[flang] Improve warnings for invalid arguments when folding host runtime (#96807)

This is another attempt at a change that Jean made to Phabricator in
https://reviews.llvm.org/D116934. That attempt ran into problems with
building on Windows.

This change improves the messages that are produced when running into
invalid arguments during constant folding.

Note that the original attempt at implementing this contained additional
code in .../llvm-project/flang/test/Evaluate/folding04.f90:
```
!WARN: warning: argument 'x' must be strictly positive
real(8), parameter :: nan_r8_dlog1 = dlog(-0.1_8)
TEST_ISNAN(nan_r8_dlog1)
```
For reasons I don't understand, this additional code caused the Windows
build to fail. So this new version of the update does not contain that
code.

show more ...


# 3149c934 11-Mar-2024 Leandro Lupori <leandro.lupori@linaro.org>

[flang] Fix Darwin build after 4762c6557d15 (#84478)

Select POSIX 2008 standard to avoid including Darwin extensions.
Otherwise, Darwin's math.h header defines HUGE, which conflicts
with Flang's H

[flang] Fix Darwin build after 4762c6557d15 (#84478)

Select POSIX 2008 standard to avoid including Darwin extensions.
Otherwise, Darwin's math.h header defines HUGE, which conflicts
with Flang's HUGE function.

This started happening after 4762c6557d15 (#82443), that added the
"utility" include, which seems to include "math.h".

show more ...


# 4cb1d914 09-Jan-2024 jeanPerier <jperier@nvidia.com>

[flang] add folding support for quad bessels (#77314)

This is done using libquadmath and the mappings are only available if
libquadmath was found by cmake.
Support for non quad bessels is already

[flang] add folding support for quad bessels (#77314)

This is done using libquadmath and the mappings are only available if
libquadmath was found by cmake.
Support for non quad bessels is already available on POSIX platform
using libm extensions.

show more ...


# 478e0b58 17-Jul-2023 Peter Steinfeld <psteinfeld@nvidia.com>

[flang] Quadmath 128 bit floating point intrinsics

This update allows constant folding for many 128 bit floating point intrinsics
through the library quadmath, which is only available on some platfo

[flang] Quadmath 128 bit floating point intrinsics

This update allows constant folding for many 128 bit floating point intrinsics
through the library quadmath, which is only available on some platforms.

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

show more ...


# 9aae408d 11-Mar-2023 Yuanfang Chen <yuanfang.chen@sony.com>

[NFC] fix typo `funciton` -> `function`

credits to @jmagee


# 0c08418d 22-Nov-2022 Kelvin Li <kli@ca.ibm.com>

[Flang] Removing Float Bessel functions for AIX

AIX libc only provides bessel functions j0,j1,jn and y0,y1,yn but
does not have their float equivalents j0f,j1f,jnf and y0f,y1f,ynf.

Committed on beh

[Flang] Removing Float Bessel functions for AIX

AIX libc only provides bessel functions j0,j1,jn and y0,y1,yn but
does not have their float equivalents j0f,j1f,jnf and y0f,y1f,ynf.

Committed on behalf of madanial

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

show more ...


# 23c2bedf 01-Jul-2022 Peter Klausler <pklausler@nvidia.com>

[flang] Establish a single source of target information for semantics

Create a TargetCharacteristics class to centralize the few items of
target specific information that are relevant to semantics.

[flang] Establish a single source of target information for semantics

Create a TargetCharacteristics class to centralize the few items of
target specific information that are relevant to semantics. Use the
new class for all target queries, including derived type component layout
modeling.

Future work will initialize this class with target information
provided or forwarded by the drivers, and use it to fold layout-dependent
intrinsic functions like TRANSFER().

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

Updates: Attempts to work around build issues on Windows.

show more ...


# 4daa33f6 31-May-2022 Peter Klausler <pklausler@nvidia.com>

[flang][runtime] Use __float128 where possible & needed in runtime

On targets with __float128 available and distinct from long double,
use it to support more kind=16 entry points. This affects most

[flang][runtime] Use __float128 where possible & needed in runtime

On targets with __float128 available and distinct from long double,
use it to support more kind=16 entry points. This affects mostly
x86-64 targets. This means that more runtime entry points are
defined for lowering to call.

Delete Common/long-double.h and its LONG_DOUBLE macro in favor of
testing the standard macro LDBL_MANT_DIG.

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

show more ...


# 71728360 05-May-2022 Peter Klausler <pklausler@nvidia.com>

[flang] Fold real-valued MODULO() and MOD()

Evaluate real-valued references to the intrinsic functions MODULO
and MOD at compilation time without recourse to an external math
library.

Differential

[flang] Fold real-valued MODULO() and MOD()

Evaluate real-valued references to the intrinsic functions MODULO
and MOD at compilation time without recourse to an external math
library.

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

show more ...


# e1836123 26-Apr-2022 Peter Klausler <pklausler@nvidia.com>

[flang] Get ppc64le build bot back up

A recent change assumed that the native C++ "long double" maps to
a Fortran data type; but this turns out to not be true for ppc64le,
which uses "double-double"

[flang] Get ppc64le build bot back up

A recent change assumed that the native C++ "long double" maps to
a Fortran data type; but this turns out to not be true for ppc64le,
which uses "double-double" for "long double".

This is a quick patch to get the ppc64le flang build bot back up.
A better fix that either uses HostTypeExists<> or replaces "long double"
with "ieee128_t" (or some other solution) is expected to follow soon.

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

show more ...


# 6c81b4a0 22-Apr-2022 Jean Perier <jperier@nvidia.com>

[flang] Fold transformational bessels when host runtime has bessels

Transformational bessel intrinsic functions require the same math runtime
as elemental bessel intrinsics.

Currently elemental bes

[flang] Fold transformational bessels when host runtime has bessels

Transformational bessel intrinsic functions require the same math runtime
as elemental bessel intrinsics.

Currently elemental bessels could be folded if f18 was linked with pgmath
(cmake -DLIBPGMATH_DIR option). `j0`, `y0`, ... C libm functions were not
used because they are not standard C functions: they are Posix
extensions.

This patch enable:
- Using the Posix bessel host runtime functions when available.
- folding the transformational bessel using the elemental version.

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

show more ...


# d393ce3b 05-Jan-2022 Peter Klausler <pklausler@nvidia.com>

[flang] Support extension intrinsic function variations on ABS

Accept the legacy specific intrinsic names BABS, IIABS, JIABS,
KIABS, and ZABS as well.

Differential Revision: https://reviews.llvm.or

[flang] Support extension intrinsic function variations on ABS

Accept the legacy specific intrinsic names BABS, IIABS, JIABS,
KIABS, and ZABS as well.

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

show more ...


# c9e9635f 30-Aug-2021 peter klausler <pklausler@nvidia.com>

[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().

Different

[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

show more ...


# 830c0b90 01-Sep-2021 Peter Klausler <pklausler@nvidia.com>

[flang] Move runtime API headers to flang/include/flang/Runtime

Move the closure of the subset of flang/runtime/*.h header files that
are referenced by source files outside flang/runtime (apart from

[flang] Move runtime API headers to flang/include/flang/Runtime

Move the closure of the subset of flang/runtime/*.h header files that
are referenced by source files outside flang/runtime (apart from unit tests)
into a new directory (flang/include/flang/Runtime) so that relative
include paths into ../runtime need not be used.

flang/runtime/pgmath.h.inc is moved to flang/include/flang/Evaluate;
it's not used by the runtime.

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

show more ...


# 94d9a4fd 14-Oct-2020 Jean Perier <jperier@nvidia.com>

[flang] Rework host runtime folding and enable REAL(2) folding with it.

- Rework the host runtime table so that it is constexpr to avoid
having to construct it and to store/propagate it.
- Make th

[flang] Rework host runtime folding and enable REAL(2) folding with it.

- Rework the host runtime table so that it is constexpr to avoid
having to construct it and to store/propagate it.
- Make the interface simpler (remove many templates and a file)
- Enable 16bits float folding using 32bits float host runtime
- Move StaticMultimapView into its own header to use it for host
folding

Reviewed By: klausler, PeteSteinfeld

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

show more ...


# 7cd1b0ff 09-Jul-2020 Eric Schweitz <eschweitz@nvidia.com>

[flang] partially revert upstreamed code to support complex values in runtime support to avoid warnings.


# eb305631 03-Jul-2020 Jean Perier <jperier@nvidia.com>

[flang][NFC] Move and rework pgmath description used in folding

This change prepares usage of lipgmath description in lowering.
- Removes the static variable templates that were used to abstract
l

[flang][NFC] Move and rework pgmath description used in folding

This change prepares usage of lipgmath description in lowering.
- Removes the static variable templates that were used to abstract
libpgmath description
- Move the description to pgmath.h.inc header and rework the macros
so that they can both be used to declare pgmath functions and use
them.
The way they are to be used is left to pgmath.h.inc user that
must define PGMATH_USE_XX macros that will be called for all pgmath
functions in pgmath.h.inc.
- In intrinsic-library.cpp define PGMATH_USE_XX macro callbacks in
order to capture function pointers to pgmath functions as well as
a description of their type. This will be used for constant folding
using pgmath.
- Change atan/atan2 handling to use atan2 instead of atan when there are two
arguments because it is easier to handle in the runtime description.

Also fixes lipgmath linking regression after D78215 cmake changes.

This change is motivated by the need to use a similar pgmath
description in lowering. The difference is that no function pointers will
be taken there, and instead only the function name and type are needed.

Reviewed By: schweitz, sscalpone

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

show more ...


# 1f879005 29-Mar-2020 Tim Keith <tkeith@nvidia.com>

[flang] Reformat with latest clang-format and .clang-format

Original-commit: flang-compiler/f18@9fe84f45d7fd685051004678d6b5775dcc4c6f8f
Reviewed-on: https://github.com/flang-compiler/f18/pull/1094


# 64ab3302 25-Feb-2020 CarolineConcatto <51754594+CarolineConcatto@users.noreply.github.com>

[flang] [LLVMify F18] Compiler module folders should have capitalised names (flang-compiler/f18#980)

This patch renames the modules in f18 to use a capital letter in the
module name

Signed-off-b

[flang] [LLVMify F18] Compiler module folders should have capitalised names (flang-compiler/f18#980)

This patch renames the modules in f18 to use a capital letter in the
module name

Signed-off-by: Caroline Concatto <caroline.concatto@arm.com>

Original-commit: flang-compiler/f18@d2eb7a1c443d1539ef12b6f027074a0eb15b1ea0
Reviewed-on: https://github.com/flang-compiler/f18/pull/980

show more ...