You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/inline-assembly.md
+8-11
Original file line number
Diff line number
Diff line change
@@ -161,9 +161,8 @@ Here is the list of currently supported register classes:
161
161
| AArch64 |`vreg`|`v[0-31]`|`w`|
162
162
| AArch64 |`vreg_low16`|`v[0-15]`|`x`|
163
163
| AArch64 |`preg`|`p[0-15]`, `ffr`| Only clobbers |
164
-
| ARM |`reg`|`r[0-12]`, `r14`|`r`|
165
-
| ARM (Thumb) |`reg_thumb`|`r[0-r7]`|`l`|
166
-
| ARM (ARM) |`reg_thumb`|`r[0-r12]`, `r14`|`l`|
164
+
| ARM (ARM/Thumb2) |`reg`|`r[0-12]`, `r14`|`r`|
165
+
| ARM (Thumb1) |`reg`|`r[0-7]`|`r`|
167
166
| ARM |`sreg`|`s[0-31]`|`t`|
168
167
| ARM |`sreg_low16`|`s[0-15]`|`x`|
169
168
| ARM |`dreg`|`d[0-31]`|`w`|
@@ -284,21 +283,16 @@ Some registers cannot be used for input or output operands:
284
283
| All |`si` (x86-32), `bx` (x86-64), `r6` (ARM), `x19` (AArch64), `x9` (RISC-V) | This is used internally by LLVM as a "base pointer" for functions with complex stack frames. |
285
284
| x86 |`k0`| This is a constant zero register which can't be modified. |
286
285
| x86 |`ip`| This is the program counter, not a real register. |
287
-
| x86 |`mm[0-7]`| MMX registers are not currently supported (but may be in the future). |
288
-
| x86 |`st([0-7])`| x87 registers are not currently supported (but may be in the future). |
289
286
| AArch64 |`xzr`| This is a constant zero register which can't be modified. |
287
+
| AArch64 |`x18`| This is a reserved register on some AArch64 targets. |
290
288
| ARM |`pc`| This is the program counter, not a real register. |
291
289
| ARM |`r9`| This is a reserved register on some ARM targets. |
292
290
| RISC-V |`x0`| This is a constant zero register which can't be modified. |
293
291
| RISC-V |`gp`, `tp`| These registers are reserved and cannot be used as inputs or outputs. |
294
292
295
293
In some cases LLVM will allocate a "reserved register" for `reg` operands even though this register cannot be explicitly specified.
296
294
Assembly code making use of reserved registers should be careful since `reg` operands may alias with those registers.
297
-
298
-
These reserved registers are:
299
-
- The frame pointer and LLVM base pointer on all architectures.
300
-
-`r9` on ARM.
301
-
-`x18` on AArch64.
295
+
Reserved registers that can sometimes be allocated are the frame pointer and base pointer in the list above.
302
296
303
297
## Template modifiers
304
298
@@ -371,10 +365,13 @@ The following ABIs can be used with `clobber_abi`:
> - On AArch64 `x18` only included in the clobber list if it is not considered as a reserved register on the target.
374
+
378
375
The list of clobbered registers for each ABI is updated in rustc as architectures gain new registers: this ensures that `asm!` clobbers will continue to be correct when LLVM starts using these new registers in its generated code.
0 commit comments