-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[Flang][Docs] Clean up flang/docs/IntrinsicTypes.md documentation #162184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Light cleanup of the IntrinsicTypes.md documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the changes, Cameron! I have one comment inlined.
DOUBLE PRECISION 8 | ||
LOGICAL 4 | ||
Modules compiled with different `-fdefault-real-<kind>` and | ||
`-f-default-integer-<kind>` may be freely mixed. Module files encode the kind |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure that this is good message to send, in general. Mixing files compiled with different default kinds may cause problems for calls to subprograms without explicit interfaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mcinally. I particularly appreciated the screenshots - they made things much easier.
which determines the representation method for the specified type. | ||
The intrinsic type character also has a length type parameter called LEN, | ||
The intrinsic type character also has a length type parameter called `LEN`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"length parameter" seems clearer to me than "length type parameter", but the same comment applies here as for "kind type parameter".
The intrinsic type character also has a length type parameter called `LEN`, | |
The intrinsic type `CHARACTER` also has a length parameter called `LEN`, |
Intrinsic types are integer, real, complex, character, and logical. | ||
All intrinsic types have a kind type parameter called KIND, | ||
Intrinsic types are `INTEGER`, `REAL`, `COMPLEX`, `CHARACTER`, and `LOGICAL`. | ||
All intrinsic types have a kind type parameter called `KIND`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know if the term "kind type parameter" is in common use/the language used in the standard? Just "kind parameter" seems clearer to me. But if the former is the convention (or in the official standard), we should prefer that.
All intrinsic types have a kind type parameter called `KIND`, | |
All intrinsic types have a kind parameter called `KIND` |
which determines the length of the character string. | ||
|
||
The implementation of `CHARACTER` type in f18 is described | ||
The implementation of the `CHARACTER` type in f18 is described |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be a good idea to switch to using flang
instead of f18
. The latter is the historic name of this compiler/project, but since the the official binary is also called "flang", so we probably should be consistent.
If you don't mind this being held up a little, I can bring it up at the flang call tomorrow (Wednesday, 8 Oct), to see if the community has any objections. Does that sound reasonable?
The implementation of the `CHARACTER` type in f18 is described | |
The implementation of the `CHARACTER` type in `flang` is described |
LOGICAL(KIND=2) 16-bit integer | ||
LOGICAL(KIND=4) 32-bit integer | ||
LOGICAL(KIND=8) 64-bit integer | ||
### Defaults kinds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Defaults kinds | |
### Default kinds |
* `INTEGER` 4 | ||
* `REAL` 4 | ||
* `COMPLEX` 4 | ||
* `DOUBLE PRECISION` 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DOUBLE PRECISION
is not in the table above. Is this intentional?
quad precision type is supported. | ||
* No 128-bit logical support. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* No 128-bit logical support. | |
* 128-bit `LOGICAL` is not supported |
#### Modifying the default kind with default-integer-8: | ||
INTEGER 8 | ||
LOGICAL 8 | ||
* `REAL` 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a sentence before these bullet points clarifying that the use of -fdefault-real-8
will only affect the default kinds for the following types.
|
||
## Representation of LOGICAL variables | ||
* `INTEGER` 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a sentence before these bullet points clarifying that the use of -fdefault-integer-8
will only affect the default kinds for the following types.
share the following characteristics: | ||
.TRUE. is represented as 1_kind | ||
.FALSE. is represented as 0_kind | ||
The Fortran standard specifies that a logical has two values, `.TRUE.` and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Fortran standard specifies that a logical has two values, `.TRUE.` and | |
The Fortran standard specifies that a `LOGICAL` has two values, `.TRUE.` and |
|
||
Tests for true is *integer value is not zero*. | ||
Flang specifies that logical literal constants with `KIND=[1|2|4|8]` share the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flang specifies that logical literal constants with `KIND=[1|2|4|8]` share the | |
Flang specifies that `LOGICAL` literal constants with `KIND=[1|2|4|8]` share the |
Light cleanup of the IntrinsicTypes.md documentation:
LOGICAL
implementation.TYPES
andKINDS
.-fdefault-[real|integer]-<kind>
.