1/* 2 * Copyright (c) 2010 Advanced Micro Devices, Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 22 unchanged lines hidden (view full) --- 31#include "arch/x86/types.hh" 32#include "sim/serialize.hh" 33 34using namespace X86ISA; 35using namespace std; 36 37template <> 38void |
39paramOut(CheckpointOut &cp, const string &name, ExtMachInst const &machInst) |
40{ 41 // Prefixes |
42 paramOut(cp, name + ".legacy", (uint8_t)machInst.legacy); 43 paramOut(cp, name + ".rex", (uint8_t)machInst.rex); |
44 45 // Opcode |
46 paramOut(cp, name + ".opcode.type", (uint8_t)machInst.opcode.type); 47 paramOut(cp, name + ".opcode.op", (uint8_t)machInst.opcode.op); |
48 49 // Modifier bytes |
50 paramOut(cp, name + ".modRM", (uint8_t)machInst.modRM); 51 paramOut(cp, name + ".sib", (uint8_t)machInst.sib); |
52 53 // Immediate fields |
54 paramOut(cp, name + ".immediate", machInst.immediate); 55 paramOut(cp, name + ".displacement", machInst.displacement); |
56 57 // Sizes |
58 paramOut(cp, name + ".opSize", machInst.opSize); 59 paramOut(cp, name + ".addrSize", machInst.addrSize); 60 paramOut(cp, name + ".stackSize", machInst.stackSize); 61 paramOut(cp, name + ".dispSize", machInst.dispSize); |
62 63 // Mode |
64 paramOut(cp, name + ".mode", (uint8_t)machInst.mode); |
65} 66 67template <> 68void |
69paramIn(CheckpointIn &cp, const string &name, ExtMachInst &machInst) |
70{ 71 uint8_t temp8; 72 // Prefixes |
73 paramIn(cp, name + ".legacy", temp8); |
74 machInst.legacy = temp8; |
75 paramIn(cp, name + ".rex", temp8); |
76 machInst.rex = temp8; 77 78 // Opcode |
79 paramIn(cp, name + ".opcode.type", temp8); |
80 machInst.opcode.type = (OpcodeType)temp8; |
81 paramIn(cp, name + ".opcode.op", temp8); |
82 machInst.opcode.op = temp8; 83 84 // Modifier bytes |
85 paramIn(cp, name + ".modRM", temp8); |
86 machInst.modRM = temp8; |
87 paramIn(cp, name + ".sib", temp8); |
88 machInst.sib = temp8;; 89 90 // Immediate fields |
91 paramIn(cp, name + ".immediate", machInst.immediate); 92 paramIn(cp, name + ".displacement", machInst.displacement); |
93 94 // Sizes |
95 paramIn(cp, name + ".opSize", machInst.opSize); 96 paramIn(cp, name + ".addrSize", machInst.addrSize); 97 paramIn(cp, name + ".stackSize", machInst.stackSize); 98 paramIn(cp, name + ".dispSize", machInst.dispSize); |
99 100 // Mode |
101 paramIn(cp, name + ".mode", temp8); |
102 machInst.mode = temp8; 103} |