Skip to content

Commit df9643a

Browse files
authored
Update codegen.md
1 parent 3d45616 commit df9643a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/attributes/codegen.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,9 @@ fn foo_arm_code() {}
375375
fn bar_thumb_code() {}
376376
```
377377

378-
The rules for inlining functions using the `instruction_set` attribute are slightly more strict than normal:
378+
If your function has neither the instruction_set attribute nor inline assembly, then the code you write within that function should not presume any particular instruction set.
379+
This ends up creating a limitation to how often code is inlined:
379380

380-
* If a function has an `instruction_set` attribute, then the function is assumed to require the given instruction set and it won't inline into a function of another instruction set.
381-
* If a function does not have an `instruction_set` attribute but *does* contain inline assembly, then the inline assembly is assumed to require the default instruction set of the build target and so inlining between instruction sets won't happen.
382-
* Otherwise, a function is assumed to not rely on a particular instruction set and the function *may* be inlined into any calling function (all other restrictions on inlining still apply).
381+
* If a function has an `instruction_set` attribute it won't inline into a function of another instruction set.
382+
* If a function does not have an `instruction_set` attribute but *does* contain inline assembly, then the inline assembly is assumed to require the default instruction set of the build target, and so inlining between different instruction sets won't happen.
383+
* Otherwise, inlining happens normally.

0 commit comments

Comments
 (0)