mediaop.isa (7081:ff2321547ca3) | mediaop.isa (7620:3d8a23caa1ef) |
---|---|
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, | 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, 58 bool isMicro, bool isDelayed, bool isFirst, bool isLast, | 57 const char * instMnem, uint64_t setFlags, |
59 InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest, 60 uint8_t _srcSize, uint8_t _destSize, uint16_t _ext); 61 62 %(class_name)s(ExtMachInst _machInst, 63 const char * instMnem, 64 InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest, 65 uint8_t _srcSize, uint8_t _destSize, uint16_t _ext); 66 --- 5 unchanged lines hidden (view full) --- 72 73 class %(class_name)s : public %(base_class)s 74 { 75 protected: 76 void buildMe(); 77 78 public: 79 %(class_name)s(ExtMachInst _machInst, | 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, |
80 const char * instMnem, 81 bool isMicro, bool isDelayed, bool isFirst, bool isLast, | 79 const char * instMnem, uint64_t setFlags, |
82 InstRegIndex _src1, uint16_t _imm8, InstRegIndex _dest, 83 uint8_t _srcSize, uint8_t _destSize, uint16_t _ext); 84 85 %(class_name)s(ExtMachInst _machInst, 86 const char * instMnem, 87 InstRegIndex _src1, uint16_t _imm8, InstRegIndex _dest, 88 uint8_t _srcSize, uint8_t _destSize, uint16_t _ext); 89 --- 7 unchanged lines hidden (view full) --- 97 { 98 %(constructor)s; 99 } 100 101 inline %(class_name)s::%(class_name)s( 102 ExtMachInst machInst, const char * instMnem, 103 InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest, 104 uint8_t _srcSize, uint8_t _destSize, uint16_t _ext) : | 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) : |
105 %(base_class)s(machInst, "%(mnemonic)s", instMnem, 106 false, false, false, false, | 103 %(base_class)s(machInst, "%(mnemonic)s", instMnem, 0, |
107 _src1, _src2, _dest, _srcSize, _destSize, _ext, 108 %(op_class)s) 109 { 110 buildMe(); 111 } 112 113 inline %(class_name)s::%(class_name)s( | 104 _src1, _src2, _dest, _srcSize, _destSize, _ext, 105 %(op_class)s) 106 { 107 buildMe(); 108 } 109 110 inline %(class_name)s::%(class_name)s( |
114 ExtMachInst machInst, const char * instMnem, 115 bool isMicro, bool isDelayed, bool isFirst, bool isLast, | 111 ExtMachInst machInst, const char * instMnem, uint64_t setFlags, |
116 InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest, 117 uint8_t _srcSize, uint8_t _destSize, uint16_t _ext) : | 112 InstRegIndex _src1, InstRegIndex _src2, InstRegIndex _dest, 113 uint8_t _srcSize, uint8_t _destSize, uint16_t _ext) : |
118 %(base_class)s(machInst, "%(mnemonic)s", instMnem, 119 isMicro, isDelayed, isFirst, isLast, | 114 %(base_class)s(machInst, "%(mnemonic)s", instMnem, setFlags, |
120 _src1, _src2, _dest, _srcSize, _destSize, _ext, 121 %(op_class)s) 122 { 123 buildMe(); 124 } 125}}; 126 127def template MediaOpImmConstructor {{ 128 129 inline void %(class_name)s::buildMe() 130 { 131 %(constructor)s; 132 } 133 134 inline %(class_name)s::%(class_name)s( 135 ExtMachInst machInst, const char * instMnem, 136 InstRegIndex _src1, uint16_t _imm8, InstRegIndex _dest, 137 uint8_t _srcSize, uint8_t _destSize, uint16_t _ext) : | 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) : |
138 %(base_class)s(machInst, "%(mnemonic)s", instMnem, 139 false, false, false, false, | 133 %(base_class)s(machInst, "%(mnemonic)s", instMnem, 0, |
140 _src1, _imm8, _dest, _srcSize, _destSize, _ext, 141 %(op_class)s) 142 { 143 buildMe(); 144 } 145 146 inline %(class_name)s::%(class_name)s( | 134 _src1, _imm8, _dest, _srcSize, _destSize, _ext, 135 %(op_class)s) 136 { 137 buildMe(); 138 } 139 140 inline %(class_name)s::%(class_name)s( |
147 ExtMachInst machInst, const char * instMnem, 148 bool isMicro, bool isDelayed, bool isFirst, bool isLast, | 141 ExtMachInst machInst, const char * instMnem, uint64_t setFlags, |
149 InstRegIndex _src1, uint16_t _imm8, InstRegIndex _dest, 150 uint8_t _srcSize, uint8_t _destSize, uint16_t _ext) : | 142 InstRegIndex _src1, uint16_t _imm8, InstRegIndex _dest, 143 uint8_t _srcSize, uint8_t _destSize, uint16_t _ext) : |
151 %(base_class)s(machInst, "%(mnemonic)s", instMnem, 152 isMicro, isDelayed, isFirst, isLast, | 144 %(base_class)s(machInst, "%(mnemonic)s", instMnem, setFlags, |
153 _src1, _imm8, _dest, _srcSize, _destSize, _ext, 154 %(op_class)s) 155 { 156 buildMe(); 157 } 158}}; 159 160let {{ --- 106 unchanged lines hidden (view full) --- 267 raise Exception, "Source size not set." 268 if self.destSize is None: 269 raise Exception, "Dest size not set." 270 if ext is None: 271 self.ext = 0 272 else: 273 self.ext = ext 274 | 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 |
275 def getAllocator(self, *microFlags): | 267 def getAllocator(self, microFlags): |
276 className = self.className 277 if self.mnemonic == self.base_mnemonic + 'i': 278 className += "Imm" | 268 className = self.className 269 if self.mnemonic == self.base_mnemonic + 'i': 270 className += "Imm" |
279 allocator = '''new %(class_name)s(machInst, macrocodeBlock | 271 allocator = '''new %(class_name)s(machInst, macrocodeBlock, |
280 %(flags)s, %(src1)s, %(op2)s, %(dest)s, 281 %(srcSize)s, %(destSize)s, %(ext)s)''' % { 282 "class_name" : className, 283 "flags" : self.microFlagsText(microFlags), 284 "src1" : self.src1, "op2" : self.op2, 285 "dest" : self.dest, 286 "srcSize" : self.srcSize, 287 "destSize" : self.destSize, --- 1273 unchanged lines hidden --- | 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 --- |