Skip to content
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

Add notes on #[target_feature] for wasm #1047

Merged
merged 1 commit into from
Jun 11, 2021
Merged
Changes from all commits
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
16 changes: 15 additions & 1 deletion src/attributes/codegen.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ assumed to exist.

## The `target_feature` attribute

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

#### `x86` or `x86_64`

This platform requires that `#[target_feature]` is only applied to [`unsafe`
functions][unsafe function].

Feature | Implicitly Enables | Description
------------|--------------------|-------------------
`aes` | `sse2` | [AES] — Advanced Encryption Standard
Expand Down Expand Up @@ -128,6 +131,17 @@ Feature | Implicitly Enables | Description
[`xsaveopt`]: https://www.felixcloutier.com/x86/xsaveopt
[`xsaves`]: https://www.felixcloutier.com/x86/xsaves

#### `wasm32` or `wasm64`

This platform allows `#[target_feature]` to be applied to both safe and
[`unsafe` functions][unsafe function].

Feature | Description
------------|-------------------
`simd128` | [WebAssembly simd proposal][simd128]

[simd128]: https://github.com/webassembly/simd

### Additional information

See the [`target_feature` conditional compilation option] for selectively
Expand Down