macroop.hh (5786:07f635cab026) macroop.hh (5788:6d4161a36ca1)
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 *

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

60
61#include "arch/x86/emulenv.hh"
62#include "arch/x86/types.hh"
63#include "arch/x86/insts/static_inst.hh"
64
65namespace X86ISA
66{
67// Base class for combinationally generated macroops
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 *

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

60
61#include "arch/x86/emulenv.hh"
62#include "arch/x86/types.hh"
63#include "arch/x86/insts/static_inst.hh"
64
65namespace X86ISA
66{
67// Base class for combinationally generated macroops
68class MacroopBase : public StaticInst
68class MacroopBase : public X86StaticInst
69{
70 protected:
69{
70 protected:
71 const char *macrocodeBlock;
72
71 const uint32_t numMicroops;
73 const uint32_t numMicroops;
72 X86ISA::EmulEnv emulEnv;
74 X86ISA::EmulEnv env;
73
74 //Constructor.
75 MacroopBase(const char *mnem, ExtMachInst _machInst,
75
76 //Constructor.
77 MacroopBase(const char *mnem, ExtMachInst _machInst,
76 uint32_t _numMicroops, X86ISA::EmulEnv _emulEnv)
77 : StaticInst(mnem, _machInst, No_OpClass),
78 numMicroops(_numMicroops), emulEnv(_emulEnv)
78 uint32_t _numMicroops, X86ISA::EmulEnv _env) :
79 X86StaticInst(mnem, _machInst, No_OpClass),
80 numMicroops(_numMicroops), env(_env)
79 {
80 assert(numMicroops);
81 microops = new StaticInstPtr[numMicroops];
82 flags[IsMacroop] = true;
83 }
84
85 ~MacroopBase()
86 {
87 delete [] microops;
88 }
89
90 StaticInstPtr * microops;
91
92 StaticInstPtr fetchMicroop(MicroPC microPC)
93 {
94 assert(microPC < numMicroops);
95 return microops[microPC];
96 }
97
81 {
82 assert(numMicroops);
83 microops = new StaticInstPtr[numMicroops];
84 flags[IsMacroop] = true;
85 }
86
87 ~MacroopBase()
88 {
89 delete [] microops;
90 }
91
92 StaticInstPtr * microops;
93
94 StaticInstPtr fetchMicroop(MicroPC microPC)
95 {
96 assert(microPC < numMicroops);
97 return microops[microPC];
98 }
99
98 std::string generateDisassembly(Addr pc,
99 const SymbolTable *symtab) const
100 std::string
101 generateDisassembly(Addr pc, const SymbolTable *symtab) const
100 {
101 return mnemonic;
102 }
103
104 public:
105 ExtMachInst
106 getExtMachInst()
107 {
108 return machInst;
109 }
110
111 X86ISA::EmulEnv
112 getEmulEnv()
113 {
102 {
103 return mnemonic;
104 }
105
106 public:
107 ExtMachInst
108 getExtMachInst()
109 {
110 return machInst;
111 }
112
113 X86ISA::EmulEnv
114 getEmulEnv()
115 {
114 return emulEnv;
116 return env;
115 }
116};
117}
118
119#endif //__ARCH_X86_INSTS_MACROOP_HH__
117 }
118};
119}
120
121#endif //__ARCH_X86_INSTS_MACROOP_HH__