xref: /netbsd-src/external/gpl3/binutils.old/dist/bfd/cpu-nfp.c (revision c42dbd0ed2e61fe6eda8590caa852ccf34719964)
1e6c7e151Schristos /* BFD library support routines for the NFP.
2*c42dbd0eSchristos    Copyright (C) 2017-2022 Free Software Foundation, Inc.
3e6c7e151Schristos    Contributed by Francois H. Theron <francois.theron@netronome.com>
4e6c7e151Schristos 
5e6c7e151Schristos    This file is part of BFD, the Binary File Descriptor library.
6e6c7e151Schristos 
7e6c7e151Schristos    This program is free software; you can redistribute it and/or modify
8e6c7e151Schristos    it under the terms of the GNU General Public License as published by
9e6c7e151Schristos    the Free Software Foundation; either version 3 of the License, or
10e6c7e151Schristos    (at your option) any later version.
11e6c7e151Schristos 
12e6c7e151Schristos    This program is distributed in the hope that it will be useful,
13e6c7e151Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
14e6c7e151Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15e6c7e151Schristos    GNU General Public License for more details.
16e6c7e151Schristos 
17e6c7e151Schristos    You should have received a copy of the GNU General Public License
18e6c7e151Schristos    along with this program; if not, write to the Free Software
19e6c7e151Schristos    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
20e6c7e151Schristos    MA 02110-1301, USA.  */
21e6c7e151Schristos 
22e6c7e151Schristos #include "sysdep.h"
23e6c7e151Schristos #include "bfd.h"
24e6c7e151Schristos #include "libbfd.h"
25e6c7e151Schristos 
26e6c7e151Schristos static const bfd_arch_info_type *
bfd_nfp_compatible(const bfd_arch_info_type * a,const bfd_arch_info_type * b)27e6c7e151Schristos bfd_nfp_compatible (const bfd_arch_info_type * a,
28e6c7e151Schristos 		    const bfd_arch_info_type * b)
29e6c7e151Schristos {
30e6c7e151Schristos   if (a->arch != b->arch)
31e6c7e151Schristos     return NULL;
32e6c7e151Schristos 
33e6c7e151Schristos   if (a->mach != b->mach)
34e6c7e151Schristos     return NULL;
35e6c7e151Schristos 
36e6c7e151Schristos   return a;
37e6c7e151Schristos }
38e6c7e151Schristos 
39e6c7e151Schristos #define N(machine, print, default, next)			\
40e6c7e151Schristos {								\
41e6c7e151Schristos   32,								\
42e6c7e151Schristos   64,								\
43e6c7e151Schristos   8,								\
44e6c7e151Schristos   bfd_arch_nfp,							\
45e6c7e151Schristos   machine,							\
46e6c7e151Schristos   "nfp",							\
47e6c7e151Schristos   print,							\
48e6c7e151Schristos   3,								\
49e6c7e151Schristos   default,							\
50e6c7e151Schristos   bfd_nfp_compatible,						\
51e6c7e151Schristos   bfd_default_scan,						\
52e6c7e151Schristos   bfd_arch_default_fill,					\
53867d70fcSchristos   next,								\
54867d70fcSchristos   0 /* Maximum offset of a reloc from the start of an insn.  */ \
55e6c7e151Schristos }
56e6c7e151Schristos 
57867d70fcSchristos static const bfd_arch_info_type arch_info_struct =
58*c42dbd0eSchristos   N (bfd_mach_nfp3200, "NFP-32xx", false, NULL);
59e6c7e151Schristos 
60e6c7e151Schristos const bfd_arch_info_type bfd_nfp_arch =
61*c42dbd0eSchristos   N (bfd_mach_nfp6000, "NFP-6xxx", true, &arch_info_struct);
62