Skip to content

Commit

Permalink
Merge pull request #1047 from alexcrichton/doc-wasm
Browse files Browse the repository at this point in the history
Add notes on `#[target_feature]` for wasm
  • Loading branch information
ehuss authored Jun 11, 2021
2 parents df4622b + 7cdf88d commit aacd887
Showing 1 changed file with 15 additions and 1 deletion.
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

0 comments on commit aacd887

Please sign in to comment.