Deleted Added
sdiff udiff text old ( 4181:6edaeff44647 ) new ( 4182:5b2c0d266107 )
full compact
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * Redistribution and use of this software in source and binary forms,
6 * with or without modification, are permitted provided that the
7 * following conditions are met:
8 *

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

54 *
55 * Authors: Gabe Black
56 */
57
58#ifndef __ARCH_X86_TYPES_HH__
59#define __ARCH_X86_TYPES_HH__
60
61#include <inttypes.h>
62#include <iostream>
63
64namespace X86ISA
65{
66 //This really determines how many bytes are passed to the predecoder.
67 typedef uint64_t MachInst;
68
69 enum Prefixes {
70 NoOverride = 0,
71 CSOverride = 1,
72 DSOverride = 2,
73 ESOverride = 3,
74 FSOverride = 4,
75 GSOverride = 5,
76 SSOverride = 6,
77 //The Rex prefix obviously doesn't fit in with the above, but putting
78 //it here lets us save double the space the enums take up.
79 Rex = 7,
80 //There can be only one segment override, so they share the
81 //first 3 bits in the legacyPrefixes bitfield.
82 SegmentOverride = 0x7,
83 OperandSizeOverride = 8,
84 AddressSizeOverride = 16,
85 Lock = 32,
86 Rep = 64,
87 Repne = 128
88 };
89
90 //The intermediate structure the x86 predecoder returns.
91 struct ExtMachInst
92 {
93 public: //XXX These should be hidden in the future
94
95 uint8_t legacyPrefixes;
96 uint8_t rexPrefix;
97 bool twoByteOpcode;
98 uint8_t opcode;
99 uint64_t immediate;
100 uint64_t displacement;
101
102 public:
103
104 //These are to pacify the decoder for now. This will go away once
105 //it can handle non integer inputs, and in the mean time allow me to
106 //excercise the predecoder a little.
107 operator unsigned int()
108 {
109 return 0;
110 }
111
112 ExtMachInst(unsigned int)
113 {;}
114
115 ExtMachInst()
116 {;}
117 };
118
119 inline static std::ostream &
120 operator << (std::ostream & os, const ExtMachInst & emi)
121 {
122 os << "{X86 ExtMachInst}";
123 return os;
124 }
125
126 inline static bool
127 operator == (const ExtMachInst &emi1, const ExtMachInst &emi2)
128 {
129 //Since this is empty, it's always equal
130 return true;
131 }
132
133 typedef uint64_t IntReg;
134 //XXX Should this be a 128 bit structure for XMM memory ops?
135 typedef uint64_t LargestRead;
136 typedef uint64_t MiscReg;

--- 27 unchanged lines hidden ---