]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Add TARGET_MIN_VLEN_OPTS to fix the build
authorKito Cheng <kito.cheng@sifive.com>
Wed, 11 Oct 2023 23:18:00 +0000 (16:18 -0700)
committerKito Cheng <kito.cheng@sifive.com>
Wed, 11 Oct 2023 23:20:31 +0000 (16:20 -0700)
gcc/ChangeLog:

* config/riscv/riscv-opts.h (TARGET_MIN_VLEN_OPTS): New.

gcc/config/riscv/riscv-opts.h

index e7c6b75c5ea111092578049727eaad88d7d90b69..31ee42dea6bd3273756691c44c239541b4c7ac08 100644 (file)
@@ -112,6 +112,12 @@ enum riscv_entity
    ? 0 \
    : 32 << (__builtin_popcount (riscv_zvl_flags) - 1))
 
+/* Same as TARGET_MIN_VLEN, but take an OPTS as gcc_options.  */
+#define TARGET_MIN_VLEN_OPTS(opts)                                             \
+  ((opts->x_riscv_zvl_flags == 0)                                              \
+     ? 0                                                                       \
+     : 32 << (__builtin_popcount (opts->x_riscv_zvl_flags) - 1))
+
 /* We only enable VLS modes for VLA vectorization since fixed length VLMAX mode
    is the highest priority choice and should not conflict with VLS modes.  */
 #define TARGET_VECTOR_VLS                                                      \