Skip to content

Commit ed559b3

Browse files
committed
Updated documentation
1 parent 5ec6b5e commit ed559b3

File tree

1 file changed

+12
-1
lines changed
  • src/doc/unstable-book/src/library-features

1 file changed

+12
-1
lines changed

src/doc/unstable-book/src/library-features/asm.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,12 +468,17 @@ Here is the list of currently supported register classes:
468468
| ARM | `qreg` | `q[0-15]` | `w` |
469469
| ARM | `qreg_low8` | `q[0-7]` | `t` |
470470
| ARM | `qreg_low4` | `q[0-3]` | `x` |
471+
| NVPTX | `reg16` | None\* | `h` |
472+
| NVPTX | `reg32` | None\* | `r` |
473+
| NVPTX | `reg64` | None\* | `l` |
471474
| RISC-V | `reg` | `x1`, `x[5-7]`, `x[9-15]`, `x[16-31]` (non-RV32E) | `r` |
472475
| RISC-V | `freg` | `f[0-31]` | `f` |
473476

474477
> **Note**: On x86 we treat `reg_byte` differently from `reg` because the compiler can allocate `al` and `ah` separately whereas `reg` reserves the whole register.
475478
>
476479
> Note #2: On x86-64 the high byte registers (e.g. `ah`) are only available when used as an explicit register. Specifying the `reg_byte` register class for an operand will always allocate a low byte register.
480+
>
481+
> Note #3: On NVPTX, register names are not supported.
477482
478483
Additional register classes may be added in the future based on demand (e.g. MMX, x87, etc).
479484

@@ -495,14 +500,17 @@ Each register class has constraints on which value types they can be used with.
495500
| ARM | `sreg` | `vfp2` | `i32`, `f32` |
496501
| ARM | `dreg` | `vfp2` | `i64`, `f64`, `i8x8`, `i16x4`, `i32x2`, `i64x1`, `f32x2` |
497502
| ARM | `qreg` | `neon` | `i8x16`, `i16x8`, `i32x4`, `i64x2`, `f32x4` |
503+
| NVPTX | `reg16` | None | `i8`, `i16` |
504+
| NVPTX | `reg32` | None | `i8`, `i16`, `i32`, `f32` |
505+
| NVPTX | `reg64` | None | `i8`, `i16`, `i32`, `f32`, `i64`, `f64` |
498506
| RISC-V32 | `reg` | None | `i8`, `i16`, `i32`, `f32` |
499507
| RISC-V64 | `reg` | None | `i8`, `i16`, `i32`, `f32`, `i64`, `f64` |
500508
| RISC-V | `freg` | `f` | `f32` |
501509
| RISC-V | `freg` | `d` | `f64` |
502510

503511
> **Note**: For the purposes of the above table pointers, function pointers and `isize`/`usize` are treated as the equivalent integer type (`i16`/`i32`/`i64` depending on the target).
504512
505-
If a value is of a smaller size than the register it is allocated in then the upper bits of that register will have an undefined value for inputs and will be ignored for outputs. The only exception is the `freg` register class on RISC-V where `f32` values are NaN-boxed in a `f64` as required by the RISC-V architecture.
513+
If a value is of a smaller size than the register it is allocated in then the upper bits of that register will have an undefined value for inputs and will be ignored for outputs. The only exceptions are the `freg` register class on RISC-V where `f32` values are NaN-boxed in a `f64` as required by the RISC-V architecture, and the register classes on NVPTX where values are zero-extended.
506514

507515
When separate input and output expressions are specified for an `inout` operand, both expressions must have the same type. The only exception is if both operands are pointers or integers, in which case they are only required to have the same size. This restriction exists because the register allocators in LLVM and GCC sometimes cannot handle tied operands with different types.
508516

@@ -610,6 +618,9 @@ The supported modifiers are a subset of LLVM's (and GCC's) [asm template argumen
610618
| ARM | `dreg` | None | `d0` | `P` |
611619
| ARM | `qreg` | None | `q0` | `q` |
612620
| ARM | `qreg` | `e` / `f` | `d0` / `d1` | `e` / `f` |
621+
| NVPTX | `reg16` | None | `rs0` | None |
622+
| NVPTX | `reg32` | None | `r0` | None |
623+
| NVPTX | `reg64` | None | `rd0` | None |
613624
| RISC-V | `reg` | None | `x1` | None |
614625
| RISC-V | `freg` | None | `f0` | None |
615626

0 commit comments

Comments
 (0)