xref: /netbsd-src/external/gpl3/binutils/dist/opcodes/kvx-dis.h (revision cb63e24e8d6aae7ddac1859a9015f48b1d8bd90e)
1 /* kvx-dis.h -- Header file kvx-dis.c
2    Copyright (C) 2009-2024 Free Software Foundation, Inc.
3    Contributed by Kalray SA.
4 
5    This file is part of the GNU opcodes library.
6 
7    This library is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3, or (at your option)
10    any later version.
11 
12    It is distributed in the hope that it will be useful, but WITHOUT
13    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
15    License for more details.
16 
17    You should have received a copy of the GNU General Public License
18    along with this program; see the file COPYING3. If not,
19    see <http://www.gnu.org/licenses/>.  */
20 
21 #ifndef _KV3_DIS_H_
22 #define _KV3_DIS_H_
23 
24 #include "dis-asm.h"
25 
26 #define KVX_GPR_REG_SP 12
27 #define KVX_GPR_REG_FP 14
28 
29 enum kvx_prologue_epilogue_insn_type
30 {
31   KVX_PROL_EPIL_INSN_SD,
32   KVX_PROL_EPIL_INSN_SQ,
33   KVX_PROL_EPIL_INSN_SO,
34   KVX_PROL_EPIL_INSN_GET_RA,
35   KVX_PROL_EPIL_INSN_ADD_FP,
36   KVX_PROL_EPIL_INSN_ADD_SP,
37   KVX_PROL_EPIL_INSN_RESTORE_SP_FROM_FP,
38   KVX_PROL_EPIL_INSN_GOTO,
39   KVX_PROL_EPIL_INSN_IGOTO,
40   KVX_PROL_EPIL_INSN_CB,
41   KVX_PROL_EPIL_INSN_RET,
42   KVX_PROL_EPIL_INSN_CALL,
43 };
44 
45 struct kvx_prologue_epilogue_insn
46 {
47   enum kvx_prologue_epilogue_insn_type insn_type;
48   uint64_t immediate;
49   int gpr_reg[3];
50   int nb_gprs;
51 };
52 
53 struct kvx_prologue_epilogue_bundle
54 {
55   struct kvx_prologue_epilogue_insn insn[6];
56   int nb_insn;
57 };
58 
59 int decode_prologue_epilogue_bundle (bfd_vma memaddr,
60 				     struct disassemble_info *info,
61 				     struct kvx_prologue_epilogue_bundle *pb);
62 
63 void parse_kvx_dis_option (const char *option);
64 
65 #endif
66