summaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/types.hh21
-rw-r--r--src/arch/x86/utility.hh20
2 files changed, 21 insertions, 20 deletions
diff --git a/src/arch/x86/types.hh b/src/arch/x86/types.hh
index 35799e0c9..2a0da7d65 100644
--- a/src/arch/x86/types.hh
+++ b/src/arch/x86/types.hh
@@ -44,6 +44,7 @@
#include "base/bitunion.hh"
#include "base/cprintf.hh"
+#include "base/hashmap.hh"
#include "base/types.hh"
#include "sim/serialize.hh"
@@ -225,6 +226,26 @@ namespace X86ISA
};
};
+namespace __hash_namespace {
+ template<>
+ struct hash<X86ISA::ExtMachInst> {
+ size_t operator()(const X86ISA::ExtMachInst &emi) const {
+ return (((uint64_t)emi.legacy << 56) |
+ ((uint64_t)emi.rex << 48) |
+ ((uint64_t)emi.modRM << 40) |
+ ((uint64_t)emi.sib << 32) |
+ ((uint64_t)emi.opcode.num << 24) |
+ ((uint64_t)emi.opcode.prefixA << 16) |
+ ((uint64_t)emi.opcode.prefixB << 8) |
+ ((uint64_t)emi.opcode.op)) ^
+ emi.immediate ^ emi.displacement ^
+ emi.mode ^
+ emi.opSize ^ emi.addrSize ^
+ emi.stackSize ^ emi.dispSize;
+ };
+ };
+}
+
// These two functions allow ExtMachInst to be used with SERIALIZE_SCALAR
// and UNSERIALIZE_SCALAR.
template <>
diff --git a/src/arch/x86/utility.hh b/src/arch/x86/utility.hh
index db03da7a0..bfa102529 100644
--- a/src/arch/x86/utility.hh
+++ b/src/arch/x86/utility.hh
@@ -50,26 +50,6 @@
class ThreadContext;
-namespace __hash_namespace {
- template<>
- struct hash<X86ISA::ExtMachInst> {
- size_t operator()(const X86ISA::ExtMachInst &emi) const {
- return (((uint64_t)emi.legacy << 56) |
- ((uint64_t)emi.rex << 48) |
- ((uint64_t)emi.modRM << 40) |
- ((uint64_t)emi.sib << 32) |
- ((uint64_t)emi.opcode.num << 24) |
- ((uint64_t)emi.opcode.prefixA << 16) |
- ((uint64_t)emi.opcode.prefixB << 8) |
- ((uint64_t)emi.opcode.op)) ^
- emi.immediate ^ emi.displacement ^
- emi.mode ^
- emi.opSize ^ emi.addrSize ^
- emi.stackSize ^ emi.dispSize;
- };
- };
-}
-
namespace X86ISA
{
uint64_t getArgument(ThreadContext *tc, int number, bool fp);