Skip to content

Commit e389abd

Browse files
committed
Apply feedback
1 parent ef70365 commit e389abd

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/attributes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ The following is an index of all built-in attributes.
246246
- [`no_builtins`] — Disables use of certain built-in functions.
247247
- [`target_feature`] — Configure platform-specific code generation.
248248
- [`track_caller`] - Pass the parent call location to `std::panic::Location::caller()`.
249+
- [`instruction_set`] - Specify the instruction set used to generate a functions code
249250
- Documentation
250251
- `doc` — Specifies documentation. See [The Rustdoc Book] for more
251252
information. [Doc comments] are transformed into `doc` attributes.

src/attributes/codegen.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,15 +355,23 @@ trait object whose methods are attributed.
355355

356356
## The `instruction_set` attribute
357357

358-
The `instruction_set` attribute may be applied to a function to enable code generation for a specific
359-
instruction set supported by the target architecture. Currently, this is only available for `ARMv4T`
360-
devices where the architecture has "ARM code" and "Thumb code" available and a single program may
361-
utilize both of these. If not specified the default instruction set for the target will be used.
358+
The *`instruction_set` attribute* may be applied to a function to enable code generation for a specific
359+
instruction set supported by the target architecture. It uses the [_MetaListPath_] syntax and a path
360+
comprised of the architecture and instruction set to specify how to generate the code for
361+
architectures where a single program may utilize multiple instruction sets.
362362

363+
The following values are available on targets for the `ARMv4` architecture:
364+
365+
* `arm::a32` - Uses ARM code.
366+
* `arm::t32` - Uses Thumb code.
367+
368+
<!-- ignore: arm-only -->
363369
```rust
364370
#[instruction_set(arm::a32)]
365371
fn foo_arm_code() {}
366372

367373
#[instruction_set(arm::t32)]
368374
fn bar_thumb_code() {}
369375
```
376+
377+
[_MetaListPath_]: ../attributes.md#meta-item-attribute-syntax

0 commit comments

Comments
 (0)