{NULL, ISA_SPEC_CLASS_NONE, 0, 0}
};
+/* Combine extensions defined in this table */
+static const struct riscv_ext_version riscv_combine_info[] =
+{
+ {"zk", ISA_SPEC_CLASS_NONE, 1, 0},
+ {"zkn", ISA_SPEC_CLASS_NONE, 1, 0},
+ {"zks", ISA_SPEC_CLASS_NONE, 1, 0},
+ /* Terminate the list. */
+ {NULL, ISA_SPEC_CLASS_NONE, 0, 0}
+};
+
static const riscv_cpu_info riscv_cpu_tables[] =
{
#define RISCV_CORE(CORE_NAME, ARCH, TUNE) \
}
}
+/* Check any combine extensions for EXT. */
+void
+riscv_subset_list::handle_combine_ext ()
+{
+ const riscv_ext_version *combine_info;
+ const riscv_implied_info_t *implied_info;
+ bool is_combined = false;
+
+ for (combine_info = &riscv_combine_info[0]; combine_info->name;
+ ++combine_info)
+ {
+ /* Skip if combine extensions are present */
+ if (lookup (combine_info->name))
+ continue;
+
+ /* Find all extensions of the combine extension */
+ for (implied_info = &riscv_implied_info[0]; implied_info->ext;
+ ++implied_info)
+ {
+ /* Skip if implied extension don't match combine extension */
+ if (strcmp (combine_info->name, implied_info->ext) != 0)
+ continue;
+
+ if (lookup (implied_info->implied_ext))
+ is_combined = true;
+ else
+ {
+ is_combined = false;
+ break;
+ }
+ }
+
+ /* Add combine extensions */
+ if (is_combined)
+ {
+ if (lookup (combine_info->name) == NULL)
+ {
+ add (combine_info->name, combine_info->major_version,
+ combine_info->minor_version, false, true);
+ }
+ }
+ }
+}
+
/* Parsing function for multi-letter extensions.
Return Value:
subset_list->handle_implied_ext (itr);
}
+ subset_list->handle_combine_ext ();
+
return subset_list;
fail:
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-march=rv64i_zbkb_zbkc_zbkx_zknd_zkne_zknh_zksed_zksh_zkr_zkt -mabi=lp64 -mcmodel=medlow -misa-spec=2.2" } */
+
+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_zk)
+#error "__riscv_zk"
+#endif
+
+#if !defined(__riscv_zkr)
+#error "__riscv_zkr"
+#endif
+
+#if !defined(__riscv_zkn)
+#error "__riscv_zkn"
+#endif
+
+#if !defined(__riscv_zks)
+#error "__riscv_zks"
+#endif
+
+#if !defined(__riscv_zbkb)
+#error "__riscv_zbkb"
+#endif
+
+#if !defined(__riscv_zbkc)
+#error "__riscv_zbkc"
+#endif
+
+#if !defined(__riscv_zbkx)
+#error "__riscv_zbkx"
+#endif
+
+#if !defined(__riscv_zknd)
+#error "__riscv_zknd"
+#endif
+
+#if !defined(__riscv_zkne)
+#error "__riscv_zkne"
+#endif
+
+#if !defined(__riscv_zknh)
+#error "__riscv_zknh"
+#endif
+
+#if !defined(__riscv_zksh)
+#error "__riscv_zksh"
+#endif
+
+ return 0;
+}