[flang-commits] [flang] [Flang][Docs] Clean up flang/docs/IntrinsicTypes.md documentation (PR #162184)
Tarun Prabhu via flang-commits
flang-commits at lists.llvm.org
Tue Oct 7 07:29:03 PDT 2025
================
@@ -14,101 +14,106 @@ local:
---
```
-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`,
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`,
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
in [Character.md](Character.md).
## Supported TYPES and KINDS
-Here are the type and kind combinations supported in f18:
-
-INTEGER(KIND=1) 8-bit two's-complement integer
-INTEGER(KIND=2) 16-bit two's-complement integer
-INTEGER(KIND=4) 32-bit two's-complement integer
-INTEGER(KIND=8) 64-bit two's-complement integer
-INTEGER(KIND=16) 128-bit two's-complement integer
-
-REAL(KIND=2) 16-bit IEEE 754 binary16 (5e11m)
-REAL(KIND=3) 16-bit upper half of 32-bit IEEE 754 binary32 (8e8m)
-REAL(KIND=4) 32-bit IEEE 754 binary32 (8e24m)
-REAL(KIND=8) 64-bit IEEE 754 binary64 (11e53m)
-REAL(KIND=10) 80-bit extended precision with explicit normalization bit (15e64m)
-REAL(KIND=16) 128-bit IEEE 754 binary128 (15e113m)
-
-COMPLEX(KIND=2) Two 16-bit IEEE 754 binary16
-COMPLEX(KIND=3) Two 16-bit upper half of 32-bit IEEE 754 binary32
-COMPLEX(KIND=4) Two 32-bit IEEE 754 binary32
-COMPLEX(KIND=8) Two 64-bit IEEE 754 binary64
-COMPLEX(KIND=10) Two 80-bit extended precisions values
-COMPLEX(KIND=16) Two 128-bit IEEE 754 binary128
-
-No
-[double-double
-](https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format)
+f18 supports the following type and kind combinations:
+
+| Type | Description |
+| :--: | :---------: |
+| INTEGER(KIND=1) | 8-bit two's-complement integer |
+| INTEGER(KIND=2) | 16-bit two's-complement integer |
+| INTEGER(KIND=4) | 32-bit two's-complement integer |
+| INTEGER(KIND=8) | 64-bit two's-complement integer |
+| INTEGER(KIND=16) | 128-bit two's-complement integer |
+| REAL(KIND=2) | 16-bit IEEE 754 binary16 (5e11m) |
+| REAL(KIND=3) | 16-bit upper half of 32-bit IEEE 754 binary32 (8e8m) |
+| REAL(KIND=4) | 32-bit IEEE 754 binary32 (8e24m) |
+| REAL(KIND=8) | 64-bit IEEE 754 binary64 (11e53m) |
+| REAL(KIND=10) | 80-bit extended precision with explicit normalization bit (15e64m) |
+| REAL(KIND=16) | 128-bit IEEE 754 binary128 (15e113m) |
+| COMPLEX(KIND=2) | Two 16-bit IEEE 754 binary16 |
+| COMPLEX(KIND=3) | Two 16-bit upper half of 32-bit IEEE 754 binary32 |
+| COMPLEX(KIND=4) | Two 32-bit IEEE 754 binary32 |
+| COMPLEX(KIND=8) | Two 64-bit IEEE 754 binary64 |
+| COMPLEX(KIND=10) | Two 80-bit extended precisions values |
+| COMPLEX(KIND=16) | Two 128-bit IEEE 754 binary128 |
+| LOGICAL(KIND=1) | 8-bit integer |
+| LOGICAL(KIND=2) | 16-bit integer |
+| LOGICAL(KIND=4) | 32-bit integer |
+| LOGICAL(KIND=8) | 64-bit integer |
+
+* No [double-double](https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format)
quad precision type is supported.
+* No 128-bit logical support.
-LOGICAL(KIND=1) 8-bit integer
-LOGICAL(KIND=2) 16-bit integer
-LOGICAL(KIND=4) 32-bit integer
-LOGICAL(KIND=8) 64-bit integer
+### Defaults kinds
-No 128-bit logical support.
+f18 defaults to the following kinds for these types:
-### Defaults kinds
+* `INTEGER` 4
+* `REAL` 4
+* `COMPLEX` 4
+* `DOUBLE PRECISION` 8
+* `LOGICAL` 4
-INTEGER 4
-REAL 4
-COMPLEX 4
-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
+value for every entity.
-#### Modifying the default kind with default-real-8.
-REAL 8
-DOUBLE PRECISION 8
-COMPLEX 8
+#### Modifying the default kind with -fdefault-real-8:
-#### Modifying the default kind with default-integer-8:
-INTEGER 8
-LOGICAL 8
+* `REAL` 8
----------------
tarunprabhu wrote:
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.
https://github.com/llvm/llvm-project/pull/162184
More information about the flang-commits
mailing list