]> git.ipfire.org Git - thirdparty/gcc.git/commit
[PATCH] RISC-V: Implment H modifier for printing the next register name
authorJin Ma <jinma@linux.alibaba.com>
Sun, 4 May 2025 14:44:27 +0000 (08:44 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Sun, 4 May 2025 14:44:27 +0000 (08:44 -0600)
commit89e58171bae30eacf5e8a281eb4758b2712aeed2
treece3392edae655d65ab2e6b40dc8f150005a5659f
parent005424e3337a3234f95755e57ee41c061b6e4185
[PATCH] RISC-V: Implment H modifier for printing the next register name

For RV32 inline assembly, when handling 64-bit integer data, it is
often necessary to process the lower and upper 32 bits separately.
Unfortunately, we can only output the current register name
(lower 32 bits) but not the next register name (upper 32 bits).

To address this, the modifier 'H' has been added to allow users
to handle the upper 32 bits of the data. While I believe the
modifier 'N' (representing the next register name) might be more
suitable for this functionality, 'N' is already in use.
Therefore, 'H' (representing the high register) was chosen instead.

Co-Authored-By: Dimitar Dimitrov <dimitar@dinux.eu>
gcc/ChangeLog:

* config/riscv/riscv.cc (riscv_print_operand): Add H.
* doc/extend.texi: Document for H.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/modifier-H-error-1.c: New test.
* gcc.target/riscv/modifier-H-error-2.c: New test.
* gcc.target/riscv/modifier-H.c: New test.
gcc/config/riscv/riscv.cc
gcc/doc/extend.texi
gcc/testsuite/gcc.target/riscv/modifier-H-error-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/modifier-H-error-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/modifier-H.c [new file with mode: 0644]