From: Andrew Waterman Date: Fri, 11 Sep 2015 22:13:08 +0000 (-0700) Subject: Support 'G' in ISA strings X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=17f497c7e2dabb130ef585a6b918663dc770a72a;p=riscv-isa-sim.git Support 'G' in ISA strings It's the same as IMAFD. --- diff --git a/riscv/processor.cc b/riscv/processor.cc index d1e7ce3..e14859e 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -59,6 +59,7 @@ void processor_t::parse_isa_string(const char* isa) { const char* p = isa; const char* all_subsets = "IMAFDC"; + std::string tmp; max_xlen = 64; cpuid = reg_t(2) << 62; @@ -70,12 +71,16 @@ void processor_t::parse_isa_string(const char* isa) else if (strncmp(p, "RV", 2) == 0) p += 2; - cpuid |= 1L << ('S' - 'A'); // advertise support for supervisor mode - - if (!*p) + if (!*p) { p = all_subsets; - else if (*p != 'I') + } else if (*p == 'G') { // treat "G" as "IMAFD" + tmp = std::string("IMAFD") + (p+1); + p = &tmp[0]; + } else if (*p != 'I') { bad_isa_string(isa); + } + + cpuid |= 1L << ('S' - 'A'); // advertise support for supervisor mode while (*p) { cpuid |= 1L << (*p - 'A');