@@ -168,14 +168,6 @@ static const riscv_implied_info_t riscv_implied_info[] =
{"zvksg", "zvks"},
{"zvksg", "zvkg"},
{"zvbb", "zvkb"},
- {"zvbc", "zve64x"},
- {"zvkb", "zve32x"},
- {"zvkg", "zve32x"},
- {"zvkned", "zve32x"},
- {"zvknha", "zve32x"},
- {"zvknhb", "zve64x"},
- {"zvksed", "zve32x"},
- {"zvksh", "zve32x"},
{"zfbfmin", "zfhmin"},
{"zfh", "zfhmin"},
@@ -82,14 +82,6 @@ IMPLIED_EXT = {
"zvksc" : ["zvks", "zvbc"],
"zvksg" : ["zvks", "zvkg"],
"zvbb" : ["zvkb"],
- "zvbc" : ["zve64x"],
- "zvkb" : ["zve32x"],
- "zvkg" : ["zve32x"],
- "zvkned" : ["zve32x"],
- "zvknha" : ["zve32x"],
- "zvknhb" : ["zve64x"],
- "zvksed" : ["zve32x"],
- "zvksh" : ["zve32x"],
}
def arch_canonicalize(arch, isa_spec):
@@ -9691,6 +9691,20 @@ riscv_override_options_internal (struct gcc_options *opts)
else if (!TARGET_MUL_OPTS_P (opts) && TARGET_DIV_OPTS_P (opts))
error ("%<-mdiv%> requires %<-march%> to subsume the %<M%> extension");
+ /* ZVK* extensions require v or zve* extension. */
+ if (TARGET_ZVBB && !TARGET_VECTOR)
+ error ("zvbb extension requires v or zve32 extension");
+
+ if (TARGET_ZVBC && !TARGET_VECTOR_ELEN_64)
+ error ("zvbc extension requires v or zve64 extension");
+
+ if (TARGET_ZVKNHB && !TARGET_VECTOR_ELEN_64)
+ error ("zvknhb extension requires v or zve64 extension");
+
+ if ((TARGET_ZVKB || TARGET_ZVKG || TARGET_ZVKNED ||TARGET_ZVKNHA
+ || TARGET_ZVKSED || TARGET_ZVKSH) && !TARGET_VECTOR)
+ error ("zvk extensions requires v or zve32 extension");
+
/* We might use a multiplication to calculate the scalable vector length at
runtime. Therefore, require the M extension. */
if (TARGET_VECTOR && !TARGET_MUL)
new file mode 100644
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gc_zvbb_zbkb" { target { rv64 } } } */
+/* { dg-options "-march=rv32gc_zvbb_zbkb" { target { rv32 } } } */
+int foo()
+{
+}
+
+/* { dg-error "zvbb extension requires v or zve32 extension" "" { target *-*-* } 0 } */
+/* { dg-error "zvk extensions requires v or zve32 extension" "" { target *-*-* } 0 } */
new file mode 100644
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gc_zvbc" { target { rv64 } } } */
+/* { dg-options "-march=rv32gc_zvbc" { target { rv32 } } } */
+int foo()
+{
+}
+
+/* { dg-error "zvbc extension requires v or zve64 extension" "" { target *-*-* } 0 } */
new file mode 100644
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gc_zvknhb" { target { rv64 } } } */
+/* { dg-options "-march=rv32gc_zvknhb" { target { rv32 } } } */
+int foo()
+{
+}
+
+/* { dg-error "zvknhb extension requires v or zve64 extension" "" { target *-*-* } 0 } */
new file mode 100644
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gc_zvkb_zvkned_zvknha_zvksed_zvksh_zvkg" { target { rv64 } } } */
+/* { dg-options "-march=rv32gc_zvkb_zvkned_zvknha_zvksed_zvksh_zvkg" { target { rv32 } } } */
+int foo()
+{
+}
+
+/* { dg-error "zvk extensions requires v or zve32 extension" "" { target *-*-* } 0 } */
@@ -1,6 +1,6 @@
/* Test that we do not have error when compile */
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc -mabi=lp64d -O3" } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */
#include "riscv_vector.h"
@@ -1,6 +1,6 @@
/* Test that we do not have error when compile */
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc -mabi=lp64d -O3" } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */
#include "riscv_vector.h"
@@ -1,6 +1,6 @@
/* Test that we do not have error when compile */
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc -mabi=lp64d -O3" } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */
#include "riscv_vector.h"
@@ -1,6 +1,6 @@
/* Test that we do not have error when compile */
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc -mabi=lp64d -O3" } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */
#include "riscv_vector.h"
@@ -1,6 +1,6 @@
/* Test that we do not have error when compile */
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc -mabi=lp64d -O3" } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */
#include "riscv_vector.h"
@@ -1,6 +1,6 @@
/* Test that we do not have error when compile */
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc -mabi=lp64d -O3" } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */
#include "riscv_vector.h"
@@ -1,6 +1,6 @@
/* Test that we do not have error when compile */
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc -mabi=lp64d -O3" } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */
#include "riscv_vector.h"
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvbc -mabi=lp64d -O2" } */
+/* { dg-options "-march=rv64gc_zvbc_zve64x -mabi=lp64d -O2" } */
#include "riscv_vector.h"
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv32gc_zvbc -mabi=ilp32 -O3" } */
+/* { dg-options "-march=rv32gc_zvbc_zve64x -mabi=ilp32d -O3" } */
#include "riscv_vector.h"
vuint64m1_t test_vclmul_vx_u64m1(vuint64m1_t vs2, uint64_t rs1, size_t vl) {
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvbc -mabi=lp64d -O3" } */
+/* { dg-options "-march=rv64gc_zvbc_zve64x -mabi=lp64d -O3" } */
#include "riscv_vector.h"
vuint64m1_t test_vclmul_vx_u64m1_extend(vuint64m1_t vs2, uint32_t rs1, size_t vl) {
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvknhb -mabi=lp64d -O2" } */
+/* { dg-options "-march=rv64gc_zvknhb_zve64x -mabi=lp64d -O2" } */
#include "riscv_vector.h"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvbb" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvbb" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvbb" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvbb" { target { rv32 } } } */
#ifndef __riscv_zvbb
#error "Feature macro not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvbc" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvbc" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvbc" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvbc" { target { rv32 } } } */
#ifndef __riscv_zvbc
#error "Feature macro not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvkb" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvkb" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvkb" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvkb" { target { rv32 } } } */
#ifndef __riscv_zvkb
#error "Feature macro not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvkg" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvkg" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvkg" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvkg" { target { rv32 } } } */
#ifndef __riscv_zvkg
#error "Feature macro not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvkned_zvknhb_zvkb_zvkt" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvkned_zvknhb_zvkb_zvkt" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvkned_zvknhb_zvkb_zvkt" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvkned_zvknhb_zvkb_zvkt" { target { rv32 } } } */
#ifndef __riscv_zvkn
#error "Feature macro for `Zvkn' not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvkn" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvkn" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvkn" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvkn" { target { rv32 } } } */
#ifndef __riscv_zvkn
#error "Feature macro for `Zvkn' not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvkned_zvknhb_zvkb_zvkt_zvbc" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvkned_zvknhb_zvkb_zvkt_zvbc" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvkned_zvknhb_zvkb_zvkt_zvbc" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvkned_zvknhb_zvkb_zvkt_zvbc" { target { rv32 } } } */
#ifndef __riscv_zvknc
#error "Feature macro for `Zvknc' not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvkn_zvbc" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvkn_zvbc" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvkn_zvbc" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvkn_zvbc" { target { rv32 } } } */
#ifndef __riscv_zvknc
#error "Feature macro for `Zvknc' not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvknc" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvknc" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvknc" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvknc" { target { rv32 } } } */
#ifndef __riscv_zvknc
#error "Feature macro for `Zvknc' not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvkned" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvkned" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvkned" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvkned" { target { rv32 } } } */
#ifndef __riscv_zvkned
#error "Feature macro not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvkned_zvknhb_zvkb_zvkt_zvkg" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvkned_zvknhb_zvkb_zvkt_zvkg" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvkned_zvknhb_zvkb_zvkt_zvkg" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvkned_zvknhb_zvkb_zvkt_zvkg" { target { rv32 } } } */
#ifndef __riscv_zvkng
#error "Feature macro for `Zvkng' not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvkn_zvkg" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvkn_zvkg" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvkn_zvkg" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvkn_zvkg" { target { rv32 } } } */
#ifndef __riscv_zvkng
#error "Feature macro for `Zvkng' not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvkng" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvkng" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvkng" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvkng" { target { rv32 } } } */
#ifndef __riscv_zvkng
#error "Feature macro for `Zvkng' not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvknha" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvknha" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvknha" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvknha" { target { rv32 } } } */
#ifndef __riscv_zvknha
#error "Feature macro not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvknhb" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvknhb" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvknhb" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvknhb" { target { rv32 } } } */
#ifndef __riscv_zvknhb
#error "Feature macro not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvksed_zvksh_zvkb_zvkt" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvksed_zvksh_zvkb_zvkt" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvksed_zvksh_zvkb_zvkt" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvksed_zvksh_zvkb_zvkt" { target { rv32 } } } */
#ifndef __riscv_zvks
#error "Feature macro for `Zvks' not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvks" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvks" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvks" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvks" { target { rv32 } } } */
#ifndef __riscv_zvks
#error "Feature macro for `Zvks' not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvksed_zvksh_zvkb_zvkt_zvbc" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvksed_zvksh_zvkb_zvkt_zvbc" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvksed_zvksh_zvkb_zvkt_zvbc" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvksed_zvksh_zvkb_zvkt_zvbc" { target { rv32 } } } */
#ifndef __riscv_zvksc
#error "Feature macro for `Zvksc' not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvks_zvbc" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvks_zvbc" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvks_zvbc" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvks_zvbc" { target { rv32 } } } */
#ifndef __riscv_zvksc
#error "Feature macro for `Zvksc' not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvksc" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvksc" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvksc" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvksc" { target { rv32 } } } */
#ifndef __riscv_zvksc
#error "Feature macro for `Zvksc' not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvksed" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvksed" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvksed" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvksed" { target { rv32 } } } */
#ifndef __riscv_zvksed
#error "Feature macro not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvksed_zvksh_zvkb_zvkt_zvkg" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvksed_zvksh_zvkb_zvkt_zvkg" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvksed_zvksh_zvkb_zvkt_zvkg" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvksed_zvksh_zvkb_zvkt_zvkg" { target { rv32 } } } */
#ifndef __riscv_zvksg
#error "Feature macro for `Zvksg' not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvks_zvkg" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvks_zvkg" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvks_zvkg" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvks_zvkg" { target { rv32 } } } */
#ifndef __riscv_zvksg
#error "Feature macro for `Zvksg' not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvksg" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvksg" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvksg" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvksg" { target { rv32 } } } */
#ifndef __riscv_zvksg
#error "Feature macro for `Zvksg' not defined"
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-march=rv64gc_zvksh" { target { rv64 } } } */
-/* { dg-options "-march=rv32gc_zvksh" { target { rv32 } } } */
+/* { dg-options "-march=rv64gcv_zvksh" { target { rv64 } } } */
+/* { dg-options "-march=rv32gcv_zvksh" { target { rv32 } } } */
#ifndef __riscv_zvksh
#error "Feature macro not defined"