Ghidra Decompiler Analysis Engine
ruleaction.hh
Go to the documentation of this file.
1 /* ###
2  * IP: GHIDRA
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
24 
25 #ifndef __RULE_ACTION__
26 #define __RULE_ACTION__
27 
28 #include "action.hh"
29 
42 class AddTreeState {
43  Funcdata &data;
44  PcodeOp *baseOp;
45  Varnode *ptr;
46  const TypePointer *ct;
47  const Datatype *baseType;
48  int4 ptrsize;
49  int4 size;
50  uintb ptrmask;
51  uintb offset;
52  uintb correct;
53  vector<Varnode *> multiple;
54  vector<intb> coeff;
55  vector<Varnode *> nonmult;
56  PcodeOp *distributeOp;
57  uintb multsum;
58  uintb nonmultsum;
59  bool preventDistribution;
60  bool isDistributeUsed;
61  bool isSubtype;
62  bool valid;
63  uint4 findArrayHint(void) const;
64  bool hasMatchingSubType(uintb off,uint4 arrayHint,uintb *newoff) const;
65  bool checkMultTerm(Varnode *vn,PcodeOp *op, uintb treeCoeff);
66  bool checkTerm(Varnode *vn, uintb treeCoeff);
67  bool spanAddTree(PcodeOp *op, uintb treeCoeff);
68  void calcSubtype(void);
69  Varnode *buildMultiples(void);
70  Varnode *buildExtra(void);
71  void buildTree(void);
72  void clear(void);
73 public:
74  AddTreeState(Funcdata &d,PcodeOp *op,int4 slot);
75  bool apply(void);
76 };
77 
78 class RuleEarlyRemoval : public Rule {
79 public:
80  RuleEarlyRemoval(const string &g) : Rule(g, 0, "earlyremoval") {}
81  virtual Rule *clone(const ActionGroupList &grouplist) const {
82  if (!grouplist.contains(getGroup())) return (Rule *)0;
83  return new RuleEarlyRemoval(getGroup());
84  }
85  // This rule applies to all ops
86  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
87 };
88 // class RuleAddrForceRelease : public Rule {
89 // public:
90 // RuleAddrForceRelease(const string &g) : Rule(g, 0, "addrforcerelease") {} ///< Constructor
91 // virtual void getOpList(vector<uint4> &oplist) const;
92 // virtual int4 applyOp(PcodeOp *op,Funcdata &data);
93 // };
94 class RuleCollectTerms : public Rule {
95  static Varnode *getMultCoeff(Varnode *vn,uintb &coef);
96 public:
97  RuleCollectTerms(const string &g) : Rule(g, 0, "collect_terms") {}
98  virtual Rule *clone(const ActionGroupList &grouplist) const {
99  if (!grouplist.contains(getGroup())) return (Rule *)0;
100  return new RuleCollectTerms(getGroup());
101  }
102  virtual void getOpList(vector<uint4> &oplist) const;
103  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
104 };
105 class RuleSelectCse : public Rule {
106 public:
107  RuleSelectCse(const string &g) : Rule(g,0,"selectcse") {}
108  virtual Rule *clone(const ActionGroupList &grouplist) const {
109  if (!grouplist.contains(getGroup())) return (Rule *)0;
110  return new RuleSelectCse(getGroup());
111  }
112  virtual void getOpList(vector<uint4> &oplist) const;
113  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
114 };
115 class RulePiece2Zext : public Rule {
116 public:
117  RulePiece2Zext(const string &g) : Rule(g, 0, "piece2zext") {}
118  virtual Rule *clone(const ActionGroupList &grouplist) const {
119  if (!grouplist.contains(getGroup())) return (Rule *)0;
120  return new RulePiece2Zext(getGroup());
121  }
122  virtual void getOpList(vector<uint4> &oplist) const;
123  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
124 };
125 class RulePiece2Sext : public Rule {
126 public:
127  RulePiece2Sext(const string &g) : Rule(g, 0, "piece2sext") {}
128  virtual Rule *clone(const ActionGroupList &grouplist) const {
129  if (!grouplist.contains(getGroup())) return (Rule *)0;
130  return new RulePiece2Sext(getGroup());
131  }
132  virtual void getOpList(vector<uint4> &oplist) const;
133  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
134 };
135 class RuleBxor2NotEqual : public Rule {
136 public:
137  RuleBxor2NotEqual(const string &g) : Rule(g, 0, "bxor2notequal") {}
138  virtual Rule *clone(const ActionGroupList &grouplist) const {
139  if (!grouplist.contains(getGroup())) return (Rule *)0;
140  return new RuleBxor2NotEqual(getGroup());
141  }
142  virtual void getOpList(vector<uint4> &oplist) const;
143  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
144 };
145 class RuleOrMask : public Rule {
146 public:
147  RuleOrMask(const string &g) : Rule(g, 0, "ormask") {}
148  virtual Rule *clone(const ActionGroupList &grouplist) const {
149  if (!grouplist.contains(getGroup())) return (Rule *)0;
150  return new RuleOrMask(getGroup());
151  }
152  virtual void getOpList(vector<uint4> &oplist) const;
153  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
154 };
155 class RuleAndMask : public Rule {
156 public:
157  RuleAndMask(const string &g) : Rule(g, 0, "andmask") {}
158  virtual Rule *clone(const ActionGroupList &grouplist) const {
159  if (!grouplist.contains(getGroup())) return (Rule *)0;
160  return new RuleAndMask(getGroup());
161  }
162  virtual void getOpList(vector<uint4> &oplist) const;
163  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
164 };
165 class RuleOrConsume : public Rule {
166 public:
167  RuleOrConsume(const string &g) : Rule(g, 0, "orconsume") {}
168  virtual Rule *clone(const ActionGroupList &grouplist) const {
169  if (!grouplist.contains(getGroup())) return (Rule *)0;
170  return new RuleOrConsume(getGroup());
171  }
172  virtual void getOpList(vector<uint4> &oplist) const;
173  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
174 };
175 class RuleOrCollapse : public Rule {
176 public:
177  RuleOrCollapse(const string &g) : Rule(g, 0, "orcollapse") {}
178  virtual Rule *clone(const ActionGroupList &grouplist) const {
179  if (!grouplist.contains(getGroup())) return (Rule *)0;
180  return new RuleOrCollapse(getGroup());
181  }
182  virtual void getOpList(vector<uint4> &oplist) const;
183  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
184 };
185 class RuleAndOrLump : public Rule {
186 public:
187  RuleAndOrLump(const string &g) : Rule(g, 0, "andorlump") {}
188  virtual Rule *clone(const ActionGroupList &grouplist) const {
189  if (!grouplist.contains(getGroup())) return (Rule *)0;
190  return new RuleAndOrLump(getGroup());
191  }
192  virtual void getOpList(vector<uint4> &oplist) const;
193  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
194 };
195 class RuleNegateIdentity : public Rule {
196 public:
197  RuleNegateIdentity(const string &g) : Rule(g, 0, "negateidentity") {}
198  virtual Rule *clone(const ActionGroupList &grouplist) const {
199  if (!grouplist.contains(getGroup())) return (Rule *)0;
200  return new RuleNegateIdentity(getGroup());
201  }
202  virtual void getOpList(vector<uint4> &oplist) const;
203  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
204 };
205 class RuleShiftBitops : public Rule {
206 public:
207  RuleShiftBitops(const string &g) : Rule(g, 0, "shiftbitops") {}
208  virtual Rule *clone(const ActionGroupList &grouplist) const {
209  if (!grouplist.contains(getGroup())) return (Rule *)0;
210  return new RuleShiftBitops(getGroup());
211  }
212  virtual void getOpList(vector<uint4> &oplist) const;
213  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
214 };
215 class RuleRightShiftAnd : public Rule {
216 public:
217  RuleRightShiftAnd(const string &g) : Rule(g, 0, "rightshiftand") {}
218  virtual Rule *clone(const ActionGroupList &grouplist) const {
219  if (!grouplist.contains(getGroup())) return (Rule *)0;
220  return new RuleRightShiftAnd(getGroup());
221  }
222  virtual void getOpList(vector<uint4> &oplist) const;
223  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
224 };
225 class RuleIntLessEqual : public Rule {
226 public:
227  RuleIntLessEqual(const string &g) : Rule(g, 0, "intlessequal") {}
228  virtual Rule *clone(const ActionGroupList &grouplist) const {
229  if (!grouplist.contains(getGroup())) return (Rule *)0;
230  return new RuleIntLessEqual(getGroup());
231  }
232  virtual void getOpList(vector<uint4> &oplist) const;
233  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
234 };
235 class RuleEquality : public Rule {
236 public:
237  RuleEquality(const string &g) : Rule(g, 0, "equality") {}
238  virtual Rule *clone(const ActionGroupList &grouplist) const {
239  if (!grouplist.contains(getGroup())) return (Rule *)0;
240  return new RuleEquality(getGroup());
241  }
242  virtual void getOpList(vector<uint4> &oplist) const;
243  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
244 };
245 // Reversible rules
246 class RuleTermOrder : public Rule {
247 public:
248  RuleTermOrder(const string &g) : Rule(g, 0, "termorder") {}
249  virtual Rule *clone(const ActionGroupList &grouplist) const {
250  if (!grouplist.contains(getGroup())) return (Rule *)0;
251  return new RuleTermOrder(getGroup());
252  }
253  virtual void getOpList(vector<uint4> &oplist) const;
254  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
255 };
256 class RulePullsubMulti : public Rule {
257 public:
258  RulePullsubMulti(const string &g) : Rule(g, 0, "pullsub_multi") {}
259  virtual Rule *clone(const ActionGroupList &grouplist) const {
260  if (!grouplist.contains(getGroup())) return (Rule *)0;
261  return new RulePullsubMulti(getGroup());
262  }
263  virtual void getOpList(vector<uint4> &oplist) const;
264  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
265  static void minMaxUse(Varnode *vn,int4 &maxByte,int4 &minByte);
266  static void replaceDescendants(Varnode *origVn,Varnode *newVn,int4 maxByte,int4 minByte,Funcdata &data);
267  static bool acceptableSize(int4 size);
268  static Varnode *buildSubpiece(Varnode *basevn,uint4 outsize,uint4 shift,Funcdata &data);
269  static Varnode *findSubpiece(Varnode *basevn,uint4 outsize,uint4 shift);
270 };
271 class RulePullsubIndirect : public Rule {
272 public:
273  RulePullsubIndirect(const string &g) : Rule(g, 0, "pullsub_indirect") {}
274  virtual Rule *clone(const ActionGroupList &grouplist) const {
275  if (!grouplist.contains(getGroup())) return (Rule *)0;
276  return new RulePullsubIndirect(getGroup());
277  }
278  virtual void getOpList(vector<uint4> &oplist) const;
279  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
280 };
281 class RulePushMulti : public Rule {
282  static PcodeOp *findSubstitute(Varnode *in1,Varnode *in2,BlockBasic *bb,PcodeOp *earliest);
283 public:
284  RulePushMulti(const string &g) : Rule(g, 0, "push_multi") {}
285  virtual Rule *clone(const ActionGroupList &grouplist) const {
286  if (!grouplist.contains(getGroup())) return (Rule *)0;
287  return new RulePushMulti(getGroup());
288  }
289  virtual void getOpList(vector<uint4> &oplist) const;
290  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
291 };
292 class RuleNotDistribute : public Rule {
293 public:
294  RuleNotDistribute(const string &g) : Rule(g, 0, "notdistribute") {}
295  virtual Rule *clone(const ActionGroupList &grouplist) const {
296  if (!grouplist.contains(getGroup())) return (Rule *)0;
297  return new RuleNotDistribute(getGroup());
298  }
299  virtual void getOpList(vector<uint4> &oplist) const;
300  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
301 };
302 class RuleHighOrderAnd : public Rule {
303 public:
304  RuleHighOrderAnd(const string &g) : Rule(g, 0, "highorderand") {}
305  virtual Rule *clone(const ActionGroupList &grouplist) const {
306  if (!grouplist.contains(getGroup())) return (Rule *)0;
307  return new RuleHighOrderAnd(getGroup());
308  }
309  virtual void getOpList(vector<uint4> &oplist) const;
310  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
311 };
312 class RuleAndDistribute : public Rule {
313 public:
314  RuleAndDistribute(const string &g) : Rule(g, 0, "anddistribute") {}
315  virtual Rule *clone(const ActionGroupList &grouplist) const {
316  if (!grouplist.contains(getGroup())) return (Rule *)0;
317  return new RuleAndDistribute(getGroup());
318  }
319  virtual void getOpList(vector<uint4> &oplist) const;
320  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
321 };
322 class RuleLessOne : public Rule {
323 public:
324  RuleLessOne(const string &g) : Rule(g, 0, "lessone") {}
325  virtual Rule *clone(const ActionGroupList &grouplist) const {
326  if (!grouplist.contains(getGroup())) return (Rule *)0;
327  return new RuleLessOne(getGroup());
328  }
329  virtual void getOpList(vector<uint4> &oplist) const;
330  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
331 };
332 class RuleRangeMeld : public Rule {
333 public:
334  RuleRangeMeld(const string &g) : Rule(g, 0, "rangemeld") {}
335  virtual Rule *clone(const ActionGroupList &grouplist) const {
336  if (!grouplist.contains(getGroup())) return (Rule *)0;
337  return new RuleRangeMeld(getGroup());
338  }
339  virtual void getOpList(vector<uint4> &oplist) const;
340  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
341 };
342 class RuleFloatRange : public Rule {
343 public:
344  RuleFloatRange(const string &g) : Rule(g, 0, "floatrange") {}
345  virtual Rule *clone(const ActionGroupList &grouplist) const {
346  if (!grouplist.contains(getGroup())) return (Rule *)0;
347  return new RuleFloatRange(getGroup());
348  }
349  virtual void getOpList(vector<uint4> &oplist) const;
350  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
351 };
352 class RuleAndCommute : public Rule {
353 public:
354  RuleAndCommute(const string &g) : Rule(g, 0, "andcommute") {}
355  virtual Rule *clone(const ActionGroupList &grouplist) const {
356  if (!grouplist.contains(getGroup())) return (Rule *)0;
357  return new RuleAndCommute(getGroup());
358  }
359  virtual void getOpList(vector<uint4> &oplist) const;
360  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
361 };
362 class RuleAndPiece : public Rule {
363 public:
364  RuleAndPiece(const string &g) : Rule(g, 0, "andpiece") {}
365  virtual Rule *clone(const ActionGroupList &grouplist) const {
366  if (!grouplist.contains(getGroup())) return (Rule *)0;
367  return new RuleAndPiece(getGroup());
368  }
369  virtual void getOpList(vector<uint4> &oplist) const;
370  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
371 };
372 class RuleAndCompare : public Rule {
373 public:
374  RuleAndCompare(const string &g) : Rule(g, 0, "andcompare") {}
375  virtual Rule *clone(const ActionGroupList &grouplist) const {
376  if (!grouplist.contains(getGroup())) return (Rule *)0;
377  return new RuleAndCompare(getGroup());
378  }
379  virtual void getOpList(vector<uint4> &oplist) const;
380  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
381 };
382 class RuleDoubleSub : public Rule {
383 public:
384  RuleDoubleSub(const string &g) : Rule(g, 0, "doublesub") {}
385  virtual Rule *clone(const ActionGroupList &grouplist) const {
386  if (!grouplist.contains(getGroup())) return (Rule *)0;
387  return new RuleDoubleSub(getGroup());
388  }
389  virtual void getOpList(vector<uint4> &oplist) const;
390  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
391 };
392 class RuleDoubleShift : public Rule {
393 public:
394  RuleDoubleShift(const string &g) : Rule(g, 0, "doubleshift") {}
395  virtual Rule *clone(const ActionGroupList &grouplist) const {
396  if (!grouplist.contains(getGroup())) return (Rule *)0;
397  return new RuleDoubleShift(getGroup());
398  }
399  virtual void getOpList(vector<uint4> &oplist) const;
400  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
401 };
402 class RuleDoubleArithShift : public Rule {
403 public:
404  RuleDoubleArithShift(const string &g) : Rule(g, 0, "doublearithshift") {}
405  virtual Rule *clone(const ActionGroupList &grouplist) const {
406  if (!grouplist.contains(getGroup())) return (Rule *)0;
407  return new RuleDoubleArithShift(getGroup());
408  }
409  virtual void getOpList(vector<uint4> &oplist) const;
410  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
411 };
412 class RuleConcatShift : public Rule {
413 public:
414  RuleConcatShift(const string &g) : Rule(g, 0, "concatshift") {}
415  virtual Rule *clone(const ActionGroupList &grouplist) const {
416  if (!grouplist.contains(getGroup())) return (Rule *)0;
417  return new RuleConcatShift(getGroup());
418  }
419  virtual void getOpList(vector<uint4> &oplist) const;
420  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
421 };
422 class RuleLeftRight : public Rule {
423 public:
424  RuleLeftRight(const string &g) : Rule(g, 0, "leftright") {}
425  virtual Rule *clone(const ActionGroupList &grouplist) const {
426  if (!grouplist.contains(getGroup())) return (Rule *)0;
427  return new RuleLeftRight(getGroup());
428  }
429  virtual void getOpList(vector<uint4> &oplist) const;
430  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
431 };
432 class RuleShiftCompare : public Rule {
433 public:
434  RuleShiftCompare(const string &g) : Rule(g, 0, "shiftcompare") {}
435  virtual Rule *clone(const ActionGroupList &grouplist) const {
436  if (!grouplist.contains(getGroup())) return (Rule *)0;
437  return new RuleShiftCompare(getGroup());
438  }
439  virtual void getOpList(vector<uint4> &oplist) const;
440  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
441 };
442 // class RuleShiftLess : public Rule {
443 // public:
444 // RuleShiftLess(const string &g) : Rule(g, 0, "shiftless") {} ///< Constructor
445 // virtual Rule *clone(const ActionGroupList &grouplist) const {
446 // if (!grouplist.contains(getGroup())) return (Rule *)0;
447 // return new RuleShiftLess(getGroup());
448 // }
449 // virtual void getOpList(vector<uint4> &oplist) const;
450 // virtual int4 applyOp(PcodeOp *op,Funcdata &data);
451 // };
452 class RuleLessEqual : public Rule {
453 public:
454  RuleLessEqual(const string &g) : Rule(g, 0, "lessequal") {}
455  virtual Rule *clone(const ActionGroupList &grouplist) const {
456  if (!grouplist.contains(getGroup())) return (Rule *)0;
457  return new RuleLessEqual(getGroup());
458  }
459  virtual void getOpList(vector<uint4> &oplist) const;
460  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
461 };
462 class RuleLessNotEqual : public Rule {
463 public:
464  RuleLessNotEqual(const string &g) : Rule(g, 0, "lessnotequal") {}
465  virtual Rule *clone(const ActionGroupList &grouplist) const {
466  if (!grouplist.contains(getGroup())) return (Rule *)0;
467  return new RuleLessNotEqual(getGroup());
468  }
469  virtual void getOpList(vector<uint4> &oplist) const;
470  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
471 };
472 class RuleTrivialArith : public Rule {
473 public:
474  RuleTrivialArith(const string &g) : Rule(g, 0, "trivialarith") {}
475  virtual Rule *clone(const ActionGroupList &grouplist) const {
476  if (!grouplist.contains(getGroup())) return (Rule *)0;
477  return new RuleTrivialArith(getGroup());
478  }
479  virtual void getOpList(vector<uint4> &oplist) const;
480  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
481 };
482 class RuleTrivialBool : public Rule {
483 public:
484  RuleTrivialBool(const string &g) : Rule(g, 0, "trivialbool") {}
485  virtual Rule *clone(const ActionGroupList &grouplist) const {
486  if (!grouplist.contains(getGroup())) return (Rule *)0;
487  return new RuleTrivialBool(getGroup());
488  }
489  virtual void getOpList(vector<uint4> &oplist) const;
490  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
491 };
492 class RuleZextEliminate : public Rule {
493 public:
494  RuleZextEliminate(const string &g) : Rule(g, 0, "zexteliminate") {}
495  virtual Rule *clone(const ActionGroupList &grouplist) const {
496  if (!grouplist.contains(getGroup())) return (Rule *)0;
497  return new RuleZextEliminate(getGroup());
498  }
499  virtual void getOpList(vector<uint4> &oplist) const;
500  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
501 };
502 class RuleSlessToLess : public Rule {
503 public:
504  RuleSlessToLess(const string &g) : Rule(g, 0, "slesstoless") {}
505  virtual Rule *clone(const ActionGroupList &grouplist) const {
506  if (!grouplist.contains(getGroup())) return (Rule *)0;
507  return new RuleSlessToLess(getGroup());
508  }
509  virtual void getOpList(vector<uint4> &oplist) const;
510  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
511 };
512 class RuleZextSless : public Rule {
513 public:
514  RuleZextSless(const string &g) : Rule(g, 0, "zextsless") {}
515  virtual Rule *clone(const ActionGroupList &grouplist) const {
516  if (!grouplist.contains(getGroup())) return (Rule *)0;
517  return new RuleZextSless(getGroup());
518  }
519  virtual void getOpList(vector<uint4> &oplist) const;
520  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
521 };
522 class RuleBitUndistribute : public Rule {
523 public:
524  RuleBitUndistribute(const string &g) : Rule(g, 0, "bitundistribute") {}
525  virtual Rule *clone(const ActionGroupList &grouplist) const {
526  if (!grouplist.contains(getGroup())) return (Rule *)0;
527  return new RuleBitUndistribute(getGroup());
528  }
529  virtual void getOpList(vector<uint4> &oplist) const;
530  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
531 };
532 class RuleBooleanNegate : public Rule {
533 public:
534  RuleBooleanNegate(const string &g) : Rule(g, 0, "booleannegate") {}
535  virtual Rule *clone(const ActionGroupList &grouplist) const {
536  if (!grouplist.contains(getGroup())) return (Rule *)0;
537  return new RuleBooleanNegate(getGroup());
538  }
539  virtual void getOpList(vector<uint4> &oplist) const;
540  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
541 };
542 class RuleBoolZext : public Rule {
543 public:
544  RuleBoolZext(const string &g) : Rule(g, 0, "boolzext") {}
545  virtual Rule *clone(const ActionGroupList &grouplist) const {
546  if (!grouplist.contains(getGroup())) return (Rule *)0;
547  return new RuleBoolZext(getGroup());
548  }
549  virtual void getOpList(vector<uint4> &oplist) const;
550  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
551 };
552 class RuleLogic2Bool : public Rule {
553 public:
554  RuleLogic2Bool(const string &g) : Rule(g, 0, "logic2bool") {}
555  virtual Rule *clone(const ActionGroupList &grouplist) const {
556  if (!grouplist.contains(getGroup())) return (Rule *)0;
557  return new RuleLogic2Bool(getGroup());
558  }
559  virtual void getOpList(vector<uint4> &oplist) const;
560  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
561 };
562 class RuleIndirectCollapse : public Rule {
563 public:
564  RuleIndirectCollapse(const string &g) : Rule(g, 0, "indirectcollapse") {}
565  virtual Rule *clone(const ActionGroupList &grouplist) const {
566  if (!grouplist.contains(getGroup())) return (Rule *)0;
567  return new RuleIndirectCollapse(getGroup());
568  }
569  virtual void getOpList(vector<uint4> &oplist) const;
570  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
571 };
572 class RuleMultiCollapse : public Rule {
573 public:
574  RuleMultiCollapse(const string &g) : Rule(g, 0, "multicollapse") {}
575  virtual Rule *clone(const ActionGroupList &grouplist) const {
576  if (!grouplist.contains(getGroup())) return (Rule *)0;
577  return new RuleMultiCollapse(getGroup());
578  }
579  virtual void getOpList(vector<uint4> &oplist) const;
580  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
581 };
582 class RuleSborrow : public Rule {
583 public:
584  RuleSborrow(const string &g) : Rule(g, 0, "sborrow") {}
585  virtual Rule *clone(const ActionGroupList &grouplist) const {
586  if (!grouplist.contains(getGroup())) return (Rule *)0;
587  return new RuleSborrow(getGroup());
588  }
589  virtual void getOpList(vector<uint4> &oplist) const;
590  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
591 };
592 class RuleTrivialShift : public Rule {
593 public:
594  RuleTrivialShift(const string &g) : Rule(g, 0, "trivialshift") {}
595  virtual Rule *clone(const ActionGroupList &grouplist) const {
596  if (!grouplist.contains(getGroup())) return (Rule *)0;
597  return new RuleTrivialShift(getGroup());
598  }
599  virtual void getOpList(vector<uint4> &oplist) const;
600  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
601 };
602 class RuleSignShift : public Rule {
603 public:
604  RuleSignShift(const string &g) : Rule(g, 0, "signshift") {}
605  virtual Rule *clone(const ActionGroupList &grouplist) const {
606  if (!grouplist.contains(getGroup())) return (Rule *)0;
607  return new RuleSignShift(getGroup());
608  }
609  virtual void getOpList(vector<uint4> &oplist) const;
610  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
611 };
612 class RuleTestSign : public Rule {
613  void findComparisons(Varnode *vn,vector<PcodeOp *> &res);
614 public:
615  RuleTestSign(const string &g) : Rule(g, 0, "testsign") {}
616  virtual Rule *clone(const ActionGroupList &grouplist) const {
617  if (!grouplist.contains(getGroup())) return (Rule *)0;
618  return new RuleTestSign(getGroup());
619  }
620  virtual void getOpList(vector<uint4> &oplist) const;
621  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
622 };
623 class RuleIdentityEl : public Rule {
624 public:
625  RuleIdentityEl(const string &g) : Rule(g, 0, "identityel") {}
626  virtual Rule *clone(const ActionGroupList &grouplist) const {
627  if (!grouplist.contains(getGroup())) return (Rule *)0;
628  return new RuleIdentityEl(getGroup());
629  }
630  virtual void getOpList(vector<uint4> &oplist) const;
631  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
632 };
633 class RuleShift2Mult : public Rule {
634 public:
635  RuleShift2Mult(const string &g) : Rule(g, 0, "shift2mult") {}
636  virtual Rule *clone(const ActionGroupList &grouplist) const {
637  if (!grouplist.contains(getGroup())) return (Rule *)0;
638  return new RuleShift2Mult(getGroup());
639  }
640  virtual void getOpList(vector<uint4> &oplist) const;
641  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
642 };
643 class RuleShiftPiece : public Rule {
644 public:
645  RuleShiftPiece(const string &g) : Rule(g, 0, "shiftpiece") {}
646  virtual Rule *clone(const ActionGroupList &grouplist) const {
647  if (!grouplist.contains(getGroup())) return (Rule *)0;
648  return new RuleShiftPiece(getGroup());
649  }
650  virtual void getOpList(vector<uint4> &oplist) const;
651  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
652 };
653 class RuleCollapseConstants : public Rule {
654 public:
655  RuleCollapseConstants(const string &g) : Rule(g, 0, "collapseconstants") {}
656  virtual Rule *clone(const ActionGroupList &grouplist) const {
657  if (!grouplist.contains(getGroup())) return (Rule *)0;
658  return new RuleCollapseConstants(getGroup());
659  }
660  // applies to all opcodes
661  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
662 };
663 class RuleTransformCpool : public Rule {
664 public:
665  RuleTransformCpool(const string &g) : Rule(g, 0, "transformcpool") {}
666  virtual Rule *clone(const ActionGroupList &grouplist) const {
667  if (!grouplist.contains(getGroup())) return (Rule *)0;
668  return new RuleTransformCpool(getGroup());
669  }
670  virtual void getOpList(vector<uint4> &oplist) const;
671  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
672 };
673 class RulePropagateCopy : public Rule {
674 public:
675  RulePropagateCopy(const string &g) : Rule(g, 0, "propagatecopy") {}
676  virtual Rule *clone(const ActionGroupList &grouplist) const {
677  if (!grouplist.contains(getGroup())) return (Rule *)0;
678  return new RulePropagateCopy(getGroup());
679  }
680  // applies to all opcodes
681  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
682 };
683 class Rule2Comp2Mult : public Rule {
684 public:
685  Rule2Comp2Mult(const string &g) : Rule(g,0,"2comp2mult") {}
686  virtual Rule *clone(const ActionGroupList &grouplist) const {
687  if (!grouplist.contains(getGroup())) return (Rule *)0;
688  return new Rule2Comp2Mult(getGroup());
689  }
690  virtual void getOpList(vector<uint4> &oplist) const;
691  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
692 };
693 class RuleCarryElim : public Rule {
694 public:
695  RuleCarryElim(const string &g) : Rule(g, 0, "carryelim") {}
696  virtual Rule *clone(const ActionGroupList &grouplist) const {
697  if (!grouplist.contains(getGroup())) return (Rule *)0;
698  return new RuleCarryElim(getGroup());
699  }
700  virtual void getOpList(vector<uint4> &oplist) const;
701  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
702 };
703 class RuleSub2Add : public Rule {
704 public:
705  RuleSub2Add(const string &g) : Rule(g, 0, "sub2add") {}
706  virtual Rule *clone(const ActionGroupList &grouplist) const {
707  if (!grouplist.contains(getGroup())) return (Rule *)0;
708  return new RuleSub2Add(getGroup());
709  }
710  virtual void getOpList(vector<uint4> &oplist) const;
711  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
712 };
713 class RuleXorCollapse : public Rule {
714 public:
715  RuleXorCollapse(const string &g) : Rule(g, 0, "xorcollapse") {}
716  virtual Rule *clone(const ActionGroupList &grouplist) const {
717  if (!grouplist.contains(getGroup())) return (Rule *)0;
718  return new RuleXorCollapse(getGroup());
719  }
720  virtual void getOpList(vector<uint4> &oplist) const;
721  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
722 };
723 class RuleAddMultCollapse : public Rule {
724 public:
725  RuleAddMultCollapse(const string &g) : Rule(g, 0, "addmultcollapse") {}
726  virtual Rule *clone(const ActionGroupList &grouplist) const {
727  if (!grouplist.contains(getGroup())) return (Rule *)0;
728  return new RuleAddMultCollapse(getGroup());
729  }
730  virtual void getOpList(vector<uint4> &oplist) const;
731  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
732 };
733 // class RuleUndistribute : public Rule {
734 // public:
735 // RuleUndistribute(const string &g) : Rule(g, 0, "undistribute") {} ///< Constructor
736 // virtual Rule *clone(const ActionGroupList &grouplist) const {
737 // if (!grouplist.contains(getGroup())) return (Rule *)0;
738 // return new RuleUndistribute(Group());
739 // }
740 // virtual void getOpList(vector<uint4> &oplist) const;
741 // virtual int4 applyOp(PcodeOp *op,Funcdata &data);
742 // };
743 class RuleLoadVarnode : public Rule {
744  friend class RuleStoreVarnode;
745  static AddrSpace *correctSpacebase(Architecture *glb,Varnode *vn,AddrSpace *spc);
746  static AddrSpace *vnSpacebase(Architecture *glb,Varnode *vn,uintb &val,AddrSpace *spc);
747  static AddrSpace *checkSpacebase(Architecture *glb,PcodeOp *op,uintb &offoff);
748 public:
749  RuleLoadVarnode(const string &g) : Rule(g, 0, "loadvarnode") {}
750  virtual Rule *clone(const ActionGroupList &grouplist) const {
751  if (!grouplist.contains(getGroup())) return (Rule *)0;
752  return new RuleLoadVarnode(getGroup());
753  }
754  virtual void getOpList(vector<uint4> &oplist) const;
755  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
756 };
757 class RuleStoreVarnode : public Rule {
758 public:
759  RuleStoreVarnode(const string &g) : Rule(g, 0, "storevarnode") {}
760  virtual Rule *clone(const ActionGroupList &grouplist) const {
761  if (!grouplist.contains(getGroup())) return (Rule *)0;
762  return new RuleStoreVarnode(getGroup());
763  }
764  virtual void getOpList(vector<uint4> &oplist) const;
765  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
766 };
767 // class RuleShadowVar : public Rule {
768 // public:
769 // RuleShadowVar(const string &g) : Rule(g, 0, "shadowvar") {} ///< Constructor
770 // virtual Rule *clone(const ActionGroupList &grouplist) const {
771 // if (!grouplist.contains(getGroup())) return (Rule *)0;
772 // return new RuleShadowVar(getGroup());
773 // }
774 // virtual void getOpList(vector<uint4> &oplist) const;
775 // virtual int4 applyOp(PcodeOp *op,Funcdata &data);
776 // };
777 class RuleSubExtComm : public Rule {
778 public:
779  RuleSubExtComm(const string &g) : Rule(g,0,"subextcomm") {}
780  virtual Rule *clone(const ActionGroupList &grouplist) const {
781  if (!grouplist.contains(getGroup())) return (Rule *)0;
782  return new RuleSubExtComm(getGroup());
783  }
784  virtual void getOpList(vector<uint4> &oplist) const;
785  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
786 };
787 class RuleSubCommute : public Rule {
788 public:
789  RuleSubCommute(const string &g) : Rule(g, 0, "subcommute") {}
790  virtual Rule *clone(const ActionGroupList &grouplist) const {
791  if (!grouplist.contains(getGroup())) return (Rule *)0;
792  return new RuleSubCommute(getGroup());
793  }
794  virtual void getOpList(vector<uint4> &oplist) const;
795  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
796  static bool cancelExtensions(PcodeOp *longform,PcodeOp *subOp,Varnode *ext0In,Varnode *ext1In,Funcdata &data);
797 };
798 class RuleConcatCommute : public Rule {
799 public:
800  RuleConcatCommute(const string &g) : Rule(g, 0, "concatcommute") {}
801  virtual Rule *clone(const ActionGroupList &grouplist) const {
802  if (!grouplist.contains(getGroup())) return (Rule *)0;
803  return new RuleConcatCommute(getGroup());
804  }
805  virtual void getOpList(vector<uint4> &oplist) const;
806  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
807 };
808 // class RuleIndirectConcat : public Rule {
809 // public:
810 // RuleIndirectConcat(const string &g) : Rule(g, 0, "indirectconcat") {} ///< Constructor
811 // virtual Rule *clone(const ActionGroupList &grouplist) const {
812 // if (!grouplist.contains(getGroup())) return (Rule *)0;
813 // return new RuleIndirectConcat(getGroup());
814 // }
815 // virtual void getOpList(vector<uint4> &oplist) const;
816 // virtual int4 applyOp(PcodeOp *op,Funcdata &data);
817 // };
818 class RuleConcatZext : public Rule {
819 public:
820  RuleConcatZext(const string &g) : Rule(g, 0, "concatzext") {}
821  virtual Rule *clone(const ActionGroupList &grouplist) const {
822  if (!grouplist.contains(getGroup())) return (Rule *)0;
823  return new RuleConcatZext(getGroup());
824  }
825  virtual void getOpList(vector<uint4> &oplist) const;
826  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
827 };
828 class RuleZextCommute : public Rule {
829 public:
830  RuleZextCommute(const string &g) : Rule(g, 0, "zextcommute") {}
831  virtual Rule *clone(const ActionGroupList &grouplist) const {
832  if (!grouplist.contains(getGroup())) return (Rule *)0;
833  return new RuleZextCommute(getGroup());
834  }
835  virtual void getOpList(vector<uint4> &oplist) const;
836  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
837 };
838 class RuleZextShiftZext : public Rule {
839 public:
840  RuleZextShiftZext(const string &g) : Rule(g, 0, "zextshiftzext") {}
841  virtual Rule *clone(const ActionGroupList &grouplist) const {
842  if (!grouplist.contains(getGroup())) return (Rule *)0;
843  return new RuleZextShiftZext(getGroup());
844  }
845  virtual void getOpList(vector<uint4> &oplist) const;
846  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
847 };
848 class RuleShiftAnd : public Rule {
849 public:
850  RuleShiftAnd(const string &g) : Rule(g, 0, "shiftand") {}
851  virtual Rule *clone(const ActionGroupList &grouplist) const {
852  if (!grouplist.contains(getGroup())) return (Rule *)0;
853  return new RuleShiftAnd(getGroup());
854  }
855  virtual void getOpList(vector<uint4> &oplist) const;
856  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
857 };
858 class RuleConcatZero : public Rule {
859 public:
860  RuleConcatZero(const string &g) : Rule(g, 0, "concatzero") {}
861  virtual Rule *clone(const ActionGroupList &grouplist) const {
862  if (!grouplist.contains(getGroup())) return (Rule *)0;
863  return new RuleConcatZero(getGroup());
864  }
865  virtual void getOpList(vector<uint4> &oplist) const;
866  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
867 };
868 class RuleConcatLeftShift : public Rule {
869 public:
870  RuleConcatLeftShift(const string &g) : Rule(g, 0, "concatleftshift") {}
871  virtual Rule *clone(const ActionGroupList &grouplist) const {
872  if (!grouplist.contains(getGroup())) return (Rule *)0;
873  return new RuleConcatLeftShift(getGroup());
874  }
875  virtual void getOpList(vector<uint4> &oplist) const;
876  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
877 };
878 class RuleSubZext : public Rule {
879 public:
880  RuleSubZext(const string &g) : Rule(g, 0, "subzext") {}
881  virtual Rule *clone(const ActionGroupList &grouplist) const {
882  if (!grouplist.contains(getGroup())) return (Rule *)0;
883  return new RuleSubZext(getGroup());
884  }
885  virtual void getOpList(vector<uint4> &oplist) const;
886  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
887 };
888 class RuleSubCancel : public Rule {
889 public:
890  RuleSubCancel(const string &g) : Rule(g, 0, "subcancel") {}
891  virtual Rule *clone(const ActionGroupList &grouplist) const {
892  if (!grouplist.contains(getGroup())) return (Rule *)0;
893  return new RuleSubCancel(getGroup());
894  }
895  virtual void getOpList(vector<uint4> &oplist) const;
896  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
897 };
898 class RuleShiftSub : public Rule {
899 public:
900  RuleShiftSub(const string &g) : Rule(g, 0, "shiftsub") {}
901  virtual Rule *clone(const ActionGroupList &grouplist) const {
902  if (!grouplist.contains(getGroup())) return (Rule *)0;
903  return new RuleShiftSub(getGroup());
904  }
905  virtual void getOpList(vector<uint4> &oplist) const;
906  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
907 };
908 class RuleHumptyDumpty : public Rule {
909 public:
910  RuleHumptyDumpty(const string &g) : Rule(g, 0, "humptydumpty") {}
911  virtual Rule *clone(const ActionGroupList &grouplist) const {
912  if (!grouplist.contains(getGroup())) return (Rule *)0;
913  return new RuleHumptyDumpty(getGroup());
914  }
915  virtual void getOpList(vector<uint4> &oplist) const;
916  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
917 };
918 class RuleDumptyHump : public Rule {
919 public:
920  RuleDumptyHump(const string &g) : Rule(g, 0, "dumptyhump") {}
921  virtual Rule *clone(const ActionGroupList &grouplist) const {
922  if (!grouplist.contains(getGroup())) return (Rule *)0;
923  return new RuleDumptyHump(getGroup());
924  }
925  virtual void getOpList(vector<uint4> &oplist) const;
926  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
927 };
928 class RuleHumptyOr : public Rule {
929 public:
930  RuleHumptyOr(const string &g) : Rule(g, 0, "humptyor") {}
931  virtual Rule *clone(const ActionGroupList &grouplist) const {
932  if (!grouplist.contains(getGroup())) return (Rule *)0;
933  return new RuleHumptyOr(getGroup());
934  }
935  virtual void getOpList(vector<uint4> &oplist) const;
936  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
937 };
938 class RuleEmbed : public Rule {
939 public:
940  RuleEmbed(const string &g) : Rule(g, 0, "embed") {}
941  virtual Rule *clone(const ActionGroupList &grouplist) const {
942  if (!grouplist.contains(getGroup())) return (Rule *)0;
943  return new RuleEmbed(getGroup());
944  }
945  virtual void getOpList(vector<uint4> &oplist) const;
946  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
947 };
948 class RuleSwitchSingle : public Rule {
949 public:
950  RuleSwitchSingle(const string &g) : Rule(g,0,"switchsingle") {}
951  virtual Rule *clone(const ActionGroupList &grouplist) const {
952  if (!grouplist.contains(getGroup())) return (Rule *)0;
953  return new RuleSwitchSingle(getGroup());
954  }
955  virtual void getOpList(vector<uint4> &oplist) const;
956  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
957 };
958 class RuleCondNegate : public Rule {
959 public:
960  RuleCondNegate(const string &g) : Rule(g, 0, "condnegate") {}
961  virtual Rule *clone(const ActionGroupList &grouplist) const {
962  if (!grouplist.contains(getGroup())) return (Rule *)0;
963  return new RuleCondNegate(getGroup());
964  }
965  virtual void getOpList(vector<uint4> &oplist) const;
966  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
967 };
968 class RuleBoolNegate : public Rule {
969 public:
970  RuleBoolNegate(const string &g) : Rule(g, 0, "boolnegate") {}
971  virtual Rule *clone(const ActionGroupList &grouplist) const {
972  if (!grouplist.contains(getGroup())) return (Rule *)0;
973  return new RuleBoolNegate(getGroup());
974  }
975  virtual void getOpList(vector<uint4> &oplist) const;
976  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
977 };
978 class RuleLess2Zero : public Rule {
979 public:
980  RuleLess2Zero(const string &g) : Rule(g, 0, "less2zero") {}
981  virtual Rule *clone(const ActionGroupList &grouplist) const {
982  if (!grouplist.contains(getGroup())) return (Rule *)0;
983  return new RuleLess2Zero(getGroup());
984  }
985  virtual void getOpList(vector<uint4> &oplist) const;
986  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
987 };
988 class RuleLessEqual2Zero : public Rule {
989 public:
990  RuleLessEqual2Zero(const string &g) : Rule(g, 0, "lessequal2zero") {}
991  virtual Rule *clone(const ActionGroupList &grouplist) const {
992  if (!grouplist.contains(getGroup())) return (Rule *)0;
993  return new RuleLessEqual2Zero(getGroup());
994  }
995  virtual void getOpList(vector<uint4> &oplist) const;
996  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
997 };
998 class RuleSLess2Zero : public Rule {
999  static Varnode *getHiBit(PcodeOp *op);
1000 public:
1001  RuleSLess2Zero(const string &g) : Rule(g, 0, "sless2zero") {}
1002  virtual Rule *clone(const ActionGroupList &grouplist) const {
1003  if (!grouplist.contains(getGroup())) return (Rule *)0;
1004  return new RuleSLess2Zero(getGroup());
1005  }
1006  virtual void getOpList(vector<uint4> &oplist) const;
1007  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1008 };
1009 class RuleEqual2Zero : public Rule {
1010 public:
1011  RuleEqual2Zero(const string &g) : Rule(g, 0, "equal2zero") {}
1012  virtual Rule *clone(const ActionGroupList &grouplist) const {
1013  if (!grouplist.contains(getGroup())) return (Rule *)0;
1014  return new RuleEqual2Zero(getGroup());
1015  }
1016  virtual void getOpList(vector<uint4> &oplist) const;
1017  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1018 };
1019 class RuleEqual2Constant : public Rule {
1020 public:
1021  RuleEqual2Constant(const string &g) : Rule(g, 0, "equal2constant") {}
1022  virtual Rule *clone(const ActionGroupList &grouplist) const {
1023  if (!grouplist.contains(getGroup())) return (Rule *)0;
1024  return new RuleEqual2Constant(getGroup());
1025  }
1026  virtual void getOpList(vector<uint4> &oplist) const;
1027  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1028 };
1029 class RulePtrArith : public Rule {
1030  static bool verifyAddTreeBottom(PcodeOp *op,int4 slot);
1031 public:
1032  RulePtrArith(const string &g) : Rule(g, 0, "ptrarith") {}
1033  virtual Rule *clone(const ActionGroupList &grouplist) const {
1034  if (!grouplist.contains(getGroup())) return (Rule *)0;
1035  return new RulePtrArith(getGroup());
1036  }
1037  virtual void getOpList(vector<uint4> &oplist) const;
1038  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1039 };
1040 class RuleStructOffset0 : public Rule {
1041 public:
1042  RuleStructOffset0(const string &g) : Rule(g, 0, "structoffset0") {}
1043  virtual Rule *clone(const ActionGroupList &grouplist) const {
1044  if (!grouplist.contains(getGroup())) return (Rule *)0;
1045  return new RuleStructOffset0(getGroup());
1046  }
1047  virtual void getOpList(vector<uint4> &oplist) const;
1048  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1049 };
1050 class RulePushPtr : public Rule {
1051 public:
1052  RulePushPtr(const string &g) : Rule(g, 0, "pushptr") {}
1053  virtual Rule *clone(const ActionGroupList &grouplist) const {
1054  if (!grouplist.contains(getGroup())) return (Rule *)0;
1055  return new RulePushPtr(getGroup());
1056  }
1057  virtual void getOpList(vector<uint4> &oplist) const;
1058  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1059 };
1060 class RulePtraddUndo : public Rule {
1061 public:
1062  RulePtraddUndo(const string &g) : Rule(g, 0, "ptraddundo") {}
1063  virtual Rule *clone(const ActionGroupList &grouplist) const {
1064  if (!grouplist.contains(getGroup())) return (Rule *)0;
1065  return new RulePtraddUndo(getGroup());
1066  }
1067  virtual void getOpList(vector<uint4> &oplist) const;
1068  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1069 };
1070 class RulePtrsubUndo : public Rule {
1071 public:
1072  RulePtrsubUndo(const string &g) : Rule(g, 0, "ptrsubundo") {}
1073  virtual Rule *clone(const ActionGroupList &grouplist) const {
1074  if (!grouplist.contains(getGroup())) return (Rule *)0;
1075  return new RulePtrsubUndo(getGroup());
1076  }
1077  virtual void getOpList(vector<uint4> &oplist) const;
1078  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1079 };
1080 
1081 // Cleanup rules
1082 class RuleMultNegOne : public Rule {
1083 public:
1084  RuleMultNegOne(const string &g) : Rule( g, 0, "multnegone") {}
1085  virtual Rule *clone(const ActionGroupList &grouplist) const {
1086  if (!grouplist.contains(getGroup())) return (Rule *)0;
1087  return new RuleMultNegOne(getGroup());
1088  }
1089  virtual void getOpList(vector<uint4> &oplist) const;
1090  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1091 };
1092 
1093 class RuleAddUnsigned : public Rule {
1094 public:
1095  RuleAddUnsigned(const string &g) : Rule( g, 0, "addunsigned") {}
1096  virtual Rule *clone(const ActionGroupList &grouplist) const {
1097  if (!grouplist.contains(getGroup())) return (Rule *)0;
1098  return new RuleAddUnsigned(getGroup());
1099  }
1100  virtual void getOpList(vector<uint4> &oplist) const;
1101  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1102 };
1103 
1104 class Rule2Comp2Sub : public Rule {
1105 public:
1106  Rule2Comp2Sub(const string &g) : Rule( g, 0, "2comp2sub") {}
1107  virtual Rule *clone(const ActionGroupList &grouplist) const {
1108  if (!grouplist.contains(getGroup())) return (Rule *)0;
1109  return new Rule2Comp2Sub(getGroup());
1110  }
1111  virtual void getOpList(vector<uint4> &oplist) const;
1112  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1113 };
1114 
1115 class RuleSubRight : public Rule {
1116 public:
1117  RuleSubRight(const string &g) : Rule( g, 0, "subright") {}
1118  virtual Rule *clone(const ActionGroupList &grouplist) const {
1119  if (!grouplist.contains(getGroup())) return (Rule *)0;
1120  return new RuleSubRight(getGroup());
1121  }
1122  virtual void getOpList(vector<uint4> &oplist) const;
1123  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1124 };
1125 
1127  bool pushConstFurther(Funcdata &data,TypePointer *outtype,PcodeOp *op,int4 slot,uintb val);
1128 public:
1129  RulePtrsubCharConstant(const string &g) : Rule( g, 0, "ptrsubcharconstant") {}
1130  virtual Rule *clone(const ActionGroupList &grouplist) const {
1131  if (!grouplist.contains(getGroup())) return (Rule *)0;
1132  return new RulePtrsubCharConstant(getGroup());
1133  }
1134  virtual void getOpList(vector<uint4> &oplist) const;
1135  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1136 };
1137 
1138 class RuleSubNormal : public Rule {
1139 public:
1140  RuleSubNormal(const string &g) : Rule( g, 0, "subnormal") {}
1141  virtual Rule *clone(const ActionGroupList &grouplist) const {
1142  if (!grouplist.contains(getGroup())) return (Rule *)0;
1143  return new RuleSubNormal(getGroup());
1144  }
1145  virtual void getOpList(vector<uint4> &oplist) const;
1146  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1147 };
1148 
1149 // class RuleRightShiftSub : public Rule {
1150 // public:
1151 // RuleRightShiftSub(const string &g) : Rule( g, 0, "rightshiftsub") {} ///< Constructor
1152 // virtual Rule *clone(const ActionGroupList &grouplist) const {
1153 // if (!grouplist.contains(getGroup())) return (Rule *)0;
1154 // return new RuleRightShiftSub(Group());
1155 // }
1156 // virtual void getOpList(vector<uint4> &oplist) const;
1157 // virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1158 // };
1159 
1160 class RulePositiveDiv : public Rule {
1161 public:
1162  RulePositiveDiv(const string &g) : Rule( g, 0, "positivediv") {}
1163  virtual Rule *clone(const ActionGroupList &grouplist) const {
1164  if (!grouplist.contains(getGroup())) return (Rule *)0;
1165  return new RulePositiveDiv(getGroup());
1166  }
1167  virtual void getOpList(vector<uint4> &oplist) const;
1168  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1169 };
1170 
1171 class RuleDivTermAdd : public Rule {
1172 public:
1173  RuleDivTermAdd(const string &g) : Rule( g, 0, "divtermadd") {}
1174  virtual Rule *clone(const ActionGroupList &grouplist) const {
1175  if (!grouplist.contains(getGroup())) return (Rule *)0;
1176  return new RuleDivTermAdd(getGroup());
1177  }
1178  virtual void getOpList(vector<uint4> &oplist) const;
1179  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1180  static PcodeOp *findSubshift(PcodeOp *op,int4 &n,OpCode &shiftopc);
1181 };
1182 
1183 class RuleDivTermAdd2 : public Rule {
1184 public:
1185  RuleDivTermAdd2(const string &g) : Rule( g, 0, "divtermadd2") {}
1186  virtual Rule *clone(const ActionGroupList &grouplist) const {
1187  if (!grouplist.contains(getGroup())) return (Rule *)0;
1188  return new RuleDivTermAdd2(getGroup());
1189  }
1190  virtual void getOpList(vector<uint4> &oplist) const;
1191  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1192 };
1193 
1194 class RuleDivOpt : public Rule {
1195  static uintb calcDivisor(uintb n,uint8 y,int4 xsize);
1196  static void moveSignBitExtraction(Varnode *firstVn,Varnode *replaceVn,Funcdata &data);
1197  static bool checkFormOverlap(PcodeOp *op);
1198 public:
1199  RuleDivOpt(const string &g) : Rule( g, 0, "divopt") {}
1200  virtual Rule *clone(const ActionGroupList &grouplist) const {
1201  if (!grouplist.contains(getGroup())) return (Rule *)0;
1202  return new RuleDivOpt(getGroup());
1203  }
1204  virtual void getOpList(vector<uint4> &oplist) const;
1205  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1206  static Varnode *findForm(PcodeOp *op,int4 &n,uintb &y,int4 &xsize,OpCode &extopc);
1207 };
1208 
1209 class RuleSignDiv2 : public Rule {
1210 public:
1211  RuleSignDiv2(const string &g) : Rule( g, 0, "signdiv2") {}
1212  virtual Rule *clone(const ActionGroupList &grouplist) const {
1213  if (!grouplist.contains(getGroup())) return (Rule *)0;
1214  return new RuleSignDiv2(getGroup());
1215  }
1216  virtual void getOpList(vector<uint4> &oplist) const;
1217  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1218 };
1219 
1220 class RuleSignForm : public Rule {
1221 public:
1222  RuleSignForm(const string &g) : Rule( g, 0, "signform") {}
1223  virtual Rule *clone(const ActionGroupList &grouplist) const {
1224  if (!grouplist.contains(getGroup())) return (Rule *)0;
1225  return new RuleSignForm(getGroup());
1226  }
1227  virtual void getOpList(vector<uint4> &oplist) const;
1228  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1229 };
1230 
1231 class RuleSignNearMult : public Rule {
1232 public:
1233  RuleSignNearMult(const string &g) : Rule( g, 0, "signnearmult") {}
1234  virtual Rule *clone(const ActionGroupList &grouplist) const {
1235  if (!grouplist.contains(getGroup())) return (Rule *)0;
1236  return new RuleSignNearMult(getGroup());
1237  }
1238  virtual void getOpList(vector<uint4> &oplist) const;
1239  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1240 };
1241 
1242 class RuleModOpt: public Rule {
1243 public:
1244  RuleModOpt(const string &g) : Rule( g, 0, "modopt") {}
1245  virtual Rule *clone(const ActionGroupList &grouplist) const {
1246  if (!grouplist.contains(getGroup())) return (Rule *)0;
1247  return new RuleModOpt(getGroup());
1248  }
1249  virtual void getOpList(vector<uint4> &oplist) const;
1250  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1251 };
1252 
1253 class RuleSegment : public Rule {
1254 public:
1255  RuleSegment(const string &g) : Rule( g, 0, "segment") {}
1256  virtual Rule *clone(const ActionGroupList &grouplist) const {
1257  if (!grouplist.contains(getGroup())) return (Rule *)0;
1258  return new RuleSegment(getGroup());
1259  }
1260  virtual void getOpList(vector<uint4> &oplist) const;
1261  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1262 };
1263 
1264 class RuleSubvarAnd : public Rule {
1265 public:
1266  RuleSubvarAnd(const string &g) : Rule( g, 0, "subvar_and") {}
1267  virtual Rule *clone(const ActionGroupList &grouplist) const {
1268  if (!grouplist.contains(getGroup())) return (Rule *)0;
1269  return new RuleSubvarAnd(getGroup());
1270  }
1271  virtual void getOpList(vector<uint4> &oplist) const;
1272  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1273 };
1274 
1275 class RuleSubvarSubpiece : public Rule {
1276 public:
1277  RuleSubvarSubpiece(const string &g) : Rule( g, 0, "subvar_subpiece") {}
1278  virtual Rule *clone(const ActionGroupList &grouplist) const {
1279  if (!grouplist.contains(getGroup())) return (Rule *)0;
1280  return new RuleSubvarSubpiece(getGroup());
1281  }
1282  virtual void getOpList(vector<uint4> &oplist) const;
1283  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1284 };
1285 
1286 class RuleSplitFlow : public Rule {
1287 public:
1288  RuleSplitFlow(const string &g) : Rule( g, 0, "splitflow") {}
1289  virtual Rule *clone(const ActionGroupList &grouplist) const {
1290  if (!grouplist.contains(getGroup())) return (Rule *)0;
1291  return new RuleSplitFlow(getGroup());
1292  }
1293  virtual void getOpList(vector<uint4> &oplist) const;
1294  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1295 };
1296 
1297 class RulePtrFlow : public Rule {
1298  Architecture *glb;
1299  bool hasTruncations;
1300  bool trialSetPtrFlow(PcodeOp *op);
1301  bool propagateFlowToDef(Varnode *vn);
1302  bool propagateFlowToReads(Varnode *vn);
1303  Varnode *truncatePointer(AddrSpace *spc,PcodeOp *op,Varnode *vn,int4 slot,Funcdata &data);
1304 public:
1305  RulePtrFlow(const string &g,Architecture *conf);
1306  virtual Rule *clone(const ActionGroupList &grouplist) const {
1307  if (!grouplist.contains(getGroup())) return (Rule *)0;
1308  return new RulePtrFlow(getGroup(),glb);
1309  }
1310  virtual void getOpList(vector<uint4> &oplist) const;
1311  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1312 };
1313 
1314 class RuleSubvarCompZero : public Rule {
1315 public:
1316  RuleSubvarCompZero(const string &g) : Rule( g, 0, "subvar_compzero") {}
1317  virtual Rule *clone(const ActionGroupList &grouplist) const {
1318  if (!grouplist.contains(getGroup())) return (Rule *)0;
1319  return new RuleSubvarCompZero(getGroup());
1320  }
1321  virtual void getOpList(vector<uint4> &oplist) const;
1322  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1323 };
1324 
1325 class RuleSubvarShift : public Rule {
1326 public:
1327  RuleSubvarShift(const string &g) : Rule( g, 0, "subvar_shift") {}
1328  virtual Rule *clone(const ActionGroupList &grouplist) const {
1329  if (!grouplist.contains(getGroup())) return (Rule *)0;
1330  return new RuleSubvarShift(getGroup());
1331  }
1332  virtual void getOpList(vector<uint4> &oplist) const;
1333  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1334 };
1335 
1336 class RuleSubvarZext : public Rule {
1337 public:
1338  RuleSubvarZext(const string &g) : Rule( g, 0, "subvar_zext") {}
1339  virtual Rule *clone(const ActionGroupList &grouplist) const {
1340  if (!grouplist.contains(getGroup())) return (Rule *)0;
1341  return new RuleSubvarZext(getGroup());
1342  }
1343  virtual void getOpList(vector<uint4> &oplist) const;
1344  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1345 };
1346 
1347 class RuleSubvarSext : public Rule {
1348  int4 isaggressive;
1349 public:
1350  RuleSubvarSext(const string &g) : Rule( g, 0, "subvar_sext") { isaggressive = false; }
1351  virtual Rule *clone(const ActionGroupList &grouplist) const {
1352  if (!grouplist.contains(getGroup())) return (Rule *)0;
1353  return new RuleSubvarSext(getGroup());
1354  }
1355  virtual void getOpList(vector<uint4> &oplist) const;
1356  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1357  virtual void reset(Funcdata &data);
1358 };
1359 
1360 class RuleSubfloatConvert : public Rule {
1361 public:
1362  RuleSubfloatConvert(const string &g) : Rule( g, 0, "subfloat_convert") {}
1363  virtual Rule *clone(const ActionGroupList &grouplist) const {
1364  if (!grouplist.contains(getGroup())) return (Rule *)0;
1365  return new RuleSubfloatConvert(getGroup());
1366  }
1367  virtual void getOpList(vector<uint4> &oplist) const;
1368  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1369 };
1370 
1371 class RuleNegateNegate : public Rule {
1372 public:
1373  RuleNegateNegate(const string &g) : Rule( g, 0, "negatenegate") {}
1374  virtual Rule *clone(const ActionGroupList &grouplist) const {
1375  if (!grouplist.contains(getGroup())) return (Rule *)0;
1376  return new RuleNegateNegate(getGroup());
1377  }
1378  virtual void getOpList(vector<uint4> &oplist) const;
1379  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1380 };
1381 
1382 class RuleConditionalMove : public Rule {
1384  class BoolExpress {
1385  int4 optype;
1386  OpCode opc;
1387  PcodeOp *op;
1388  uintb val;
1389  Varnode *in0;
1390  Varnode *in1;
1391  bool mustreconstruct;
1392  public:
1393  bool isConstant(void) const { return (optype==0); }
1394  uintb getVal(void) const { return val; }
1395  bool initialize(Varnode *vn);
1396  bool evaluatePropagation(FlowBlock *root,FlowBlock *branch);
1397  Varnode *constructBool(PcodeOp *insertop,Funcdata &data);
1398  };
1399  static Varnode *constructNegate(Varnode *vn,PcodeOp *op,Funcdata &data);
1400 public:
1401  RuleConditionalMove(const string &g) : Rule( g, 0, "conditionalmove") {}
1402  virtual Rule *clone(const ActionGroupList &grouplist) const {
1403  if (!grouplist.contains(getGroup())) return (Rule *)0;
1404  return new RuleConditionalMove(getGroup());
1405  }
1406  virtual void getOpList(vector<uint4> &oplist) const;
1407  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1408 };
1409 
1410 class RuleFloatCast : public Rule {
1411 public:
1412  RuleFloatCast(const string &g) : Rule( g, 0, "floatcast") {}
1413  virtual Rule *clone(const ActionGroupList &grouplist) const {
1414  if (!grouplist.contains(getGroup())) return (Rule *)0;
1415  return new RuleFloatCast(getGroup());
1416  }
1417  virtual void getOpList(vector<uint4> &oplist) const;
1418  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1419 };
1420 
1421 class RuleIgnoreNan : public Rule {
1422 public:
1423  RuleIgnoreNan(const string &g) : Rule( g, 0, "ignorenan") {}
1424  virtual Rule *clone(const ActionGroupList &grouplist) const {
1425  if (!grouplist.contains(getGroup())) return (Rule *)0;
1426  return new RuleIgnoreNan(getGroup());
1427  }
1428  virtual void getOpList(vector<uint4> &oplist) const;
1429  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1430 };
1431 
1432 class RuleFuncPtrEncoding : public Rule {
1433 public:
1434  RuleFuncPtrEncoding(const string &g) : Rule( g, 0, "funcptrencoding") {}
1435  virtual Rule *clone(const ActionGroupList &grouplist) const {
1436  if (!grouplist.contains(getGroup())) return (Rule *)0;
1437  return new RuleFuncPtrEncoding(getGroup());
1438  }
1439  virtual void getOpList(vector<uint4> &oplist) const;
1440  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1441 };
1442 
1443 class RuleThreeWayCompare : public Rule {
1444 public:
1445  RuleThreeWayCompare(const string &g) : Rule( g, 0, "threewaycomp") {}
1446  virtual Rule *clone(const ActionGroupList &grouplist) const {
1447  if (!grouplist.contains(getGroup())) return (Rule *)0;
1448  return new RuleThreeWayCompare(getGroup());
1449  }
1450  virtual void getOpList(vector<uint4> &oplist) const;
1451  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1452  static PcodeOp *detectThreeWay(PcodeOp *op,bool &isPartial);
1453  static int4 testCompareEquivalence(PcodeOp *lessop,PcodeOp *lessequalop);
1454 };
1455 
1456 class RulePopcountBoolXor : public Rule {
1457 public:
1458  RulePopcountBoolXor(const string &g) : Rule( g, 0, "popcountboolxor") {}
1459  virtual Rule *clone(const ActionGroupList &grouplist) const {
1460  if (!grouplist.contains(getGroup())) return (Rule *)0;
1461  return new RulePopcountBoolXor(getGroup());
1462  }
1463  virtual void getOpList(vector<uint4> &oplist) const;
1464  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1465  static Varnode *getBooleanResult(Varnode *vn,int4 bitPos,int4 &constRes);
1466 };
1467 
1468 class RulePiecePathology : public Rule {
1469  static bool isPathology(Varnode *vn,Funcdata &data);
1470  static int4 tracePathologyForward(PcodeOp *op,Funcdata &data);
1471 public:
1472  RulePiecePathology(const string &g) : Rule( g, 0, "piecepathology") {}
1473  virtual Rule *clone(const ActionGroupList &grouplist) const {
1474  if (!grouplist.contains(getGroup())) return (Rule *)0;
1475  return new RulePiecePathology(getGroup());
1476  }
1477  virtual void getOpList(vector<uint4> &oplist) const;
1478  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1479 };
1480 
1481 class RuleXorSwap : public Rule {
1482 public:
1483  RuleXorSwap(const string &g) : Rule(g,0,"xorswap") {}
1484  virtual Rule *clone(const ActionGroupList &grouplist) const {
1485  if (!grouplist.contains(getGroup())) return (Rule *)0;
1486  return new RuleXorSwap(getGroup());
1487  }
1488  virtual void getOpList(vector<uint4> &oplist) const;
1489  virtual int4 applyOp(PcodeOp *op,Funcdata &data);
1490 };
1491 
1492 #endif
RuleShiftPiece::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:3393
RuleFuncPtrEncoding
Eliminate ARM/THUMB style masking of the low order bits on function pointers.
Definition: ruleaction.hh:1432
RuleSubvarSext
Perform SubvariableFlow analysis triggered by INT_SEXT.
Definition: ruleaction.hh:1347
RulePtrsubUndo
Remove PTRSUB operations with mismatched data-type information.
Definition: ruleaction.hh:1070
RuleSplitFlow::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:7563
RuleCondNegate::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:961
RuleConcatCommute
Commute PIECE with INT_AND, INT_OR, and INT_XOR.
Definition: ruleaction.hh:798
RuleFloatCast::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1413
RuleSignNearMult::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1234
RuleTrivialArith::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:2311
RuleOrCollapse::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:178
RuleConcatLeftShift::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:4545
RuleFuncPtrEncoding::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1435
Rule2Comp2Sub::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:6439
RuleBoolZext
Simplify boolean expressions of the form zext(V) * -1.
Definition: ruleaction.hh:542
RuleAndCommute::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:355
RuleFloatCast::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:8322
RuleShiftAnd::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:851
RuleLogic2Bool::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:2803
RuleDumptyHump::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:4815
RuleStructOffset0::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:6204
RuleDoubleArithShift
Simplify two sequential INT_SRIGHT: (x s>> #c) s>> #d => x s>> saturate(#c + #d)
Definition: ruleaction.hh:402
RuleConcatShift::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:1901
RuleAndMask::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:158
RulePropagateCopy
Propagate the input of a COPY to all the places that read the output.
Definition: ruleaction.hh:673
RulePtrsubCharConstant
Cleanup: Set-up to print string constants.
Definition: ruleaction.hh:1126
RuleHumptyDumpty::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:4762
RuleSubZext::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:881
RuleConcatShift
Simplify INT_RIGHT canceling PIECE: concat(V,W) >> c => zext(V)
Definition: ruleaction.hh:412
RuleSubvarZext::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1339
RuleAddMultCollapse::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:3718
RuleBooleanNegate::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:535
RuleSubfloatConvert::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:7952
RuleSegment::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:7433
Rule2Comp2Sub::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:6445
RuleDivOpt::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:7155
AddrSpace
A region where processor data is stored.
Definition: space.hh:73
RuleSubvarShift::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:7884
RuleDoubleSub
Simplify chained SUBPIECE: sub( sub(V,c), d) => sub(V, c+d)
Definition: ruleaction.hh:382
RuleSborrow::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:3035
RuleConcatLeftShift::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:871
RuleSubfloatConvert::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:7958
RuleBitUndistribute
Undo distributed operations through INT_AND, INT_OR, and INT_XOR.
Definition: ruleaction.hh:522
TypePointer
Datatype object representing a pointer.
Definition: type.hh:228
RuleDivTermAdd
Simplify expressions associated with optimized division expressions.
Definition: ruleaction.hh:1171
RuleConcatZext
Commute PIECE with INT_ZEXT: concat(zext(V),W) => zext(concat(V,W))
Definition: ruleaction.hh:818
FlowBlock
Description of a control-flow block containing PcodeOps.
Definition: block.hh:60
RuleConcatZext::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:4351
RuleNegateIdentity::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:444
RuleSignDiv2::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:7233
RuleTrivialShift
Simplify trivial shifts: V << 0 => V, V << #64 => 0
Definition: ruleaction.hh:592
RuleSelectCse::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:108
RulePullsubIndirect
Pull-back SUBPIECE through INDIRECT.
Definition: ruleaction.hh:271
RuleDivTermAdd2::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1186
RuleAndCompare::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:1692
RuleLessOne::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:1317
RuleAndOrLump
Collapse constants in logical expressions: (V & c) & d => V & (c & d)
Definition: ruleaction.hh:185
RuleSubvarSubpiece::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:7517
RuleSubvarZext::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:7904
RuleStructOffset0::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:6211
RuleSubvarCompZero::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:7820
RuleBooleanNegate::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:2630
RuleRightShiftAnd::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:578
RuleIgnoreNan::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1424
RuleSubfloatConvert
Perform SubfloatFlow analysis triggered by FLOAT_FLOAT2FLOAT.
Definition: ruleaction.hh:1360
RuleSubvarShift::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:7878
RuleBitUndistribute::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:2555
RuleAddMultCollapse
Collapse constants in an additive or multiplicative expression.
Definition: ruleaction.hh:723
RuleIntLessEqual::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:602
RuleAndDistribute::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:1246
RuleStoreVarnode::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:760
RuleZextSless::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:2505
RuleFuncPtrEncoding::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:8395
RuleTermOrder::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:648
RuleEquality
Collapse INT_EQUAL and INT_NOTEQUAL: f(V,W) == f(V,W) => true
Definition: ruleaction.hh:235
RuleCarryElim::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:3615
Rule
Class for performing a single transformation on a PcodeOp or Varnode.
Definition: action.hh:194
RuleDivTermAdd2
Simplify another expression associated with optimized division.
Definition: ruleaction.hh:1183
RuleLoadVarnode::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:3888
RuleDoubleShift::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:1794
RuleDoubleArithShift::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:1866
RuleSubvarZext::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:7910
RuleModOpt::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1245
RuleSub2Add::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:706
RulePtrsubUndo::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:6358
RulePullsubIndirect::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:274
RuleBoolNegate::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:971
RuleSplitFlow::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:7557
RuleHighOrderAnd::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:1182
RuleAndOrLump::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:411
RuleDoubleSub::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:1759
RuleShift2Mult
Convert INT_LEFT to INT_MULT: V << 2 => V * 4
Definition: ruleaction.hh:633
RuleLessEqual2Zero::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:5221
RuleHighOrderAnd
Simplify INT_AND when applied to aligned INT_ADD: (V + c) & 0xfff0 => V + (c & 0xfff0)
Definition: ruleaction.hh:302
RuleEqual2Constant::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:5554
RuleTrivialShift::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:595
RuleSignNearMult::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:7317
RuleTermOrder::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:661
RuleShiftBitops::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:479
RuleDivOpt::findForm
static Varnode * findForm(PcodeOp *op, int4 &n, uintb &y, int4 &xsize, OpCode &extopc)
Check for INT_(S)RIGHT and/or SUBPIECE followed by INT_MULT.
Definition: ruleaction.cc:6947
RuleConcatZero
Simplify concatenation with zero: concat(V,0) => zext(V) << c
Definition: ruleaction.hh:858
RuleDumptyHump::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:921
RuleCarryElim::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:696
RuleSubCancel::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:4667
RuleFloatRange::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:345
RulePtrArith
Transform pointer arithmetic.
Definition: ruleaction.hh:1029
RulePositiveDiv::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1163
RuleZextEliminate::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:2436
RuleShiftCompare::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:1999
RuleNotDistribute::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:1139
RuleThreeWayCompare::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1446
RuleConcatShift::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:415
RulePullsubMulti::minMaxUse
static void minMaxUse(Varnode *vn, int4 &maxByte, int4 &minByte)
Compute minimum and maximum bytes being used.
Definition: ruleaction.cc:681
RuleAddUnsigned::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:6408
RuleLessEqual2Zero::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:5215
RuleBoolNegate::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:5131
RuleDoubleSub::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:1753
RuleSignShift::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:3151
RuleSubNormal::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:6615
RuleAndCommute::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:1524
RuleTransformCpool::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:666
RulePiece2Zext::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:217
RuleConcatLeftShift
Simplify concatenation of extended value: concat(V, zext(W) << c) => concat( concat(V,...
Definition: ruleaction.hh:868
RuleSubRight
Cleanup: Convert truncation to cast: sub(V,c) => sub(V>>c*8,0)
Definition: ruleaction.hh:1115
RuleThreeWayCompare::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:8621
RuleShiftBitops::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:208
RuleAddUnsigned
Cleanup: Convert INT_ADD of constants to INT_SUB: V + 0xff... => V - 0x00...
Definition: ruleaction.hh:1093
RuleEqual2Zero::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:5482
RuleHighOrderAnd::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:305
RulePiecePathology
Search for concatenations with unlikely things to inform return/parameter consumption calculation.
Definition: ruleaction.hh:1468
RuleSubCancel::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:4673
RulePopcountBoolXor::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1459
RuleOrCollapse::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:382
RuleOrMask::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:276
RuleEarlyRemoval
Get rid of unused PcodeOp objects where we can guarantee the output is unused.
Definition: ruleaction.hh:78
RuleTestSign::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:616
RuleDivOpt::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1200
RuleSlessToLess::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:505
RulePtraddUndo::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:6331
RuleLessEqual
Simplify 'less than or equal': V < W || V == W => V <= W
Definition: ruleaction.hh:452
RuleXorSwap::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1484
RuleSignForm::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:7280
RuleNegateIdentity::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:450
RuleSub2Add
Eliminate INT_SUB: V - W => V + W * -1
Definition: ruleaction.hh:703
RuleSubZext::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:4596
RuleSubNormal::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:6621
AddTreeState::AddTreeState
AddTreeState(Funcdata &d, PcodeOp *op, int4 slot)
Construct given root of ADD tree and pointer.
Definition: ruleaction.cc:5622
ActionGroupList
The list of groups defining a root Action.
Definition: action.hh:29
RuleMultNegOne::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1085
RuleNegateNegate
Simplify INT_NEGATE chains: ~~V => V
Definition: ruleaction.hh:1371
RulePositiveDiv::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:6670
RulePushMulti
Simplify MULTIEQUAL operations where the branches hold the same value.
Definition: ruleaction.hh:281
RuleLoadVarnode::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:3894
RuleSubZext
Simplify INT_ZEXT applied to SUBPIECE expressions.
Definition: ruleaction.hh:878
RuleCollectTerms::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:105
RuleZextSless
Transform INT_ZEXT and INT_SLESS: zext(V) s< c => V < c
Definition: ruleaction.hh:512
RuleAndPiece::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:1626
RuleThreeWayCompare
Simplify expressions involving three-way comparisons.
Definition: ruleaction.hh:1443
RuleCondNegate
Flip conditions to match structuring cues.
Definition: ruleaction.hh:958
RulePullsubIndirect::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:955
RulePtraddUndo::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1063
RuleZextCommute
Commute INT_ZEXT with INT_RIGHT: zext(V) >> W => zext(V >> W)
Definition: ruleaction.hh:828
RuleStructOffset0
Convert a LOAD or STORE to the first element of a structure to a PTRSUB.
Definition: ruleaction.hh:1040
RuleIdentityEl::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:626
RuleBxor2NotEqual
Eliminate BOOL_XOR: V ^^ W => V != W
Definition: ruleaction.hh:135
RuleRangeMeld::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:1349
RuleLeftRight::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:1952
RulePopcountBoolXor::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:8745
RuleHumptyOr::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:4863
RulePtrFlow::RulePtrFlow
RulePtrFlow(const string &g, Architecture *conf)
Constructor.
Definition: ruleaction.cc:7612
RuleSegment
Propagate constants through a SEGMENTOP.
Definition: ruleaction.hh:1253
RuleOrConsume::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:168
RuleZextShiftZext
Simplify multiple INT_ZEXT operations: zext( zext(V) << c ) => zext(V) << c
Definition: ruleaction.hh:838
RuleDivTermAdd::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1174
RulePiecePathology::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1473
RuleCollapseConstants
Collapse constant expressions.
Definition: ruleaction.hh:653
RuleShiftCompare::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:435
RuleEmbed::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:4952
RulePiecePathology::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:9048
Rule2Comp2Mult::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:3588
RulePtrsubUndo::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1073
RuleHumptyDumpty::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:4756
RuleLogic2Bool::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:2810
RuleThreeWayCompare::testCompareEquivalence
static int4 testCompareEquivalence(PcodeOp *lessop, PcodeOp *lessequalop)
Make sure comparisons match properly for a three-way.
Definition: ruleaction.cc:8435
RulePiece2Sext::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:128
RuleZextCommute::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:831
RulePtrArith::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1033
RuleSubfloatConvert::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1363
RuleEarlyRemoval::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:81
RuleEqual2Constant::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1022
RuleLessOne
Transform INT_LESS of 0 or 1: V < 1 => V == 0, V <= 0 => V == 0
Definition: ruleaction.hh:322
RuleSubExtComm::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:4006
RuleCollapseConstants::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:3476
RuleNegateNegate::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1374
RuleSborrow::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:3041
RulePtrsubCharConstant::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1130
RuleOrMask::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:282
RuleLoadVarnode::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:750
RuleSplitFlow::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1289
RuleShiftPiece::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:646
RuleSubExtComm
Commute SUBPIECE and INT_ZEXT: sub(zext(V),c) => zext(sub(V,c))
Definition: ruleaction.hh:777
RuleAndCompare::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:375
RuleZextSless::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:2512
RuleLessOne::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:325
RuleEquality::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:629
RuleTransformCpool::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:3517
RuleDumptyHump::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:4809
RuleNotDistribute::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:1133
RuleSubCommute::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:4047
RuleDoubleArithShift::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:405
RuleSubExtComm::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:780
RuleEquality::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:238
RuleThreeWayCompare::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:8612
RuleIdentityEl::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:3298
RuleSegment::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1256
RuleEqual2Zero
Simplify INT_EQUAL applied to 0: 0 == V + W * -1 => V == W or 0 == V + c => V == -c
Definition: ruleaction.hh:1009
RuleMultiCollapse::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:2908
BlockBasic
A basic block for p-code operations.
Definition: block.hh:365
RuleSLess2Zero::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:5313
RuleConditionalMove::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:8154
RuleTrivialArith::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:2301
RuleAndMask::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:302
RuleNotDistribute
Distribute BOOL_NEGATE: !(V && W) => !V || !W
Definition: ruleaction.hh:292
RulePropagateCopy::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:3548
PcodeOp
Lowest level operation of the p-code language.
Definition: op.hh:58
RuleEquality::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:622
RuleShiftPiece
Convert "shift and add" to PIECE: (zext(V) << 16) + zext(W) => concat(V,W)
Definition: ruleaction.hh:643
RuleThreeWayCompare::detectThreeWay
static PcodeOp * detectThreeWay(PcodeOp *op, bool &isPartial)
Detect a three-way calculation.
Definition: ruleaction.cc:8510
RuleStoreVarnode::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:3936
Architecture
Manager for all the major decompiler subsystems.
Definition: architecture.hh:119
RuleRangeMeld
Merge range conditions of the form: V s< c, c s< V, V == c, V != c
Definition: ruleaction.hh:332
RuleConditionalMove::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:8148
RulePushMulti::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:1060
RuleTestSign::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:3234
RuleSubvarAnd::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1267
RuleFloatCast
Replace (casttosmall)(casttobig)V with identity or with single cast.
Definition: ruleaction.hh:1410
RuleSelectCse
Look for common sub-expressions (built out of a restricted set of ops)
Definition: ruleaction.hh:105
RuleAndPiece
Convert PIECE to INT_ZEXT where appropriate: V & concat(W,X) => zext(X)
Definition: ruleaction.hh:362
RuleSelectCse::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:178
RuleXorSwap::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:9093
RuleAddUnsigned::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1096
RuleTrivialBool::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:2380
RuleSlessToLess::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:2481
RuleZextCommute::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:4389
RuleFloatRange::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:1442
RuleAddMultCollapse::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:726
RuleLessEqual::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:2191
RuleSignShift
Normalize sign-bit extraction: V >> 0x1f => (V s>> 0x1f) * -1
Definition: ruleaction.hh:602
AddTreeState::apply
bool apply(void)
Attempt to transform the pointer expression.
Definition: ruleaction.cc:6011
RuleSubNormal::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1141
RuleSignForm::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1223
RuleEmbed::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:4946
RuleLogic2Bool
Convert logical to boolean operations: V & W => V && W, V | W => V || W
Definition: ruleaction.hh:552
RuleSubCommute::cancelExtensions
static bool cancelExtensions(PcodeOp *longform, PcodeOp *subOp, Varnode *ext0In, Varnode *ext1In, Funcdata &data)
Eliminate input extensions on given binary PcodeOp.
Definition: ruleaction.cc:4062
RuleFloatRange
Merge range conditions of the form: V f< c, c f< V, V f== c etc.
Definition: ruleaction.hh:342
RuleEqual2Zero::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:5475
RuleShift2Mult::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:3336
RuleSubvarSubpiece::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1278
RuleIntLessEqual::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:228
RuleEarlyRemoval::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:23
RuleShiftCompare::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:2006
RuleTrivialShift::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:3127
RuleRangeMeld::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:1333
RuleIgnoreNan::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:8371
RuleOrMask
Simplify INT_OR with full mask: V = W | 0xffff => V = W
Definition: ruleaction.hh:145
RuleDivTermAdd::findSubshift
static PcodeOp * findSubshift(PcodeOp *op, int4 &n, OpCode &shiftopc)
Check for shift form of expression.
Definition: ruleaction.cc:6809
RuleShiftCompare
Transform shifts in comparisons: V >> c == d => V == (d << c)
Definition: ruleaction.hh:432
RulePropagateCopy::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:676
RuleLess2Zero::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:5173
RuleSegment::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:7439
RuleLeftRight::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:425
Varnode
A low-level variable or contiguous set of bytes described by an Address and a size.
Definition: varnode.hh:65
RuleSignNearMult
Simplify division form: (V + (V s>> 0x1f)>>(32-n)) & (-1<<n) => (V s/ 2^n) * 2^n
Definition: ruleaction.hh:1231
RuleStoreVarnode::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:3930
RuleLess2Zero
Simplify INT_LESS applied to extremal constants.
Definition: ruleaction.hh:978
RuleRightShiftAnd::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:571
RuleDivTermAdd::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:6708
RuleConditionalMove::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1402
RulePushMulti::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:285
RuleHighOrderAnd::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:1188
RuleSignShift::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:3157
RuleHumptyOr::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:4869
RuleSlessToLess
Convert INT_SLESS to INT_LESS when comparing positive values.
Definition: ruleaction.hh:502
RuleModOpt
Simplify expressions that optimize INT_REM and INT_SREM.
Definition: ruleaction.hh:1242
RuleIndirectCollapse
Remove a CPUI_INDIRECT if its blocking PcodeOp is dead.
Definition: ruleaction.hh:562
RuleLoadVarnode
Convert LOAD operations using a constant offset to COPY.
Definition: ruleaction.hh:743
RuleEqual2Constant::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:5547
Rule2Comp2Mult::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:686
RulePiece2Sext
Concatenation with sign bits becomes an extension: concat( V s>> #0x1f , V) => sext(V)
Definition: ruleaction.hh:125
RuleConcatZext::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:4345
RuleConcatCommute::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:801
RuleAddMultCollapse::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:3711
RuleEmbed
Simplify PIECE intended as embedding: concat(V, sub(W,0)) => W & 0xff | (zext(W) << 8)
Definition: ruleaction.hh:938
RuleMultNegOne::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:6381
RulePiece2Zext::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:118
RuleOrConsume::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:351
RuleLess2Zero::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:981
RuleDumptyHump
Simplify join and break apart: sub( concat(V,W), c) => sub(W,c)
Definition: ruleaction.hh:918
RuleShiftBitops::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:488
RuleFuncPtrEncoding::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:8401
RuleAndDistribute::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:1252
RuleCollapseConstants::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:656
RuleSwitchSingle::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:5026
RuleMultiCollapse
Collapse MULTIEQUAL whose inputs all trace to the same value.
Definition: ruleaction.hh:572
RulePushPtr::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:6265
RuleLess2Zero::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:5167
RuleSubRight::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:6464
RuleLessEqual2Zero::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:991
RuleXorCollapse::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:3670
RuleCollectTerms::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:98
RuleAndMask
Collapse unnecessary INT_AND.
Definition: ruleaction.hh:155
RuleSignNearMult::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:7311
RuleXorCollapse::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:3677
RuleSubNormal
Pull-back SUBPIECE through INT_RIGHT and INT_SRIGHT.
Definition: ruleaction.hh:1138
RulePtrArith::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:6158
RuleSubCommute::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:4078
RuleTrivialBool::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:485
RuleBxor2NotEqual::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:138
RuleConditionalMove
Simplify various conditional move situations.
Definition: ruleaction.hh:1382
RuleShiftAnd::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:4462
RuleTestSign
Convert sign-bit test to signed comparison: (V s>> 0x1f) != 0 => V s< 0
Definition: ruleaction.hh:612
RuleConcatZero::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:861
RuleSubExtComm::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:4012
RuleZextEliminate
Eliminate INT_ZEXT in comparisons: zext(V) == c => V == c
Definition: ruleaction.hh:492
RulePtrArith::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:6152
ActionGroupList::contains
bool contains(const string &nm) const
Check if this ActionGroupList contains a given group.
Definition: action.hh:37
RuleSubvarSubpiece::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:7523
RulePtrFlow::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:7619
RulePiece2Zext::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:211
RuleZextShiftZext::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:4416
RuleDoubleShift::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:1786
RulePopcountBoolXor
Simplify boolean expressions that are combined through POPCOUNT.
Definition: ruleaction.hh:1456
RuleTrivialArith::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:475
RuleFloatRange::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:1435
RuleSwitchSingle
Convert BRANCHIND with only one computed destination to a BRANCH.
Definition: ruleaction.hh:948
RulePullsubMulti::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:878
RuleMultiCollapse::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:2914
Funcdata
Container for data structures associated with a single function.
Definition: funcdata.hh:45
Datatype
The base datatype class for the decompiler.
Definition: type.hh:62
RuleDoubleShift::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:395
RuleDoubleShift
Simplify chained shifts INT_LEFT and INT_RIGHT.
Definition: ruleaction.hh:392
RulePtrsubCharConstant::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:6561
RuleSubvarAnd::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:7478
RuleAndOrLump::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:403
RuleMultiCollapse::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:575
RuleSubvarCompZero::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:7813
RuleDivTermAdd2::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:6850
RuleConcatCommute::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:4227
RuleTrivialBool
Simplify boolean expressions when one side is constant.
Definition: ruleaction.hh:482
RulePiece2Sext::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:238
RuleSubvarSext::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:7931
RuleHumptyOr
Simplify masked pieces INT_ORed together: (V & ff00) | (V & 00ff) => V
Definition: ruleaction.hh:928
RuleZextShiftZext::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:841
RuleSubvarAnd
Perform SubVariableFlow analysis triggered by INT_AND.
Definition: ruleaction.hh:1264
RuleSignForm
Normalize sign extraction: sub(sext(V),c) => V s>> 31
Definition: ruleaction.hh:1220
RuleBitUndistribute::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:2562
RulePullsubMulti::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:259
RuleSub2Add::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:3647
RuleOrCollapse::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:376
RuleZextEliminate::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:2428
RuleOrMask::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:148
RuleNegateIdentity::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:198
RuleSubvarAnd::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:7484
RuleDivOpt::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:7163
RuleSubvarShift::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1328
RuleSplitFlow
Try to detect and split artificially joined Varnodes.
Definition: ruleaction.hh:1286
RuleShiftSub::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:4729
Rule2Comp2Mult
Eliminate INT_2COMP: -V => V * -1
Definition: ruleaction.hh:683
RuleShiftSub::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:901
RuleAndCommute
Commute INT_AND with INT_LEFT and INT_RIGHT: (V << W) & d => (V & (W >> c)) << c
Definition: ruleaction.hh:352
RuleAndPiece::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:1632
RuleSubvarSext::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:7925
RulePullsubMulti::replaceDescendants
static void replaceDescendants(Varnode *origVn, Varnode *newVn, int4 maxByte, int4 minByte, Funcdata &data)
Definition: ruleaction.cc:717
RuleAndDistribute::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:315
RuleSubCancel::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:891
RuleSlessToLess::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:2488
RuleAndCommute::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:1518
RuleCondNegate::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:5088
RulePushPtr::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:6271
RuleRightShiftAnd::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:218
RulePiece2Sext::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:232
RuleAndPiece::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:365
RuleCarryElim::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:3609
RuleTestSign::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:3206
RuleSLess2Zero
Simplify INT_SLESS applied to 0 or -1.
Definition: ruleaction.hh:998
RuleAndCompare::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:1699
RuleStoreVarnode
Convert STORE operations using a constant offset to COPY.
Definition: ruleaction.hh:757
RuleOrConsume::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:344
RuleAndDistribute
Distribute INT_AND through INT_OR if result is simpler.
Definition: ruleaction.hh:312
RuleIndirectCollapse::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:2845
RuleLessNotEqual
Simplify INT_LESSEQUAL && INT_NOTEQUAL: V <= W && V != W => V < W
Definition: ruleaction.hh:462
RuleOrConsume
Simply OR with unconsumed input: `V = A | B => V = B if nzm(A) & consume(V) == 0.
Definition: ruleaction.hh:165
RuleSub2Add::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:3641
OpCode
OpCode
The op-code defining a specific p-code operation (PcodeOp)
Definition: opcodes.hh:35
RuleXorCollapse
Eliminate INT_XOR in comparisons: (V ^ W) == 0 => V == W
Definition: ruleaction.hh:713
RuleSignDiv2
Convert INT_SRIGHT form into INT_SDIV: (V + -1*(V s>> 31)) s>> 1 => V s/ 2
Definition: ruleaction.hh:1209
RulePtrsubCharConstant::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:6555
RuleModOpt::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:7372
RulePushMulti::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:1066
RuleModOpt::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:7379
RuleIdentityEl
Collapse operations using identity element: V + 0 => V
Definition: ruleaction.hh:623
RuleConcatZero::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:4524
RuleTrivialArith
Simplify trivial arithmetic expressions.
Definition: ruleaction.hh:472
RuleIndirectCollapse::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:2851
RuleXorSwap::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:9099
RuleTermOrder
Order the inputs to commutative operations.
Definition: ruleaction.hh:246
RuleSubvarShift
Perform SubvariableFlow analysis triggered by INT_RIGHT.
Definition: ruleaction.hh:1325
RuleOrCollapse
Collapse unnecessary INT_OR.
Definition: ruleaction.hh:175
RuleSignDiv2::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1212
RuleSelectCse::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:185
RuleCarryElim
Transform INT_CARRY using a constant: carry(V,c) => -c <= V
Definition: ruleaction.hh:693
Rule2Comp2Mult::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:3594
RuleAddUnsigned::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:6402
RuleCollectTerms
Collect terms in a sum: V * c + V * d => V * (c + d)
Definition: ruleaction.hh:94
RulePositiveDiv
Signed division of positive values is unsigned division.
Definition: ruleaction.hh:1160
RuleDoubleArithShift::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:1872
RuleNegateNegate::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:7988
AddTreeState
Structure for sorting out pointer expression trees.
Definition: ruleaction.hh:42
RuleIgnoreNan
Treat FLOAT_NAN as always evaluating to false.
Definition: ruleaction.hh:1421
RuleSborrow
Simplify signed comparisons using INT_SBORROW.
Definition: ruleaction.hh:582
RuleDivTermAdd::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:6700
RulePtrFlow::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1306
RuleSubvarZext
Perform SubvariableFlow analysis triggered by INT_ZEXT.
Definition: ruleaction.hh:1336
RuleBooleanNegate::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:2637
RuleSignDiv2::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:7227
RuleZextCommute::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:4383
RulePtrFlow
Mark Varnode and PcodeOp objects that are carrying or operating on pointers.
Definition: ruleaction.hh:1297
RuleLogic2Bool::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:555
RulePositiveDiv::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:6677
action.hh
Action, Rule, and other associates classes supporting transformations on function data-flow.
Rule::Rule
Rule(const string &g, uint4 fl, const string &nm)
Construct given group, properties name.
Definition: action.cc:620
RuleBoolNegate::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:5125
RuleShiftPiece::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:3385
RuleSubRight::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:6470
RuleSLess2Zero::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1002
RuleLessNotEqual::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:2243
RuleIndirectCollapse::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:565
RuleTransformCpool
Transform CPOOLREF operations by looking up the value in the constant pool.
Definition: ruleaction.hh:663
RuleBooleanNegate
Simplify comparisons with boolean values: V == false => !V, V == true => V
Definition: ruleaction.hh:532
RuleSubvarSext::reset
virtual void reset(Funcdata &data)
Reset this Rule.
Definition: ruleaction.cc:7944
RuleEqual2Constant
Simplify INT_EQUAL applied to arithmetic expressions.
Definition: ruleaction.hh:1019
RuleRightShiftAnd
Simplify INT_RIGHT and INT_SRIGHT ops where an INT_AND mask becomes unnecessary.
Definition: ruleaction.hh:215
RulePullsubMulti::buildSubpiece
static Varnode * buildSubpiece(Varnode *basevn, uint4 outsize, uint4 shift, Funcdata &data)
Build a SUBPIECE of given base Varnode.
Definition: ruleaction.cc:774
RuleTermOrder::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:249
RuleSwitchSingle::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:5032
RuleNegateNegate::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:7982
RuleSubvarCompZero::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1317
RuleBitUndistribute::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:525
Rule2Comp2Sub::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1107
RuleSLess2Zero::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:5307
RuleShiftBitops
Shifting away all non-zero bits of one-side of a logical/arithmetic op.
Definition: ruleaction.hh:205
RulePullsubMulti::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:872
RuleSubRight::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1118
RuleSwitchSingle::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:951
RuleBoolZext::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:545
RuleConcatZero::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:4518
RuleBxor2NotEqual::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:261
RulePullsubMulti::findSubpiece
static Varnode * findSubpiece(Varnode *basevn, uint4 outsize, uint4 shift)
Find a predefined SUBPIECE of a base Varnode.
Definition: ruleaction.cc:847
RulePushPtr
Push a Varnode with known pointer data-type to the bottom of its additive expression.
Definition: ruleaction.hh:1050
RulePushPtr::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1053
RuleConcatZext::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:821
RuleIntLessEqual
Convert LESSEQUAL to LESS: V <= c => V < (c+1)
Definition: ruleaction.hh:225
RuleXorCollapse::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:716
RuleCondNegate::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:5094
RuleSubvarSubpiece
Perform SubVariableFlow analysis triggered by SUBPIECE.
Definition: ruleaction.hh:1275
RuleAndOrLump::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:188
RuleMultNegOne
Cleanup: Convert INT_2COMP from INT_MULT: V * -1 => -V
Definition: ruleaction.hh:1082
RulePiece2Zext
Concatenation with 0 becomes an extension: V = concat(#0,W) => V = zext(W)
Definition: ruleaction.hh:115
RuleConcatLeftShift::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:4551
RuleNotDistribute::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:295
RuleBoolZext::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:2686
RuleIntLessEqual::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:609
RuleBoolNegate
Apply a set of identities involving BOOL_NEGATE.
Definition: ruleaction.hh:968
RuleShift2Mult::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:3330
RuleConcatCommute::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:4221
RuleLessNotEqual::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:2249
RuleEqual2Zero::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1012
RuleLessEqual::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:455
RulePullsubIndirect::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:949
RuleLeftRight
Transform canceling INT_RIGHT or INT_SRIGHT of INT_LEFT.
Definition: ruleaction.hh:422
RuleTransformCpool::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:3511
RuleZextSless::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:515
RuleTrivialShift::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:3120
RuleHumptyOr::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:931
RulePtrsubUndo::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:6364
RulePullsubMulti
Pull SUBPIECE back through MULTIEQUAL.
Definition: ruleaction.hh:256
RuleZextShiftZext::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:4422
RulePtrFlow::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:7733
RuleMultNegOne::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:6387
RuleLessEqual::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:2185
RulePopcountBoolXor::getBooleanResult
static Varnode * getBooleanResult(Varnode *vn, int4 bitPos, int4 &constRes)
Extract boolean Varnode producing bit at given Varnode and position.
Definition: ruleaction.cc:8810
RuleTrivialBool::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:2373
RuleShiftSub::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:4735
RuleEmbed::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:941
RuleHumptyDumpty::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:911
RuleLeftRight::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:1959
RuleDivOpt
Convert INT_MULT and shift forms into INT_DIV or INT_SDIV.
Definition: ruleaction.hh:1194
RuleRangeMeld::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:335
RuleSubvarSext::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1351
RulePtraddUndo
Remove PTRADD operations with mismatched data-type information.
Definition: ruleaction.hh:1060
RulePiecePathology::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:9054
RuleLessEqual2Zero
Simplify INT_LESSEQUAL applied to extremal constants.
Definition: ruleaction.hh:988
RuleHumptyDumpty
Simplify break and rejoin: concat( sub(V,c), sub(V,0) ) => V
Definition: ruleaction.hh:908
RuleSborrow::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:585
RuleSubZext::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:4590
RuleShiftAnd::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:4470
RulePtraddUndo::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:6325
RuleSubCommute::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:790
RuleBxor2NotEqual::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:267
RuleIdentityEl::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:3290
RuleLessNotEqual::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:465
RuleDivTermAdd2::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:6844
RuleSubCommute
Commute SUBPIECE operations with earlier operations where possible.
Definition: ruleaction.hh:787
RuleXorSwap
Simplify limited chains of XOR operations.
Definition: ruleaction.hh:1481
RuleNegateIdentity
Apply INT_NEGATE identities: V & ~V => #0, V | ~V -> #-1
Definition: ruleaction.hh:195
RuleStructOffset0::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:1043
RuleShiftAnd
Eliminate any INT_AND when the bits it zeroes out are discarded by a shift.
Definition: ruleaction.hh:848
RuleDoubleSub::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:385
RuleCollectTerms::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:99
RuleSubCancel
Simplify composition of SUBPIECE with INT_ZEXT or INT_SEXT.
Definition: ruleaction.hh:888
RuleSignForm::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:7286
RuleIgnoreNan::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:8377
RuleSubvarCompZero
Perform SubvariableFlow analysis triggered by testing of a single bit.
Definition: ruleaction.hh:1314
RuleSignShift::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:605
RuleZextEliminate::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:495
RuleBoolZext::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:2680
RuleConcatShift::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:1908
RulePullsubMulti::acceptableSize
static bool acceptableSize(int4 size)
Return true if given size is a suitable truncated size.
Definition: ruleaction.cc:756
RuleShiftSub
Simplify SUBPIECE applied to INT_LEFT: sub( V << 8*c, c) => sub(V,0)
Definition: ruleaction.hh:898
RulePopcountBoolXor::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:8751
Rule2Comp2Sub
Cleanup: Convert INT_ADD back to INT_SUB: V + -W ==> V - W
Definition: ruleaction.hh:1104
RuleAndCompare
Simplify INT_ZEXT and SUBPIECE in masked comparison: zext(V) & c == 0 => V & (c & mask) == 0
Definition: ruleaction.hh:372
RuleLessOne::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:1310
RuleAndMask::applyOp
virtual int4 applyOp(PcodeOp *op, Funcdata &data)
Attempt to apply this Rule.
Definition: ruleaction.cc:308
RuleFloatCast::getOpList
virtual void getOpList(vector< uint4 > &oplist) const
List of op codes this rule operates on.
Definition: ruleaction.cc:8315
RuleShift2Mult::clone
virtual Rule * clone(const ActionGroupList &grouplist) const
Clone the Rule.
Definition: ruleaction.hh:636