diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/common/config/riscv/riscv-common.cc | 23 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/riscv/arch-18.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/riscv/arch-5.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/riscv/predef-23.c | 63 |
4 files changed, 77 insertions, 16 deletions
diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc index dead3802..d77020b 100644 --- a/gcc/common/config/riscv/riscv-common.cc +++ b/gcc/common/config/riscv/riscv-common.cc @@ -145,6 +145,8 @@ static const struct riscv_ext_version riscv_ext_version_table[] = {"c", ISA_SPEC_CLASS_20190608, 2, 0}, {"c", ISA_SPEC_CLASS_2P2, 2, 0}, + {"h", ISA_SPEC_CLASS_NONE, 1, 0}, + {"v", ISA_SPEC_CLASS_NONE, 1, 0}, {"zicsr", ISA_SPEC_CLASS_20191213, 2, 0}, @@ -361,21 +363,18 @@ multi_letter_subset_rank (const std::string &subset) gcc_assert (subset.length () >= 2); int high_order = -1; int low_order = 0; - /* The order between multi-char extensions: s -> h -> z -> x. */ + /* The order between multi-char extensions: s -> z -> x. */ char multiletter_class = subset[0]; switch (multiletter_class) { case 's': high_order = 0; break; - case 'h': - high_order = 1; - break; case 'z': - high_order = 2; + high_order = 1; break; case 'x': - high_order = 3; + high_order = 2; break; default: gcc_unreachable (); @@ -671,7 +670,7 @@ riscv_subset_list::lookup (const char *subset, int major_version, static const char * riscv_supported_std_ext (void) { - return "mafdqlcbkjtpvn"; + return "mafdqlcbkjtpvnh"; } /* Parsing subset version. @@ -830,7 +829,7 @@ riscv_subset_list::parse_std_ext (const char *p) { char subset[2] = {0, 0}; - if (*p == 'x' || *p == 's' || *p == 'h' || *p == 'z') + if (*p == 'x' || *p == 's' || *p == 'z') break; if (*p == '_') @@ -955,7 +954,7 @@ riscv_subset_list::handle_combine_ext () Arguments: `p`: Current parsing position. - `ext_type`: What kind of extensions, 's', 'h', 'z' or 'x'. + `ext_type`: What kind of extensions, 's', 'z' or 'x'. `ext_type_str`: Full name for kind of extension. */ const char * @@ -1097,12 +1096,6 @@ riscv_subset_list::parse (const char *arch, location_t loc) if (p == NULL) goto fail; - /* Parsing hypervisor extension. */ - p = subset_list->parse_multiletter_ext (p, "h", "hypervisor extension"); - - if (p == NULL) - goto fail; - /* Parsing sub-extensions. */ p = subset_list->parse_multiletter_ext (p, "z", "sub-extension"); diff --git a/gcc/testsuite/gcc.target/riscv/arch-18.c b/gcc/testsuite/gcc.target/riscv/arch-18.c new file mode 100644 index 0000000..bb04536 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/arch-18.c @@ -0,0 +1,5 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -march=rv32gcvh -mabi=ilp32 -mcmodel=medlow" } */ +int foo() +{ +} diff --git a/gcc/testsuite/gcc.target/riscv/arch-5.c b/gcc/testsuite/gcc.target/riscv/arch-5.c index 2a0f3b78..b945a64 100644 --- a/gcc/testsuite/gcc.target/riscv/arch-5.c +++ b/gcc/testsuite/gcc.target/riscv/arch-5.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-march=rv32isabc_hghi_zfoo_xbar -mabi=ilp32" } */ +/* { dg-options "-march=rv32isabc_zfoo_xbar -mabi=ilp32" } */ int foo() { } diff --git a/gcc/testsuite/gcc.target/riscv/predef-23.c b/gcc/testsuite/gcc.target/riscv/predef-23.c new file mode 100644 index 0000000..676023f2 --- /dev/null +++ b/gcc/testsuite/gcc.target/riscv/predef-23.c @@ -0,0 +1,63 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -march=rv64ih_zfhmin -mabi=lp64f -mcmodel=medlow -misa-spec=20191213" } */ + +int main () { + +#ifndef __riscv_arch_test +#error "__riscv_arch_test" +#endif + +#if __riscv_xlen != 64 +#error "__riscv_xlen" +#endif + +#if !defined(__riscv_i) +#error "__riscv_i" +#endif + +#if defined(__riscv_c) +#error "__riscv_c" +#endif + +#if defined(__riscv_e) +#error "__riscv_e" +#endif + +#if defined(__riscv_a) +#error "__riscv_a" +#endif + +#if defined(__riscv_m) +#error "__riscv_m" +#endif + +#if !defined(__riscv_f) +#error "__riscv_f" +#endif + +#if defined(__riscv_d) +#error "__riscv_d" +#endif + +#if defined(__riscv_v) +#error "__riscv_v" +#endif + +#if defined(__riscv_zfh) +#error "__riscv_zfh" +#endif + +#if !defined(__riscv_zfhmin) +#error "__riscv_zfhmin" +#endif + +#if !defined(__riscv_zicsr) +#error "__riscv_zicsr" +#endif + +#if !defined(__riscv_h) +#error "__riscv_h" +#endif + + return 0; +} |