1/// Copyright (c) 2009 The Regents of The University of Michigan 2// All rights reserved. 3// 4// Redistribution and use in source and binary forms, with or without 5// modification, are permitted provided that the following conditions are 6// met: redistributions of source code must retain the above copyright 7// notice, this list of conditions and the following disclaimer; 8// redistributions in binary form must reproduce the above copyright --- 40 unchanged lines hidden (view full) --- 49def template MediaOpRegDeclare {{ 50 class %(class_name)s : public %(base_class)s 51 { 52 protected: 53 void buildMe(); 54 55 public: 56 %(class_name)s(ExtMachInst _machInst, |
57 const char * instMnem, uint64_t setFlags, |
58 InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest, 59 uint8_t _srcSize, uint8_t _destSize, uint16_t _ext); 60 61 %(class_name)s(ExtMachInst _machInst, 62 const char * instMnem, 63 InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest, 64 uint8_t _srcSize, uint8_t _destSize, uint16_t _ext); 65 --- 5 unchanged lines hidden (view full) --- 71 72 class %(class_name)s : public %(base_class)s 73 { 74 protected: 75 void buildMe(); 76 77 public: 78 %(class_name)s(ExtMachInst _machInst, |
79 const char * instMnem, uint64_t setFlags, |
80 InstRegIndex _src1, uint16_t _imm8, InstRegIndex _dest, 81 uint8_t _srcSize, uint8_t _destSize, uint16_t _ext); 82 83 %(class_name)s(ExtMachInst _machInst, 84 const char * instMnem, 85 InstRegIndex _src1, uint16_t _imm8, InstRegIndex _dest, 86 uint8_t _srcSize, uint8_t _destSize, uint16_t _ext); 87 --- 7 unchanged lines hidden (view full) --- 95 { 96 %(constructor)s; 97 } 98 99 inline %(class_name)s::%(class_name)s( 100 ExtMachInst machInst, const char * instMnem, 101 InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest, 102 uint8_t _srcSize, uint8_t _destSize, uint16_t _ext) : |
103 %(base_class)s(machInst, "%(mnemonic)s", instMnem, 0, |
104 _src1, _src2, _dest, _srcSize, _destSize, _ext, 105 %(op_class)s) 106 { 107 buildMe(); 108 } 109 110 inline %(class_name)s::%(class_name)s( |
111 ExtMachInst machInst, const char * instMnem, uint64_t setFlags, |
112 InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest, 113 uint8_t _srcSize, uint8_t _destSize, uint16_t _ext) : |
114 %(base_class)s(machInst, "%(mnemonic)s", instMnem, setFlags, |
115 _src1, _src2, _dest, _srcSize, _destSize, _ext, 116 %(op_class)s) 117 { 118 buildMe(); 119 } 120}}; 121 122def template MediaOpImmConstructor {{ 123 124 inline void %(class_name)s::buildMe() 125 { 126 %(constructor)s; 127 } 128 129 inline %(class_name)s::%(class_name)s( 130 ExtMachInst machInst, const char * instMnem, 131 InstRegIndex _src1, uint16_t _imm8, InstRegIndex _dest, 132 uint8_t _srcSize, uint8_t _destSize, uint16_t _ext) : |
133 %(base_class)s(machInst, "%(mnemonic)s", instMnem, 0, |
134 _src1, _imm8, _dest, _srcSize, _destSize, _ext, 135 %(op_class)s) 136 { 137 buildMe(); 138 } 139 140 inline %(class_name)s::%(class_name)s( |
141 ExtMachInst machInst, const char * instMnem, uint64_t setFlags, |
142 InstRegIndex _src1, uint16_t _imm8, InstRegIndex _dest, 143 uint8_t _srcSize, uint8_t _destSize, uint16_t _ext) : |
144 %(base_class)s(machInst, "%(mnemonic)s", instMnem, setFlags, |
145 _src1, _imm8, _dest, _srcSize, _destSize, _ext, 146 %(op_class)s) 147 { 148 buildMe(); 149 } 150}}; 151 152let {{ --- 106 unchanged lines hidden (view full) --- 259 raise Exception, "Source size not set." 260 if self.destSize is None: 261 raise Exception, "Dest size not set." 262 if ext is None: 263 self.ext = 0 264 else: 265 self.ext = ext 266 |
267 def getAllocator(self, microFlags): |
268 className = self.className 269 if self.mnemonic == self.base_mnemonic + 'i': 270 className += "Imm" |
271 allocator = '''new %(class_name)s(machInst, macrocodeBlock, |
272 %(flags)s, %(src1)s, %(op2)s, %(dest)s, 273 %(srcSize)s, %(destSize)s, %(ext)s)''' % { 274 "class_name" : className, 275 "flags" : self.microFlagsText(microFlags), 276 "src1" : self.src1, "op2" : self.op2, 277 "dest" : self.dest, 278 "srcSize" : self.srcSize, 279 "destSize" : self.destSize, --- 1273 unchanged lines hidden --- |