diff --git a/src/compiler/isaspec/isa.py b/src/compiler/isaspec/isa.py index dda0b7c84b0..e208e776ecb 100644 --- a/src/compiler/isaspec/isa.py +++ b/src/compiler/isaspec/isa.py @@ -561,7 +561,7 @@ class ISA(object): # Validate that all bitset fields have valid types, and in # the case of bitset type, the sizes match: - builtin_types = ['branch', 'absbranch', 'int', 'uint', 'hex', 'offset', 'uoffset', 'float', 'bool', 'enum', 'custom'] + builtin_types = ['branch', 'absbranch', 'int', 'uint', 'hex', 'offset', 'uoffset', 'float', 'bool', 'bool_inv', 'enum', 'custom'] for bitset_name, bitset in self.bitsets.items(): if bitset.extends is not None: assert bitset.extends in self.bitsets, "{} extends invalid type: {}".format( diff --git a/src/compiler/isaspec/isaspec_decode_decl.h b/src/compiler/isaspec/isaspec_decode_decl.h index 1c6794c4d37..968163e7212 100644 --- a/src/compiler/isaspec/isaspec_decode_decl.h +++ b/src/compiler/isaspec/isaspec_decode_decl.h @@ -102,6 +102,7 @@ struct isa_field { TYPE_UOFFSET, /* Like UINT but formated with + or omitted if ==0 */ TYPE_FLOAT, TYPE_BOOL, + TYPE_BOOL_INV, /* Like BOOL but inverted */ TYPE_ENUM, /* For fields that must be printed via a user-provided callback */ diff --git a/src/compiler/isaspec/isaspec_decode_impl.c b/src/compiler/isaspec/isaspec_decode_impl.c index 61bbd971eb7..5a7afc94c90 100644 --- a/src/compiler/isaspec/isaspec_decode_impl.c +++ b/src/compiler/isaspec/isaspec_decode_impl.c @@ -686,6 +686,16 @@ display_field(struct decode_scope *scope, const char *field_name) isa_print(print, "%u", (unsigned)val); } break; + case TYPE_BOOL_INV: { + if (field->display) { + if (!val) { + isa_print(print, "%s", field->display); + } + } else { + isa_print(print, "%u", (unsigned)!val); + } + break; + } case TYPE_ENUM: display_enum_field(scope, field, v); break;