You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/abi.md
+13-4Lines changed: 13 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -74,16 +74,23 @@ A type has *simd abi requirements* if:
74
74
* It is a aggregate type, which has a type with *simd abi requirements* as a field.
75
75
76
76
r[abi.compatibility.simd-target-feature]
77
-
A type with *simd abi requirements* may have one or more *salient target features* . In the case of an aggregate type, the set of *salient target features* is the union of the set of *salient target features* of each field with *simd abi requirements*.
77
+
A type with *simd abi requirements* may have one or more [*salient target features*][target_feature] . In the case of an aggregate type, the set of [*salient target features*][target_feature] is the union of the set of [*salient target features*][target_feature] of each field with *simd abi requirements*.
78
78
79
79
> [!TARGET-SPECIFIC]
80
-
> On x86 and x86-64, the *salient target features* of the `simd` types are:
80
+
> On x86 and x86-64, the [*salient target features*][target_feature] of the `simd` types are:
81
81
> *[`__m128`], [`__m128i`], [`__m128f`], and [`__m128d`]: `sse`
82
82
> *[`__m256`], [`__m256i`], [`__m256f`], and [`__m256d`]: `avx`
83
83
> *[`__m512`], [`__m512i`], [`__m512f`], and [`__m512d`]: `avx512f` and `avx512vl`
84
84
85
85
r[abi.compatibility.call]
86
-
A call to a function `f` via a function item or function pointer with a given signature `S` is valid only if the signature of `f` is *compatible* with the signature `S`, and, if the type of any parameter, the return type, or the type of any argument passed via C-varargs has *simd abi requirements*, each *salient target feature* of that type is either set at both the definition site of the function, and at the call site, or is set at neither site. The behaviour a call that is not valid is undefined.
86
+
A call to a function `f` via a function item or function pointer with a given signature `S` is valid only if the signature of `f` is *compatible* with the signature `S`, and:
87
+
* The ABI tag of the function is `extern "Rust"`, or
88
+
* If the type of any parameter, the return type, or the type of any argument passed via C-varargs has *simd abi requirements*, each [*salient target features*][target_feature]of that type is either set at both the definition site of the function, and at the call site, or is set at neither site.
89
+
90
+
The behaviour a call that is not valid is undefined.
91
+
92
+
> [!NOTE]
93
+
> the ABI tag `extern "Rust"` is the default when the `extern` keyword is not used (either to declare the function within an [`extern` block], or as a [function qualifier][extern functions]). Thus it is safe to call most functions that use simd types.
0 commit comments