Skip to content

Commit

Permalink
RISC-V: Add TARGET_MIN_VLEN > 4096 check
Browse files Browse the repository at this point in the history
gcc/ChangeLog:

        * config/riscv/riscv.cc (riscv_option_override): Add sorry check.

gcc/testsuite/ChangeLog:

        * gcc.target/riscv/rvv/base/zvl-unimplemented-1.c: New test.
        * gcc.target/riscv/rvv/base/zvl-unimplemented-2.c: New test.
  • Loading branch information
zhongjuzhe authored and ouuleilei-bot committed Jul 17, 2023
1 parent c2d62cd commit 8fb239c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gcc/config/riscv/riscv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6544,6 +6544,14 @@ riscv_option_override (void)
riscv_stack_protector_guard_offset = offs;
}

/* FIXME: We don't allow TARGET_MIN_VLEN > 4096 since the datatypes of
both GET_MODE_SIZE and GET_MODE_BITSIZE are poly_uint16.
We can only allow TARGET_MIN_VLEN * 8 (LMUL) < 65535. */
if (TARGET_MIN_VLEN > 4096)
sorry (
"Current RISC-V GCC can not support VLEN > 4096bit for 'V' Extension");

/* Convert -march to a chunks count. */
riscv_vector_chunks = riscv_convert_vector_bits ();
}
Expand Down
4 changes: 4 additions & 0 deletions gcc/testsuite/gcc.target/riscv/rvv/base/zvl-unimplemented-1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* { dg-do compile } */
/* { dg-options "-O3 -march=rv64gcv_zvl8192b -mabi=lp64d --param riscv-autovec-preference=fixed-vlmax" } */

void foo () {} // { dg-excess-errors "sorry, unimplemented: Current RISC-V GCC can not support VLEN > 4096bit for 'V' Extension" }
4 changes: 4 additions & 0 deletions gcc/testsuite/gcc.target/riscv/rvv/base/zvl-unimplemented-2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* { dg-do compile } */
/* { dg-options "-O3 -march=rv64gcv_zvl8192b -mabi=lp64d --param riscv-autovec-preference=scalable" } */

void foo () {} // { dg-excess-errors "sorry, unimplemented: Current RISC-V GCC can not support VLEN > 4096bit for 'V' Extension" }

0 comments on commit 8fb239c

Please sign in to comment.