在 2025/5/21 下午3:14, Xi Ruoyao 写道:
The kernel developers have requested such a constraint to use csrxchg
in inline assembly.

gcc/ChangeLog:

        * doc/md.texi: Document the 'q' constraint for LoongArch.
---

Ok for trunk?

LGTM!

Thanks!


  gcc/doc/md.texi | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
index 1a1c1b73089..2a1f9919c5b 100644
--- a/gcc/doc/md.texi
+++ b/gcc/doc/md.texi
@@ -2918,6 +2918,9 @@ A signed 16-bit constant.
  A memory operand whose address is formed by a base register and offset
  that is suitable for use in instructions with the same addressing mode
  as @code{st.w} and @code{ld.w}.
+@item q
+A general-purpose register except for $r0 and $r1 (for the csrxchg
+instruction)
  @item I
  A signed 12-bit constant (for arithmetic instructions).
  @item K

Reply via email to