1// Copyright (c) 2007-2008 The Hewlett-Packard Development Company 2// All rights reserved. 3// 4// The license below extends only to copyright in the software and shall 5// not be construed as granting a license to any other intellectual 6// property including but not limited to intellectual property relating 7// to a hardware implementation of the functionality of the software 8// licensed hereunder. You may use the software subject to the license --- 92 unchanged lines hidden (view full) --- 101def template MicroRegOpDeclare {{ 102 class %(class_name)s : public %(base_class)s 103 { 104 protected: 105 void buildMe(); 106 107 public: 108 %(class_name)s(ExtMachInst _machInst, |
109 const char * instMnem, uint64_t setFlags, |
110 InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest, 111 uint8_t _dataSize, uint16_t _ext); 112 113 %(class_name)s(ExtMachInst _machInst, 114 const char * instMnem, 115 InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest, 116 uint8_t _dataSize, uint16_t _ext); 117 --- 5 unchanged lines hidden (view full) --- 123 124 class %(class_name)s : public %(base_class)s 125 { 126 protected: 127 void buildMe(); 128 129 public: 130 %(class_name)s(ExtMachInst _machInst, |
131 const char * instMnem, uint64_t setFlags, |
132 InstRegIndex _src1, uint8_t _imm8, InstRegIndex _dest, 133 uint8_t _dataSize, uint16_t _ext); 134 135 %(class_name)s(ExtMachInst _machInst, 136 const char * instMnem, 137 InstRegIndex _src1, uint8_t _imm8, InstRegIndex _dest, 138 uint8_t _dataSize, uint16_t _ext); 139 --- 7 unchanged lines hidden (view full) --- 147 { 148 %(constructor)s; 149 } 150 151 inline %(class_name)s::%(class_name)s( 152 ExtMachInst machInst, const char * instMnem, 153 InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest, 154 uint8_t _dataSize, uint16_t _ext) : |
155 %(base_class)s(machInst, "%(mnemonic)s", instMnem, 0, |
156 _src1, _src2, _dest, _dataSize, _ext, 157 %(op_class)s) 158 { 159 buildMe(); 160 } 161 162 inline %(class_name)s::%(class_name)s( |
163 ExtMachInst machInst, const char * instMnem, uint64_t setFlags, |
164 InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest, 165 uint8_t _dataSize, uint16_t _ext) : |
166 %(base_class)s(machInst, "%(mnemonic)s", instMnem, setFlags, |
167 _src1, _src2, _dest, _dataSize, _ext, 168 %(op_class)s) 169 { 170 buildMe(); 171 } 172}}; 173 174def template MicroRegOpImmConstructor {{ 175 176 inline void %(class_name)s::buildMe() 177 { 178 %(constructor)s; 179 } 180 181 inline %(class_name)s::%(class_name)s( 182 ExtMachInst machInst, const char * instMnem, 183 InstRegIndex _src1, uint8_t _imm8, InstRegIndex _dest, 184 uint8_t _dataSize, uint16_t _ext) : |
185 %(base_class)s(machInst, "%(mnemonic)s", instMnem, 0, |
186 _src1, _imm8, _dest, _dataSize, _ext, 187 %(op_class)s) 188 { 189 buildMe(); 190 } 191 192 inline %(class_name)s::%(class_name)s( |
193 ExtMachInst machInst, const char * instMnem, uint64_t setFlags, |
194 InstRegIndex _src1, uint8_t _imm8, InstRegIndex _dest, 195 uint8_t _dataSize, uint16_t _ext) : |
196 %(base_class)s(machInst, "%(mnemonic)s", instMnem, setFlags, |
197 _src1, _imm8, _dest, _dataSize, _ext, 198 %(op_class)s) 199 { 200 buildMe(); 201 } 202}}; 203 204output header {{ --- 203 unchanged lines hidden (view full) --- 408 if flags is None: 409 self.ext = 0 410 else: 411 if not isinstance(flags, (list, tuple)): 412 raise Exception, "flags must be a list or tuple of flags" 413 self.ext = " | ".join(flags) 414 self.className += "Flags" 415 |
416 def getAllocator(self, microFlags): |
417 className = self.className 418 if self.mnemonic == self.base_mnemonic + 'i': 419 className += "Imm" |
420 allocator = '''new %(class_name)s(machInst, macrocodeBlock, |
421 %(flags)s, %(src1)s, %(op2)s, %(dest)s, 422 %(dataSize)s, %(ext)s)''' % { 423 "class_name" : className, 424 "flags" : self.microFlagsText(microFlags), 425 "src1" : self.src1, "op2" : self.op2, 426 "dest" : self.dest, 427 "dataSize" : self.dataSize, 428 "ext" : self.ext} --- 1004 unchanged lines hidden --- |