Skip to content

Commit 456c914

Browse files
lenaryLiaoshihua
authored andcommitted
fixup! Inline Asm Constraints and Modifiers
1 parent 0ae8d7e commit 456c914

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/c-api.adoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,7 @@ Sign extension of 32-bit values on RV64 is not reflected in the interface.
732732

733733
This section lists operand constraints that can be used with inline assembly
734734
statements, including both RISC-V specific and common operand constraints.
735+
Operand constraints are case-sensitive.
735736

736737
"Floating-point register" in both the `f` and `cf` rows means "a register
737738
suitable for passing a floating-point value", so when using the `Zfinx`,
@@ -753,21 +754,22 @@ to aid portability of floating-point code.
753754
|s |symbol or label reference with a constant offset |
754755
|cr |RVC general purpose register (`x8`-`x15`) |
755756
|cf |RVC floating-point register (`f8`-`f15` or `x8-x15` with `Zfinx`) |
756-
|Pr |Even-odd general purpose register pair |
757+
|R |Even-odd general purpose register pair |
757758
|vr |Vector register |
758759
|vd |Vector register, excluding v0 |
759760
|vm |Vector register, only v0 |
760761
|===
761762

762-
The `Pr` constraint should print as the even register in the pair, as this
763+
The `R` constraint should print as the even register in the pair, as this
763764
matches how the `amocas.q` instruction (on RV64) or the `amocas.d` and `Zdinx`
764765
instructions (on RV32) expect to parse their pair register operands. However,
765766
both registers in the pair should be considered to be live or clobbered
766767
together.
767768

768769
NOTE: Immediate value must be a compile-time constant.
769770

770-
NOTE: The `c*` and `P*` constraints are designed to be extensible to more kinds of registers in the future.
771+
NOTE: The `c*` constraints are designed to be extensible to more kinds of
772+
RVC-compatible register constraints in the future.
771773

772774
=== The Difference Between `m` and `A` Constraints
773775

0 commit comments

Comments
 (0)