types.hh (10924:d02e9c239892) types.hh (11168:f98eb2da15a4)
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 31 unchanged lines hidden (view full) ---

40#ifndef __ARCH_X86_TYPES_HH__
41#define __ARCH_X86_TYPES_HH__
42
43#include <iostream>
44
45#include "arch/generic/types.hh"
46#include "base/bitunion.hh"
47#include "base/cprintf.hh"
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 31 unchanged lines hidden (view full) ---

40#ifndef __ARCH_X86_TYPES_HH__
41#define __ARCH_X86_TYPES_HH__
42
43#include <iostream>
44
45#include "arch/generic/types.hh"
46#include "base/bitunion.hh"
47#include "base/cprintf.hh"
48#include "base/hashmap.hh"
49#include "base/types.hh"
50#include "sim/serialize.hh"
51
52namespace X86ISA
53{
54 //This really determines how many bytes are passed to the decoder.
55 typedef uint64_t MachInst;
56

--- 284 unchanged lines hidden (view full) ---

341 {
342 Base::unserialize(cp);
343 UNSERIALIZE_SCALAR(_size);
344 }
345 };
346
347}
348
48#include "base/types.hh"
49#include "sim/serialize.hh"
50
51namespace X86ISA
52{
53 //This really determines how many bytes are passed to the decoder.
54 typedef uint64_t MachInst;
55

--- 284 unchanged lines hidden (view full) ---

340 {
341 Base::unserialize(cp);
342 UNSERIALIZE_SCALAR(_size);
343 }
344 };
345
346}
347
349__hash_namespace_begin
348namespace std {
350 template<>
351 struct hash<X86ISA::ExtMachInst> {
352 size_t operator()(const X86ISA::ExtMachInst &emi) const {
353 return (((uint64_t)emi.legacy << 40) |
354 ((uint64_t)emi.rex << 32) |
355 ((uint64_t)emi.modRM << 24) |
356 ((uint64_t)emi.sib << 16) |
357 ((uint64_t)emi.opcode.type << 8) |
358 ((uint64_t)emi.opcode.op)) ^
359 emi.immediate ^ emi.displacement ^
360 emi.mode ^
361 emi.opSize ^ emi.addrSize ^
362 emi.stackSize ^ emi.dispSize;
363 };
364 };
349 template<>
350 struct hash<X86ISA::ExtMachInst> {
351 size_t operator()(const X86ISA::ExtMachInst &emi) const {
352 return (((uint64_t)emi.legacy << 40) |
353 ((uint64_t)emi.rex << 32) |
354 ((uint64_t)emi.modRM << 24) |
355 ((uint64_t)emi.sib << 16) |
356 ((uint64_t)emi.opcode.type << 8) |
357 ((uint64_t)emi.opcode.op)) ^
358 emi.immediate ^ emi.displacement ^
359 emi.mode ^
360 emi.opSize ^ emi.addrSize ^
361 emi.stackSize ^ emi.dispSize;
362 };
363 };
365__hash_namespace_end
364}
366
367// These two functions allow ExtMachInst to be used with SERIALIZE_SCALAR
368// and UNSERIALIZE_SCALAR.
369template <>
370void
371paramOut(CheckpointOut &cp, const std::string &name,
372 const X86ISA::ExtMachInst &machInst);
373template <>
374void
375paramIn(CheckpointIn &cp, const std::string &name,
376 X86ISA::ExtMachInst &machInst);
377
378#endif // __ARCH_X86_TYPES_HH__
365
366// These two functions allow ExtMachInst to be used with SERIALIZE_SCALAR
367// and UNSERIALIZE_SCALAR.
368template <>
369void
370paramOut(CheckpointOut &cp, const std::string &name,
371 const X86ISA::ExtMachInst &machInst);
372template <>
373void
374paramIn(CheckpointIn &cp, const std::string &name,
375 X86ISA::ExtMachInst &machInst);
376
377#endif // __ARCH_X86_TYPES_HH__