Skip to content

Commit aacd887

Browse files
authored
Merge pull request #1047 from alexcrichton/doc-wasm
Add notes on `#[target_feature]` for wasm
2 parents df4622b + 7cdf88d commit aacd887

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/attributes/codegen.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ assumed to exist.
4747

4848
## The `target_feature` attribute
4949

50-
The *`target_feature` [attribute]* may be applied to an [unsafe function] to
50+
The *`target_feature` [attribute]* may be applied to a function to
5151
enable code generation of that function for specific platform architecture
5252
features. It uses the [_MetaListNameValueStr_] syntax with a single key of
5353
`enable` whose value is a string of comma-separated feature names to enable.
@@ -75,6 +75,9 @@ The following is a list of the available feature names.
7575

7676
#### `x86` or `x86_64`
7777

78+
This platform requires that `#[target_feature]` is only applied to [`unsafe`
79+
functions][unsafe function].
80+
7881
Feature | Implicitly Enables | Description
7982
------------|--------------------|-------------------
8083
`aes` | `sse2` | [AES] — Advanced Encryption Standard
@@ -128,6 +131,17 @@ Feature | Implicitly Enables | Description
128131
[`xsaveopt`]: https://www.felixcloutier.com/x86/xsaveopt
129132
[`xsaves`]: https://www.felixcloutier.com/x86/xsaves
130133

134+
#### `wasm32` or `wasm64`
135+
136+
This platform allows `#[target_feature]` to be applied to both safe and
137+
[`unsafe` functions][unsafe function].
138+
139+
Feature | Description
140+
------------|-------------------
141+
`simd128` | [WebAssembly simd proposal][simd128]
142+
143+
[simd128]: https://github.com/webassembly/simd
144+
131145
### Additional information
132146

133147
See the [`target_feature` conditional compilation option] for selectively

0 commit comments

Comments
 (0)