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