xref: /netbsd-src/external/gpl3/gdb/dist/gdbsupport/ax.def (revision 5ba1f45f2a09259cc846f20c7c5501604d633c90)
18dffb485Schristos/* Definition of agent opcode values.   -*- c -*-
2*5ba1f45fSchristos   Copyright (C) 1998-2024 Free Software Foundation, Inc.
38dffb485Schristos
48dffb485Schristos   This file is part of GDB.
58dffb485Schristos
68dffb485Schristos   This program is free software; you can redistribute it and/or modify
78dffb485Schristos   it under the terms of the GNU General Public License as published by
88dffb485Schristos   the Free Software Foundation; either version 3 of the License, or
98dffb485Schristos   (at your option) any later version.
108dffb485Schristos
118dffb485Schristos   This program is distributed in the hope that it will be useful,
128dffb485Schristos   but WITHOUT ANY WARRANTY; without even the implied warranty of
138dffb485Schristos   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
148dffb485Schristos   GNU General Public License for more details.
158dffb485Schristos
168dffb485Schristos   You should have received a copy of the GNU General Public License
178dffb485Schristos   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
188dffb485Schristos
198dffb485Schristos/* The actual values of the various bytecode operations.
208dffb485Schristos
218dffb485Schristos   Other independent implementations of the agent bytecode engine will
228dffb485Schristos   rely on the exact values of these enums, and may not be recompiled
238dffb485Schristos   when we change this table.  The numeric values should remain fixed
248dffb485Schristos   whenever possible.  Thus, we assign them values explicitly here (to
258dffb485Schristos   allow gaps to form safely), and the disassembly table in
268dffb485Schristos   agentexpr.h behaves like an opcode map.  If you want to see them
278dffb485Schristos   grouped logically, see doc/agentexpr.texi.
288dffb485Schristos
298dffb485Schristos   Each line is of the form:
308dffb485Schristos
318dffb485Schristos   DEFOP (name, size, data_size, consumed, produced, opcode)
328dffb485Schristos
338dffb485Schristos   NAME is the name of the operation.
348dffb485Schristos   SIZE is the number of argument bytes that the operation takes from
358dffb485Schristos   the bytecode stream.
368dffb485Schristos   DATA_SIZE is the size of data operated on, in bits, for operations
378dffb485Schristos   that care (ref and const).  It is zero otherwise.
388dffb485Schristos   CONSUMED is the number of stack elements consumed.
398dffb485Schristos   PRODUCED is the number of stack elements produced.
408dffb485Schristos   OPCODE is the operation's encoding.  */
418dffb485Schristos
428dffb485SchristosDEFOP (float, 0, 0, 0, 0, 0x01)
438dffb485SchristosDEFOP (add, 0, 0, 2, 1, 0x02)
448dffb485SchristosDEFOP (sub, 0, 0, 2, 1, 0x03)
458dffb485SchristosDEFOP (mul, 0, 0, 2, 1, 0x04)
468dffb485SchristosDEFOP (div_signed, 0, 0, 2, 1, 0x05)
478dffb485SchristosDEFOP (div_unsigned, 0, 0, 2, 1, 0x06)
488dffb485SchristosDEFOP (rem_signed, 0, 0, 2, 1, 0x07)
498dffb485SchristosDEFOP (rem_unsigned, 0, 0, 2, 1, 0x08)
508dffb485SchristosDEFOP (lsh, 0, 0, 2, 1, 0x09)
518dffb485SchristosDEFOP (rsh_signed, 0, 0, 2, 1, 0x0a)
528dffb485SchristosDEFOP (rsh_unsigned, 0, 0, 2, 1, 0x0b)
538dffb485SchristosDEFOP (trace, 0, 0, 2, 0, 0x0c)
548dffb485SchristosDEFOP (trace_quick, 1, 0, 1, 1, 0x0d)
558dffb485SchristosDEFOP (log_not, 0, 0, 1, 1, 0x0e)
568dffb485SchristosDEFOP (bit_and, 0, 0, 2, 1, 0x0f)
578dffb485SchristosDEFOP (bit_or, 0, 0, 2, 1, 0x10)
588dffb485SchristosDEFOP (bit_xor, 0, 0, 2, 1, 0x11)
598dffb485SchristosDEFOP (bit_not, 0, 0, 1, 1, 0x12)
608dffb485SchristosDEFOP (equal, 0, 0, 2, 1, 0x13)
618dffb485SchristosDEFOP (less_signed, 0, 0, 2, 1, 0x14)
628dffb485SchristosDEFOP (less_unsigned, 0, 0, 2, 1, 0x15)
638dffb485SchristosDEFOP (ext, 1, 0, 1, 1, 0x16)
648dffb485SchristosDEFOP (ref8, 0, 8, 1, 1, 0x17)
658dffb485SchristosDEFOP (ref16, 0, 16, 1, 1, 0x18)
668dffb485SchristosDEFOP (ref32, 0, 32, 1, 1, 0x19)
678dffb485SchristosDEFOP (ref64, 0, 64, 1, 1, 0x1a)
688dffb485SchristosDEFOP (ref_float, 0, 0, 1, 1, 0x1b)
698dffb485SchristosDEFOP (ref_double, 0, 0, 1, 1, 0x1c)
708dffb485SchristosDEFOP (ref_long_double, 0, 0, 1, 1, 0x1d)
718dffb485SchristosDEFOP (l_to_d, 0, 0, 1, 1, 0x1e)
728dffb485SchristosDEFOP (d_to_l, 0, 0, 1, 1, 0x1f)
738dffb485SchristosDEFOP (if_goto, 2, 0, 1, 0, 0x20)
748dffb485SchristosDEFOP (goto, 2, 0, 0, 0, 0x21)
758dffb485SchristosDEFOP (const8, 1, 8, 0, 1, 0x22)
768dffb485SchristosDEFOP (const16, 2, 16, 0, 1, 0x23)
778dffb485SchristosDEFOP (const32, 4, 32, 0, 1, 0x24)
788dffb485SchristosDEFOP (const64, 8, 64, 0, 1, 0x25)
798dffb485SchristosDEFOP (reg, 2, 0, 0, 1, 0x26)
808dffb485SchristosDEFOP (end, 0, 0, 0, 0, 0x27)
818dffb485SchristosDEFOP (dup, 0, 0, 1, 2, 0x28)
828dffb485SchristosDEFOP (pop, 0, 0, 1, 0, 0x29)
838dffb485SchristosDEFOP (zero_ext, 1, 0, 1, 1, 0x2a)
848dffb485SchristosDEFOP (swap, 0, 0, 2, 2, 0x2b)
858dffb485SchristosDEFOP (getv, 2, 0, 0, 1, 0x2c)
868dffb485SchristosDEFOP (setv, 2, 0, 1, 1, 0x2d)
878dffb485SchristosDEFOP (tracev, 2, 0, 0, 1, 0x2e)
888dffb485SchristosDEFOP (tracenz, 0, 0, 2, 0, 0x2f)
898dffb485SchristosDEFOP (trace16, 2, 0, 1, 1, 0x30)
908dffb485Schristos/* We need something here just to make the tables come out ok.  */
918dffb485SchristosDEFOP (invalid2, 0, 0, 0, 0, 0x31)
928dffb485Schristos/* The "consumed" number for pick is wrong, but there's no way to
938dffb485Schristos   express the right thing.  */
948dffb485SchristosDEFOP (pick, 1, 0, 0, 1, 0x32)
958dffb485SchristosDEFOP (rot, 0, 0, 3, 3, 0x33)
968dffb485Schristos/* Both the argument and consumed numbers are dynamic for this one.  */
978dffb485SchristosDEFOP (printf, 0, 0, 0, 0, 0x34)
98