Commit graph

342 commits

Author SHA1 Message Date
Jean Perier
db57831869 [flang] also fix accessor name
Original-commit: flang-compiler/f18@6ff8d22a57
Tree-same-pre-rewrite: false
2019-04-15 01:18:41 -07:00
Jean Perier
2aad0564cb [flang] address comment. Follow style guideline
Original-commit: flang-compiler/f18@60da44dc7d
Tree-same-pre-rewrite: false
2019-04-15 01:18:40 -07:00
Jean Perier
44e0c5084d [flang] Add software subnormal flusing around host library call for host arch that do not support it
Original-commit: flang-compiler/f18@04555f5359
Tree-same-pre-rewrite: false
2019-04-15 01:18:40 -07:00
peter klausler
ba2ef03a02 [flang] pass all tests
Original-commit: flang-compiler/f18@3cee1993a1
Reviewed-on: https://github.com/flang-compiler/f18/pull/406
Tree-same-pre-rewrite: false
2019-04-15 09:41:50 -07:00
Paul Osmialowski
ebd3759f64 [flang] AArch64: Set flushing mode for subnormals on glibc and bionic based systems
Signed-off-by: Paul Osmialowski <pawel.osmialowski@arm.com>

Original-commit: flang-compiler/f18@4881e3a91c
Reviewed-on: https://github.com/flang-compiler/f18/pull/397
2019-04-10 17:11:03 +01:00
Tim Keith
4ee3386c8f [flang] Clean up includes
indirection.h: Doesn't need ../common because it is in common.

expression.h: ../lib is the wrong path but the includes are needed.
They were probably coming in indirectly through other includes.

token-parsers.h: Include was not needed and parser shouldn't have
dependency on evaluate.

Original-commit: flang-compiler/f18@86f6b0023d
Reviewed-on: https://github.com/flang-compiler/f18/pull/405
2019-04-11 16:12:10 -07:00
peter klausler
4950dfa04e [flang] Redo without macros
Original-commit: flang-compiler/f18@8d955cfb3b
Reviewed-on: https://github.com/flang-compiler/f18/pull/390
2019-04-09 13:29:40 -07:00
peter klausler
8057a2ce32 [flang] Lots of debugging and refinement
Original-commit: flang-compiler/f18@1c3c30b540
Reviewed-on: https://github.com/flang-compiler/f18/pull/390
Tree-same-pre-rewrite: false
2019-04-08 16:16:55 -07:00
peter klausler
dc9c3d1c46 [flang] Fix bug#389, prevent std::move() on forwarded lvalue references
Original-commit: flang-compiler/f18@9d61c091ad
Reviewed-on: https://github.com/flang-compiler/f18/pull/390
Tree-same-pre-rewrite: false
2019-04-08 14:29:45 -07:00
peter klausler
94d0b8fb0a [flang] Address review comments
Original-commit: flang-compiler/f18@20cef2db45
Reviewed-on: https://github.com/flang-compiler/f18/pull/386
2019-04-05 15:19:13 -07:00
peter klausler
5c3197fa0b [flang] Fix implied DO folding with negative strides, add test
Original-commit: flang-compiler/f18@2e14b76041
Reviewed-on: https://github.com/flang-compiler/f18/pull/386
Tree-same-pre-rewrite: false
2019-04-05 12:58:19 -07:00
peter klausler
f0a19461ea [flang] Remove a needless Indirection
Original-commit: flang-compiler/f18@eb637232b1
Reviewed-on: https://github.com/flang-compiler/f18/pull/386
Tree-same-pre-rewrite: false
2019-04-05 12:56:13 -07:00
peter klausler
2e2389c46d [flang] More folding of SIZE()
Original-commit: flang-compiler/f18@23f62fea1d
Reviewed-on: https://github.com/flang-compiler/f18/pull/386
Tree-same-pre-rewrite: false
2019-04-05 12:56:12 -07:00
peter klausler
28184c4a49 [flang] Simplify expression visitor usage
Original-commit: flang-compiler/f18@9ab121d6a6
Reviewed-on: https://github.com/flang-compiler/f18/pull/386
Tree-same-pre-rewrite: false
2019-04-05 12:56:09 -07:00
peter klausler
c49f7da3f2 [flang] complete GetShape, compile
Original-commit: flang-compiler/f18@ff124f69a9
Reviewed-on: https://github.com/flang-compiler/f18/pull/386
Tree-same-pre-rewrite: false
2019-04-05 12:56:06 -07:00
peter klausler
b65572d5a0 [flang] fix original failure (reshape intrinsic argument check)
Original-commit: flang-compiler/f18@8bba330b32
Reviewed-on: https://github.com/flang-compiler/f18/pull/386
Tree-same-pre-rewrite: false
2019-04-05 12:56:04 -07:00
peter klausler
e08a2b7b22 [flang] clean up CoarrayRef
Original-commit: flang-compiler/f18@41bef37c7c
Reviewed-on: https://github.com/flang-compiler/f18/pull/386
Tree-same-pre-rewrite: false
2019-04-05 12:56:03 -07:00
peter klausler
47f8713854 [flang] Begin shape analysis
Original-commit: flang-compiler/f18@888166c97e
Reviewed-on: https://github.com/flang-compiler/f18/pull/386
Tree-same-pre-rewrite: false
2019-04-05 12:56:00 -07:00
peter klausler
4eade259b3 [flang] Address comments, clean up warnings
Original-commit: flang-compiler/f18@a5eeeb4430
Reviewed-on: https://github.com/flang-compiler/f18/pull/378
2019-04-02 11:56:19 -07:00
peter klausler
70b05522b0 [flang] Also fix bug#377
Original-commit: flang-compiler/f18@56631cf5e1
Reviewed-on: https://github.com/flang-compiler/f18/pull/378
Tree-same-pre-rewrite: false
2019-04-02 11:02:30 -07:00
peter klausler
e2e2ec387a [flang] Adjust member function names in integer.h to avoid confusion.
Original-commit: flang-compiler/f18@56dba8fa08
Reviewed-on: https://github.com/flang-compiler/f18/pull/370
2019-04-01 16:52:03 -07:00
peter klausler
547a0601f1 [flang] Logical operation precedence
Original-commit: flang-compiler/f18@060bc39fb4
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
Tree-same-pre-rewrite: false
2019-04-01 13:01:42 -07:00
peter klausler
9e9b9f0776 [flang] Pass tests
Original-commit: flang-compiler/f18@ffb057f262
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
Tree-same-pre-rewrite: false
2019-04-01 12:30:08 -07:00
peter klausler
b35f4a98e2 [flang] work in progress
Original-commit: flang-compiler/f18@33ea8e506a
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
Tree-same-pre-rewrite: false
2019-04-01 10:59:00 -07:00
peter klausler
95b4e65ecf [flang] Move some AsFortran() implementations into new formatting.cc; use precedence for parentheses
Original-commit: flang-compiler/f18@2b5fa051df
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
Tree-same-pre-rewrite: false
2019-04-01 10:58:55 -07:00
peter klausler
e0f76d2306 [flang] Support CONVERT= and DISPOSE= on INQUIRE
Original-commit: flang-compiler/f18@fbedd32376
Reviewed-on: https://github.com/flang-compiler/f18/pull/352
Tree-same-pre-rewrite: false
2019-04-01 10:14:19 -07:00
peter klausler
822810f017 [flang] Check int literals for overflow when kind is known.
improve test

Original-commit: flang-compiler/f18@09ce783cd3
Reviewed-on: https://github.com/flang-compiler/f18/pull/352
Tree-same-pre-rewrite: false
2019-04-01 10:14:16 -07:00
Jean Perier
3774e9d173 [flang] Update documentation with status of intrinsic procedure support in f18
Original-commit: flang-compiler/f18@aa12037a5b
Tree-same-pre-rewrite: false
2019-03-29 08:48:39 -07:00
Jean Perier
382aafad68 [flang] Remove useless dummy return statements
I first added these because I had issues with return type deduction
in lambdas, but they are actually useless when the return type is
specified in the lambda signature.

Original-commit: flang-compiler/f18@5bcbbd8bdc
Tree-same-pre-rewrite: false
2019-03-29 04:30:35 -07:00
Jean Perier
9f98662b5f [flang] Fix F18 scalar integer power algorithm
Original-commit: flang-compiler/f18@f0609e7ace
2019-03-28 08:18:42 -07:00
Jean Perier
eb52525b91 [flang] Add todo for bessel function default support
Original-commit: flang-compiler/f18@3842e7f5ac
2019-03-29 01:41:26 -07:00
Jean Perier
47251f2db0 [flang] Fix compilation failure on PowerPC
Original-commit: flang-compiler/f18@f79f4973b6
Tree-same-pre-rewrite: false
2019-03-28 06:53:52 -07:00
Jean Perier
07f6963dbb [flang] Remove non standard use of bessel C functions
Original-commit: flang-compiler/f18@a40559372a
Tree-same-pre-rewrite: false
2019-03-28 04:25:13 -07:00
Jean Perier
1d4323ddd5 [flang] Silence GCC 8.1 spurious warning
Original-commit: flang-compiler/f18@69e05d0632
Tree-same-pre-rewrite: false
2019-03-28 02:34:32 -07:00
Steve Scalpone
1de9ecd251 [flang] Add CMake rules to install static and shared libraries in
the default install directory or in the directory specified
with CMAKE_INSTALL_PREFIX.  Fixes flang-compiler/f18#359.

Original-commit: flang-compiler/f18@35ce1628e2
Reviewed-on: https://github.com/flang-compiler/f18/pull/364
2019-03-28 09:55:56 -07:00
Jean Perier
236eeef974 [flang] Only have cmake look for libpgmath if LIBPGMATH_DIR is given
Original-commit: flang-compiler/f18@1d778f5c1a
2019-03-27 10:16:07 -07:00
Jean Perier
be5cfaa5c7 [flang] fix clang errors and warnings
Original-commit: flang-compiler/f18@410f96384f
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
cabcd851e6 [flang] Prepare to be merged with master branch
ActualArgument was modified in the master branch from
a struct to class. In order to compile once merged, this PR
required the related access paterns to be adapted to match
the new ActualArgument.
As a consequence, this PR does not compile anymore on its own,
it needs to be merged with the master branch to work.

Original-commit: flang-compiler/f18@48cdd2ed0e
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
167730fd91 [flang] Enable folding of some more intrinsic functions
Enable folding of the following 80 intrinsic functions:

+ Without runtime:

++ Integer:
abs, dim, dshiftl, dshiftr, exponent, iand, ibclr, ibset, ieor, int,
ior, ishft, kind, len, leadz, maskl, maskr, merge_bits, popcnt, poppar,
shifta, shiftl, shiftr, trailz

++ Real:
abs, aimag, aint, dprod, real

+ Complex:
cmplx, conjg

++ Logical:
bge, bgt, ble, blt

+ With Runtime :

+ Real:
acos, acosh, asinh, atan, atan2, atanh, bessel_j0, bessel_j1,
bessel_jn (elemental), bessel_y0, bessel_y1, bessel_yn (elemental),
cos, cosh, erf, erfc, erfc_scaled, exp, gamma, hypot, log, log10,
log_gamma, mod, sin, sqrt, sinh, sqrt, tan, tanh

++ Complex:
acos, acosh, asin, asinh, atan, atanh, cos, cosh, exp, log, sin,
sinh, sqrt, tan, tanh

Original-commit: flang-compiler/f18@7e7d1920f8
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
dc3cca3427 [flang] make HostIntrinsicProceduresLibrary a class
Original-commit: flang-compiler/f18@b9f5015d4d
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
aeb7cef41a [flang] add the possibility to use libpgmath for constant folding
Original-commit: flang-compiler/f18@948a665627
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
9147534f13 [flang] Map more intrinsic functions to <cmath> functions
Original-commit: flang-compiler/f18@f0f2062211
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
e3b74caa0d [flang] Move host floating point environment handling in host.h/host.cc
Original-commit: flang-compiler/f18@0cba8b1308
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
ca0261b253 [flang] Removed dynamic loading feature for intrinsic folding
After more reflexion, dynamic loading brings to much uncertainty
regarding which library is actually being use for folding.
It is removed to avoid pushing people to use it.
A static linking to libpgmath will be provided in a later commit.

Original-commit: flang-compiler/f18@2161627d28
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
9ce02da63a [flang] fix clang++ linking issue with libm
Original-commit: flang-compiler/f18@805c861bd0
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
8d032dc96b [flang] renaming to focus scope on intrinsic runtime
Original-commit: flang-compiler/f18@7cfd33b178
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
fa3a179fec [flang] made fenv errors internal errors
Original-commit: flang-compiler/f18@f776c8db91
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
a955f3e51c [flang] fix signed/unsigned comparison
Original-commit: flang-compiler/f18@46148712e1
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
4fdf4fa18d [flang] Limits C++ implementation behaviors
The issue addressed here is the use of cast between object pointers
and function pointers. It is implementation defined because C++,
just like C, does not mandate that function and object pointers
must have the same size.
It is needed to have such cast because it is a will to ba able to
call inside F18 numerical function from libraries linked during
a Fortran program compilation in order to perform folding.
dlopen returns function pointers as void* that need to be cast to
pointer before use.
This change limits the usage of such cast inside ifdefs where POSIX
is required. In POSIX context, such cast is defined. Dlopen is
anyway used only if the environment is POSIX compliant.
In the rest of the code, opaque function pointers have been changed
from void* to void*(*)(). reinterpret_cast from function pointer to
function pointer are standard compliant.

Original-commit: flang-compiler/f18@4b2f29a128
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
dd2c2d5798 [flang] fixed use before init in elemental folding helper
Original-commit: flang-compiler/f18@2cea43ddf9
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00