ax.def 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* Definition of agent opcode values. -*- c -*-
  2. Copyright (C) 1998-2022 Free Software Foundation, Inc.
  3. This file is part of GDB.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. /* The actual values of the various bytecode operations.
  15. Other independent implementations of the agent bytecode engine will
  16. rely on the exact values of these enums, and may not be recompiled
  17. when we change this table. The numeric values should remain fixed
  18. whenever possible. Thus, we assign them values explicitly here (to
  19. allow gaps to form safely), and the disassembly table in
  20. agentexpr.h behaves like an opcode map. If you want to see them
  21. grouped logically, see doc/agentexpr.texi.
  22. Each line is of the form:
  23. DEFOP (name, size, data_size, consumed, produced, opcode)
  24. NAME is the name of the operation.
  25. SIZE is the number of argument bytes that the operation takes from
  26. the bytecode stream.
  27. DATA_SIZE is the size of data operated on, in bits, for operations
  28. that care (ref and const). It is zero otherwise.
  29. CONSUMED is the number of stack elements consumed.
  30. PRODUCED is the number of stack elements produced.
  31. OPCODE is the operation's encoding. */
  32. DEFOP (float, 0, 0, 0, 0, 0x01)
  33. DEFOP (add, 0, 0, 2, 1, 0x02)
  34. DEFOP (sub, 0, 0, 2, 1, 0x03)
  35. DEFOP (mul, 0, 0, 2, 1, 0x04)
  36. DEFOP (div_signed, 0, 0, 2, 1, 0x05)
  37. DEFOP (div_unsigned, 0, 0, 2, 1, 0x06)
  38. DEFOP (rem_signed, 0, 0, 2, 1, 0x07)
  39. DEFOP (rem_unsigned, 0, 0, 2, 1, 0x08)
  40. DEFOP (lsh, 0, 0, 2, 1, 0x09)
  41. DEFOP (rsh_signed, 0, 0, 2, 1, 0x0a)
  42. DEFOP (rsh_unsigned, 0, 0, 2, 1, 0x0b)
  43. DEFOP (trace, 0, 0, 2, 0, 0x0c)
  44. DEFOP (trace_quick, 1, 0, 1, 1, 0x0d)
  45. DEFOP (log_not, 0, 0, 1, 1, 0x0e)
  46. DEFOP (bit_and, 0, 0, 2, 1, 0x0f)
  47. DEFOP (bit_or, 0, 0, 2, 1, 0x10)
  48. DEFOP (bit_xor, 0, 0, 2, 1, 0x11)
  49. DEFOP (bit_not, 0, 0, 1, 1, 0x12)
  50. DEFOP (equal, 0, 0, 2, 1, 0x13)
  51. DEFOP (less_signed, 0, 0, 2, 1, 0x14)
  52. DEFOP (less_unsigned, 0, 0, 2, 1, 0x15)
  53. DEFOP (ext, 1, 0, 1, 1, 0x16)
  54. DEFOP (ref8, 0, 8, 1, 1, 0x17)
  55. DEFOP (ref16, 0, 16, 1, 1, 0x18)
  56. DEFOP (ref32, 0, 32, 1, 1, 0x19)
  57. DEFOP (ref64, 0, 64, 1, 1, 0x1a)
  58. DEFOP (ref_float, 0, 0, 1, 1, 0x1b)
  59. DEFOP (ref_double, 0, 0, 1, 1, 0x1c)
  60. DEFOP (ref_long_double, 0, 0, 1, 1, 0x1d)
  61. DEFOP (l_to_d, 0, 0, 1, 1, 0x1e)
  62. DEFOP (d_to_l, 0, 0, 1, 1, 0x1f)
  63. DEFOP (if_goto, 2, 0, 1, 0, 0x20)
  64. DEFOP (goto, 2, 0, 0, 0, 0x21)
  65. DEFOP (const8, 1, 8, 0, 1, 0x22)
  66. DEFOP (const16, 2, 16, 0, 1, 0x23)
  67. DEFOP (const32, 4, 32, 0, 1, 0x24)
  68. DEFOP (const64, 8, 64, 0, 1, 0x25)
  69. DEFOP (reg, 2, 0, 0, 1, 0x26)
  70. DEFOP (end, 0, 0, 0, 0, 0x27)
  71. DEFOP (dup, 0, 0, 1, 2, 0x28)
  72. DEFOP (pop, 0, 0, 1, 0, 0x29)
  73. DEFOP (zero_ext, 1, 0, 1, 1, 0x2a)
  74. DEFOP (swap, 0, 0, 2, 2, 0x2b)
  75. DEFOP (getv, 2, 0, 0, 1, 0x2c)
  76. DEFOP (setv, 2, 0, 1, 1, 0x2d)
  77. DEFOP (tracev, 2, 0, 0, 1, 0x2e)
  78. DEFOP (tracenz, 0, 0, 2, 0, 0x2f)
  79. DEFOP (trace16, 2, 0, 1, 1, 0x30)
  80. /* We need something here just to make the tables come out ok. */
  81. DEFOP (invalid2, 0, 0, 0, 0, 0x31)
  82. /* The "consumed" number for pick is wrong, but there's no way to
  83. express the right thing. */
  84. DEFOP (pick, 1, 0, 0, 1, 0x32)
  85. DEFOP (rot, 0, 0, 3, 3, 0x33)
  86. /* Both the argument and consumed numbers are dynamic for this one. */
  87. DEFOP (printf, 0, 0, 0, 0, 0x34)