Skip to content

Commit 45a3056

Browse files
[Flang] Add a Fortran Standards Support doc (#132195)
1 parent de81b85 commit 45a3056

File tree

2 files changed

+119
-0
lines changed

2 files changed

+119
-0
lines changed

flang/docs/FortranStandardsSupport.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
<!--===- docs/FortranStandardsSupport.md
2+
3+
Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
See https://llvm.org/LICENSE.txt for license information.
5+
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
7+
-->
8+
9+
# Flang Fortran Standards Support
10+
11+
```{contents}
12+
---
13+
local:
14+
---
15+
```
16+
17+
This document summarizes Fortran standards support in Flang. The information is only provided as a guideline. The
18+
TODOs/Not Yet Implemented messages emitted by the compiler for unimplemented features should be treated as authoritative.
19+
20+
The standards support information is provided as a table with three columns that are self explanatory.
21+
The Status column uses the letters **Y**, **P**, **N** for the implementation status:
22+
- **Y** : Yes. When the implementation is complete
23+
- **P** : Partial. When the implementation is incomplete for a few cases
24+
- **N** : No. When the implementation is absent
25+
26+
There is no distinction made between support in the Parser/Semantics and the MLIR or Lowering stages.
27+
28+
Note: The two major missing features in Flang at present are coarrays and parameterized derived types (PDTs) with length type parameters.
29+
30+
31+
## Fortran 2023
32+
See [document](F202X.md) for a brief discussion about the new features in Fortran 2023. The following table summarizes the
33+
status of all important Fortran 2023 features. The table entries are based on the document [The new features in Fortran 2023](https://wg5-fortran.org/N2201-N2250/N2212.pdf).
34+
35+
| Feature | Status | Comments |
36+
|------------------------------------------------------------|--------|---------------------------------------------------------|
37+
| Allow longer statement lines and overall statement length | Y | |
38+
| Automatic allocation of lengths of character variables | N | |
39+
| The specifiers typeof and classof | N | |
40+
| Conditional expressions and arguments | N | |
41+
| More use of boz constants | P | All usages other than enum are supported |
42+
| Intrinsics for extracting tokens from a string | N | |
43+
| Intrinsics for Trig functions that work in degrees | N | |
44+
| Intrinsics for Trig functions that work in half revolutions| N | |
45+
| Changes to system_clock | N | |
46+
| Changes for conformance with the new IEEE standard | Y | |
47+
| Additional named constants to specify kinds | Y | |
48+
| Extensions for c_f_pointer intrinsic | N | |
49+
| Procedures for converting between fortran and c strings | N | |
50+
| The at edit descriptor | N | |
51+
| Control over leading zeros in output of real values | N | |
52+
| Extensions for Namelist | N | |
53+
| Allow an object of a type with a coarray ultimate component to be an array or allocatable | N | |
54+
| Put with Notify | N | |
55+
| Error conditions in collectives | N | |
56+
| Simple procedures | N | |
57+
| Using integer arrays to specify subscripts | N | |
58+
| Using integer arrays to specify rank and bound of an array | N | |
59+
| Using an integer constant to specify rank | N | |
60+
| Reduction specifier for do concurrent | P | Syntax is accepted |
61+
| Enumerations | N | |
62+
63+
## Fortran 2018
64+
All features except those listed in the following table are supported. Almost all of the unsupported features are related to
65+
the multi-image execution. The table entries are based on the document [The new features in Fortran 2018](https://wg5-fortran.org/N2151-N2200/ISO-IECJTC1-SC22-WG5_N2161_The_New_Features_of_Fortran_2018.pdf).
66+
67+
| Feature | Status | Comments |
68+
|------------------------------------------------------------|--------|---------------------------------------------------------|
69+
| Asynchronous communication | P | Syntax is accepted |
70+
| Teams | N | Multi-image/Coarray feature |
71+
| Image failure | P | Multi-image/Coarray feature. stat_failed_image is added |
72+
| Form team statement | N | Multi-image/Coarray feature |
73+
| Change team construct | N | Multi-image/Coarray feature |
74+
| Coarrays allocated in teams | N | Multi-image/Coarray feature |
75+
| Critical construct | N | Multi-image/Coarray feature |
76+
| Lock and unlock statements | N | Multi-image/Coarray feature |
77+
| Events | N | Multi-image/Coarray feature |
78+
| Sync team construct | N | Multi-image/Coarray feature |
79+
| Image selectors | N | Multi-image/Coarray feature |
80+
| Intrinsic functions get_team and team_number | N | Multi-image/Coarray feature |
81+
| Intrinsic function image_index | N | Multi-image/Coarray feature |
82+
| Intrinsic function num_images | N | Multi-image/Coarray feature |
83+
| Intrinsic function this_image | N | Multi-image/Coarray feature |
84+
| Intrinsic move_alloc extensions | P | Multi-image/Coarray feature |
85+
| Detecting failed and stopped images | N | Multi-image/Coarray feature |
86+
| Collective subroutines | N | Multi-image/Coarray feature |
87+
| New and enhanced atomic subroutines | N | Multi-image/Coarray feature |
88+
| Failed images and stat= specifiers | N | Multi-image/Coarray feature |
89+
| Intrinsic function coshape | N | Multi-image/Coarray feature |
90+
91+
## Fortran 2008
92+
All features except those listed in the following table are supported.
93+
94+
| Feature | Status | Comments |
95+
|------------------------------------------------------------|--------|---------------------------------------------------------|
96+
| Coarrays | N | Lowering and runtime support is not implemented |
97+
| do concurrent | P | Sequential execution works. Parallel support in progress|
98+
| Internal procedure as an actual argument or pointer target | Y | Current implementation requires stack to be executable. See [Proposal](InternalProcedureTrampolines.md) |
99+
100+
## Fortran 2003
101+
All features except those listed in the following table are supported.
102+
103+
| Feature | Status | Comments |
104+
|------------------------------------------------------------|--------|---------------------------------------------------------|
105+
| Parameterized Derived Types | P | PDT with length type parameters is not supported. See [Proposal](ParameterizedDerivedTypes.md) |
106+
| Assignment to allocatable | P | Assignment to whole allocatable in FORALL is not implemented |
107+
| The VOLATILE attribute | P | VOLATILE in procedure interfaces is not implemented |
108+
| Asynchronous input/output | P | IO will happen synchronously |
109+
| MIN/MAX extensions for CHARACTER | P | Some variants are not supported |
110+
111+
## Fortran 95
112+
All features are supported.
113+
114+
## Fortran 90
115+
All features are supported.
116+
117+
## FORTRAN 77
118+
All features are supported.

flang/docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ on how to get in touch with us and to learn more about the current status.
2626
C++style
2727
DesignGuideline
2828
FortranForCProgrammers
29+
FortranStandardsSupport
2930
GettingInvolved
3031
GettingStarted
3132
ImplementingASemanticCheck

0 commit comments

Comments
 (0)