Check CPU features in the Simulator and Disassembler.
This is implemented using a new decoder visitor, CPUFeaturesAuditor. This visitor holds a set of features required by the last-decoded instruction, a set of features seen since construction (or 'ResetSeenFeatures()'), and a set of features that are considered to be available. This visitor can be used by itself, but its main purpose is to implement Simulator and Disassembler support for CPUFeatures: - The Simulator creates and attaches this visitor automatically, much like it does for the disassembly trace, so existing simulation use-cases require no special user interaction. The Simulator checks that each encountered instruction only uses available features. The Simulator also supports dynamic configuration of features, in a manner similar to the trace controls. - The Disassembler does not directly interact with the CPUFeaturesAuditor, but the PrintDisassembler can be configured to annotate each instruction with required features that are missing from GetAvailableFeatures(). The PrintDisassembler is used to implement Simulator trace, so a simulation failure due to missing feature support will be immediately preceeded by a corresponding PrintDisassembler annotation (when trace is enabled). No existing test uses the PrintDisassembler in this way, so this patch also adds 'TRACE_' tests to check that the features are appropriately formatted. Change-Id: I3dc0e22f0a5bd3287ba1870539e018ff4a768a4b
Loading
Please register or sign in to comment