From ba6b8389ee72e17a6b966f2af24e80b2cff83e48 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 16 Jul 2009 09:29:29 -0700 Subject: X86: Take limitted advantage of the compilers type checking for microop operands. --- src/arch/x86/insts/static_inst.hh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/arch/x86/insts/static_inst.hh') diff --git a/src/arch/x86/insts/static_inst.hh b/src/arch/x86/insts/static_inst.hh index 8480f2713..4ca7a4984 100644 --- a/src/arch/x86/insts/static_inst.hh +++ b/src/arch/x86/insts/static_inst.hh @@ -63,6 +63,18 @@ namespace X86ISA { + /** + * Class for register indices passed to instruction constructors. Using a + * wrapper struct for these lets take advantage of the compiler's type + * checking. + */ + struct InstRegIndex + { + RegIndex idx; + explicit InstRegIndex(RegIndex _idx) : idx(_idx) + {} + }; + /** * Base class for all X86 static instructions. */ -- cgit v1.2.3