File tree 2 files changed +25
-0
lines changed
2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -248,6 +248,7 @@ The following is an index of all built-in attributes.
248
248
- [ ` no_builtins ` ] — Disables use of certain built-in functions.
249
249
- [ ` target_feature ` ] — Configure platform-specific code generation.
250
250
- [ ` track_caller ` ] - Pass the parent call location to ` std::panic::Location::caller() ` .
251
+ - [ ` instruction_set ` ] - Specify the instruction set used to generate a functions code
251
252
- Documentation
252
253
- ` doc ` — Specifies documentation. See [ The Rustdoc Book] for more
253
254
information. [ Doc comments] are transformed into ` doc ` attributes.
@@ -298,6 +299,7 @@ The following is an index of all built-in attributes.
298
299
[ `global_allocator` ] : runtime.md#the-global_allocator-attribute
299
300
[ `ignore` ] : attributes/testing.md#the-ignore-attribute
300
301
[ `inline` ] : attributes/codegen.md#the-inline-attribute
302
+ [ `instruction_set` ] : attributes/codegen.md#the-instruction_set-attribute
301
303
[ `link_name` ] : items/external-blocks.md#the-link_name-attribute
302
304
[ `link_ordinal` ] : items/external-blocks.md#the-link_ordinal-attribute
303
305
[ `link_section` ] : abi.md#the-link_section-attribute
Original file line number Diff line number Diff line change @@ -352,3 +352,26 @@ trait object whose methods are attributed.
352
352
[ `core::intrinsics::caller_location` ] : ../../core/intrinsics/fn.caller_location.html
353
353
[ `core::panic::Location::caller` ] : ../../core/panic/struct.Location.html#method.caller
354
354
[ `Location` ] : ../../core/panic/struct.Location.html
355
+
356
+ ## The ` instruction_set ` attribute
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. 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
+
363
+ The following values are available on targets for the ` ARMv4 ` and ` ARMv5te ` architectures:
364
+
365
+ * ` arm::a32 ` - Uses ARM code.
366
+ * ` arm::t32 ` - Uses Thumb code.
367
+
368
+ <!-- ignore: arm-only -->
369
+ ``` rust,ignore
370
+ #[instruction_set(arm::a32)]
371
+ fn foo_arm_code() {}
372
+
373
+ #[instruction_set(arm::t32)]
374
+ fn bar_thumb_code() {}
375
+ ```
376
+
377
+ [ _MetaListPath_ ] : ../attributes.md#meta-item-attribute-syntax
You can’t perform that action at this time.
0 commit comments