Skip to content

Commit feadfb6

Browse files
Initial stab at docs for RFC2867
1 parent 6801b64 commit feadfb6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/attributes/codegen.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,3 +352,18 @@ trait object whose methods are attributed.
352352
[`core::intrinsics::caller_location`]: ../../core/intrinsics/fn.caller_location.html
353353
[`core::panic::Location::caller`]: ../../core/panic/struct.Location.html#method.caller
354354
[`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. 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+
utilise both of these. If not specified the default instruction set for the target will be used.
362+
363+
```rust
364+
#[instruction_set(arm::a32)]
365+
fn foo_arm_code() {}
366+
367+
#[instruction_set(arm::t32)]
368+
fn bar_thumb_code() {}
369+
```

0 commit comments

Comments
 (0)