From 17f497c7e2dabb130ef585a6b918663dc770a72a Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Fri, 11 Sep 2015 15:13:08 -0700 Subject: [PATCH] Support 'G' in ISA strings It's the same as IMAFD. --- riscv/processor.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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'); -- 2.30.2