Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions src/c-api.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,31 @@ For example:
|`+__riscv_cmodel_large+` |1 |Defined if using `large` code model.
|===

[id=unstable_preprocessor_definitions]
=== Unstable Preprocessor Definitions

The following preprocessor definitions should be treated as unstable, and not
relied upon by the public interfaces in your code. They may be changed by new
compiler versions, compiler options, or on a per-processor basis.

.Unstable Preprocessor Definitions
[cols="30,~"]
|===
|*Name* |*Description*
|`+__GCC_CONSTRUCTIVE_SIZE+` |The maximum recommended size of contiguous memory occupied by two objects accessed with temporal locality by concurrent threads.
|`+__GCC_DESTRUCTIVE_SIZE+` |The minimum recommended offset between two concurrently-accessed objects to avoid additional performance degradation due to contention introduced by the implementation.
|`+INT_FASTN_WIDTH+` |Bit width of an object of type `+int_fastN_t+`
|`+INT_FASTN_MIN+` |Minimum value of an object of type `+int_fastN_t+`
|`+INT_FASTN_MAX+` |Maximum value of an object of type `+int_fastN_t+`
|`+INT_LEASTN_WIDTH+` |Bit width of an object of type `+int_leastN_t+`
|`+INT_LEASTN_MIN+` |Minimum value of an object of type `+int_leastN_t+`
|`+INT_LEASTN_MAX+` |Maximum value of an object of type `+int_leastN_t+`
|`+UINT_FASTN_WIDTH+` |Bit width of an object of type `+uint_fastN_t+`
|`+UINT_FASTN_MAX+` |Maximum value of an object of type `+uint_fastN_t+`
|`+UINT_LEASTN_WIDTH+` |Bit width of an object of type `+uint_leastN_t+`
|`+UINT_LEASTN_MAX+` |Maximum value of an object of type `+uint_leastN_t+`
|===

=== Deprecated Preprocessor Definitions

.fn-1: footnote:[Not all compilers provide `-mno-div` and `-mno-fdiv` option.]
Expand All @@ -170,6 +195,28 @@ For example:
|`+__riscv_compressed+` |1 |`C` extension is available. | `+__riscv_c+`
|===

== C Types

Most C type sizes and alignments are defined by the ABI.

=== Unstable C Type Sizes and Alignments

The following type sizes and alignments should be treated as unstable, and not
relied upon by the public interfaces in your code. They may be changed by new
compiler versions, compiler options, or on a per-processor basis.

.Unstable Type Sizes and Alignments
[cols="30,~"]
|===
|*Type* |*Description*
|`+int_fastN_t+` |Fastest signed integer types with widths of at least `+N+` bits.
|`+int_leastN_t+` |Smallest signed integer types with widths of at least `+N+` bits.
|`+uint_fastN_t+` |Fastest unsigned integer types with widths of at least `+N+` bits.
|`+uint_leastN_t+` |Smallest unsigned integer types with widths of at least `+N+` bits.
|===

The corresponding Macro constants are also unstable (see <<unstable_preprocessor_definitions, Unstable Preprocessor Definitions>>).

== Function Attributes

=== `+__attribute__((naked))+`
Expand Down
Loading