types.hh (4181:6edaeff44647) | types.hh (4182:5b2c0d266107) |
---|---|
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> | 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> |
|
62 63namespace X86ISA 64{ 65 //This really determines how many bytes are passed to the predecoder. 66 typedef uint64_t MachInst; | 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 |
|
67 //The intermediate structure the x86 predecoder returns. 68 struct ExtMachInst 69 { | 90 //The intermediate structure the x86 predecoder returns. 91 struct ExtMachInst 92 { |
70 //Empty for now... | 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 {;} |
71 }; 72 | 117 }; 118 |
73 bool operator == (const ExtMachInst &emi1, const ExtMachInst &emi2) | 119 inline static std::ostream & 120 operator << (std::ostream & os, const ExtMachInst & emi) |
74 { | 121 { |
122 os << "{X86 ExtMachInst}"; 123 return os; 124 } 125 126 inline static bool 127 operator == (const ExtMachInst &emi1, const ExtMachInst &emi2) 128 { |
|
75 //Since this is empty, it's always equal 76 return true; 77 } 78 79 typedef uint64_t IntReg; 80 //XXX Should this be a 128 bit structure for XMM memory ops? 81 typedef uint64_t LargestRead; 82 typedef uint64_t MiscReg; --- 27 unchanged lines hidden --- | 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 --- |