regop.isa (7480:6a854784be4f) | regop.isa (7620:3d8a23caa1ef) |
---|---|
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, | 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, 110 bool isMicro, bool isDelayed, bool isFirst, bool isLast, | 109 const char * instMnem, uint64_t setFlags, |
111 InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest, 112 uint8_t _dataSize, uint16_t _ext); 113 114 %(class_name)s(ExtMachInst _machInst, 115 const char * instMnem, 116 InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest, 117 uint8_t _dataSize, uint16_t _ext); 118 --- 5 unchanged lines hidden (view full) --- 124 125 class %(class_name)s : public %(base_class)s 126 { 127 protected: 128 void buildMe(); 129 130 public: 131 %(class_name)s(ExtMachInst _machInst, | 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, |
132 const char * instMnem, 133 bool isMicro, bool isDelayed, bool isFirst, bool isLast, | 131 const char * instMnem, uint64_t setFlags, |
134 InstRegIndex _src1, uint8_t _imm8, InstRegIndex _dest, 135 uint8_t _dataSize, uint16_t _ext); 136 137 %(class_name)s(ExtMachInst _machInst, 138 const char * instMnem, 139 InstRegIndex _src1, uint8_t _imm8, InstRegIndex _dest, 140 uint8_t _dataSize, uint16_t _ext); 141 --- 7 unchanged lines hidden (view full) --- 149 { 150 %(constructor)s; 151 } 152 153 inline %(class_name)s::%(class_name)s( 154 ExtMachInst machInst, const char * instMnem, 155 InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest, 156 uint8_t _dataSize, uint16_t _ext) : | 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) : |
157 %(base_class)s(machInst, "%(mnemonic)s", instMnem, 158 false, false, false, false, | 155 %(base_class)s(machInst, "%(mnemonic)s", instMnem, 0, |
159 _src1, _src2, _dest, _dataSize, _ext, 160 %(op_class)s) 161 { 162 buildMe(); 163 } 164 165 inline %(class_name)s::%(class_name)s( | 156 _src1, _src2, _dest, _dataSize, _ext, 157 %(op_class)s) 158 { 159 buildMe(); 160 } 161 162 inline %(class_name)s::%(class_name)s( |
166 ExtMachInst machInst, const char * instMnem, 167 bool isMicro, bool isDelayed, bool isFirst, bool isLast, | 163 ExtMachInst machInst, const char * instMnem, uint64_t setFlags, |
168 InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest, 169 uint8_t _dataSize, uint16_t _ext) : | 164 InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest, 165 uint8_t _dataSize, uint16_t _ext) : |
170 %(base_class)s(machInst, "%(mnemonic)s", instMnem, 171 isMicro, isDelayed, isFirst, isLast, | 166 %(base_class)s(machInst, "%(mnemonic)s", instMnem, setFlags, |
172 _src1, _src2, _dest, _dataSize, _ext, 173 %(op_class)s) 174 { 175 buildMe(); 176 } 177}}; 178 179def template MicroRegOpImmConstructor {{ 180 181 inline void %(class_name)s::buildMe() 182 { 183 %(constructor)s; 184 } 185 186 inline %(class_name)s::%(class_name)s( 187 ExtMachInst machInst, const char * instMnem, 188 InstRegIndex _src1, uint8_t _imm8, InstRegIndex _dest, 189 uint8_t _dataSize, uint16_t _ext) : | 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) : |
190 %(base_class)s(machInst, "%(mnemonic)s", instMnem, 191 false, false, false, false, | 185 %(base_class)s(machInst, "%(mnemonic)s", instMnem, 0, |
192 _src1, _imm8, _dest, _dataSize, _ext, 193 %(op_class)s) 194 { 195 buildMe(); 196 } 197 198 inline %(class_name)s::%(class_name)s( | 186 _src1, _imm8, _dest, _dataSize, _ext, 187 %(op_class)s) 188 { 189 buildMe(); 190 } 191 192 inline %(class_name)s::%(class_name)s( |
199 ExtMachInst machInst, const char * instMnem, 200 bool isMicro, bool isDelayed, bool isFirst, bool isLast, | 193 ExtMachInst machInst, const char * instMnem, uint64_t setFlags, |
201 InstRegIndex _src1, uint8_t _imm8, InstRegIndex _dest, 202 uint8_t _dataSize, uint16_t _ext) : | 194 InstRegIndex _src1, uint8_t _imm8, InstRegIndex _dest, 195 uint8_t _dataSize, uint16_t _ext) : |
203 %(base_class)s(machInst, "%(mnemonic)s", instMnem, 204 isMicro, isDelayed, isFirst, isLast, | 196 %(base_class)s(machInst, "%(mnemonic)s", instMnem, setFlags, |
205 _src1, _imm8, _dest, _dataSize, _ext, 206 %(op_class)s) 207 { 208 buildMe(); 209 } 210}}; 211 212output header {{ --- 203 unchanged lines hidden (view full) --- 416 if flags is None: 417 self.ext = 0 418 else: 419 if not isinstance(flags, (list, tuple)): 420 raise Exception, "flags must be a list or tuple of flags" 421 self.ext = " | ".join(flags) 422 self.className += "Flags" 423 | 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 |
424 def getAllocator(self, *microFlags): | 416 def getAllocator(self, microFlags): |
425 className = self.className 426 if self.mnemonic == self.base_mnemonic + 'i': 427 className += "Imm" | 417 className = self.className 418 if self.mnemonic == self.base_mnemonic + 'i': 419 className += "Imm" |
428 allocator = '''new %(class_name)s(machInst, macrocodeBlock | 420 allocator = '''new %(class_name)s(machInst, macrocodeBlock, |
429 %(flags)s, %(src1)s, %(op2)s, %(dest)s, 430 %(dataSize)s, %(ext)s)''' % { 431 "class_name" : className, 432 "flags" : self.microFlagsText(microFlags), 433 "src1" : self.src1, "op2" : self.op2, 434 "dest" : self.dest, 435 "dataSize" : self.dataSize, 436 "ext" : self.ext} --- 1004 unchanged lines hidden --- | 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 --- |