On 8/18/23 13:56, Palmer Dabbelt wrote:
On Fri, 18 Aug 2023 12:37:06 PDT (-0700), rdapp....@gmail.com wrote:
Hi,

this patch adds a missing constraint check in order to be able to
print (and not ICE) vector immediates 17-31 for vector shifts.

Regards
 Robin

gcc/ChangeLog:

    * config/riscv/riscv.cc (riscv_print_operand):

gcc/testsuite/ChangeLog:

    * gcc.target/riscv/rvv/autovec/binop/shift-immediate.c: New test.
---
 gcc/config/riscv/riscv.cc                        |  3 ++-
 .../riscv/rvv/autovec/binop/shift-immediate.c    | 16 ++++++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/shift-immediate.c

diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 49062bef9fc..0f60ffe5f60 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -4954,7 +4954,8 @@ riscv_print_operand (FILE *file, rtx op, int letter)

Looks like the comment at the top of riscv_print_operand() is way out of date.  Maybe we should just toss it?
I think it's been out of date on every port I've ever worked on! Folks start with good intentions, but nobody seems to keep this up-to-date.

So +1 to removing it if someone wants to. I'll even pre-approve such a patch. I'll also pre-approve a patch which brings it up-to-date if that's the direction we want to go.

jeff

Reply via email to