shift_idioms.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #pragma once
  2. #include <vector>
  3. #include "idiom.h"
  4. #include "icode.h"
  5. #include <deque>
  6. struct Idiom8 : public Idiom
  7. {
  8. protected:
  9. iICODE m_icodes[2];
  10. uint8_t m_loaded_reg;
  11. public:
  12. virtual ~Idiom8() {}
  13. Idiom8(Function *f) : Idiom(f)
  14. {
  15. }
  16. uint8_t minimum_match_length() {return 2;}
  17. bool match(iICODE pIcode);
  18. int action();
  19. };
  20. struct Idiom15 : public Idiom
  21. {
  22. protected:
  23. std::vector<iICODE> m_icodes;
  24. public:
  25. virtual ~Idiom15() {}
  26. Idiom15(Function *f) : Idiom(f)
  27. {
  28. }
  29. uint8_t minimum_match_length() {return 2;}
  30. bool match(iICODE pIcode);
  31. int action();
  32. };
  33. struct Idiom12 : public Idiom
  34. {
  35. protected:
  36. iICODE m_icodes[2];
  37. uint8_t m_loaded_reg;
  38. public:
  39. virtual ~Idiom12() {}
  40. Idiom12(Function *f) : Idiom(f)
  41. {
  42. }
  43. uint8_t minimum_match_length() {return 2;}
  44. bool match(iICODE pIcode);
  45. int action();
  46. };
  47. struct Idiom9 : public Idiom
  48. {
  49. protected:
  50. iICODE m_icodes[2];
  51. uint8_t m_loaded_reg;
  52. public:
  53. virtual ~Idiom9() {}
  54. Idiom9(Function *f) : Idiom(f)
  55. {
  56. }
  57. uint8_t minimum_match_length() {return 2;}
  58. bool match(iICODE pIcode);
  59. int action();
  60. };