File tree 2 files changed +13
-4
lines changed
2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -246,6 +246,7 @@ The following is an index of all built-in attributes.
246
246
- [ ` no_builtins ` ] — Disables use of certain built-in functions.
247
247
- [ ` target_feature ` ] — Configure platform-specific code generation.
248
248
- [ ` 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
249
250
- Documentation
250
251
- ` doc ` — Specifies documentation. See [ The Rustdoc Book] for more
251
252
information. [ Doc comments] are transformed into ` doc ` attributes.
Original file line number Diff line number Diff line change @@ -355,15 +355,23 @@ trait object whose methods are attributed.
355
355
356
356
## The ` instruction_set ` attribute
357
357
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.
362
362
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 -->
363
369
``` rust
364
370
#[instruction_set(arm:: a32)]
365
371
fn foo_arm_code () {}
366
372
367
373
#[instruction_set(arm:: t32)]
368
374
fn bar_thumb_code () {}
369
375
```
376
+
377
+ [ _MetaListPath_ ] : ../attributes.md#meta-item-attribute-syntax
You can’t perform that action at this time.
0 commit comments