summaryrefslogtreecommitdiff
path: root/src/arch/x86/utility.hh
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-04-04 14:27:00 +0000
committerGabe Black <gblack@eecs.umich.edu>2007-04-04 14:27:00 +0000
commit65fedeb5a7fd6ebb25379e20845f75635f28fdb6 (patch)
tree1c4d40eda67d7b8b27c95cdd498df05c1c313b85 /src/arch/x86/utility.hh
parent6010c6ded4e6d6c2cdaf5ac08678165580a29008 (diff)
downloadgem5-65fedeb5a7fd6ebb25379e20845f75635f28fdb6.tar.xz
Made x86 ExtMachInsts distinguishable from each other by defining a real == and a real hash function.
--HG-- extra : convert_revision : 30f29a36f6ab44e67e62aaf81b685fbe1267c746
Diffstat (limited to 'src/arch/x86/utility.hh')
-rw-r--r--src/arch/x86/utility.hh11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/arch/x86/utility.hh b/src/arch/x86/utility.hh
index d89e223de..e0bd09515 100644
--- a/src/arch/x86/utility.hh
+++ b/src/arch/x86/utility.hh
@@ -70,8 +70,15 @@ namespace __hash_namespace {
template<>
struct hash<X86ISA::ExtMachInst> {
size_t operator()(const X86ISA::ExtMachInst &emi) const {
- //Because these are all the same, return 0
- return 0;
+ 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;
};
};
}