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