diff options
author | obrien <obrien@FreeBSD.org> | 2001-10-13 01:47:52 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2001-10-13 01:47:52 +0000 |
commit | 7734e00828d1a0cbfe8bad4005c310db5ae83187 (patch) | |
tree | b32a6d10e1d7faddb1bb4fd37914636d276b9f34 | |
parent | 51c87054921b48ca6ca66bb7929ad4c05a5fe2f1 (diff) | |
download | FreeBSD-src-7734e00828d1a0cbfe8bad4005c310db5ae83187.zip FreeBSD-src-7734e00828d1a0cbfe8bad4005c310db5ae83187.tar.gz |
Import the extra bits needed to target IA-64, PowerPC, and sparc64.
(this is Binutils from the FSF 2.11 branch [checked out 19-July-2001])
36 files changed, 43264 insertions, 36 deletions
diff --git a/contrib/binutils/bfd/coff-ia64.c b/contrib/binutils/bfd/coff-ia64.c new file mode 100644 index 0000000..776d3fa --- /dev/null +++ b/contrib/binutils/bfd/coff-ia64.c @@ -0,0 +1,201 @@ +/* BFD back-end for HP/Intel IA-64 COFF files. + Copyright 1999, 2000, 2001 Free Software Foundation, Inc. + Contributed by David Mosberger <davidm@hpl.hp.com> + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "coff/ia64.h" +#include "coff/internal.h" +#include "coff/pe.h" +#include "libcoff.h" + +#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2) +/* The page size is a guess based on ELF. */ + +#define COFF_PAGE_SIZE 0x1000 + +static reloc_howto_type howto_table[] = +{ + EMPTY_HOWTO (0), +}; + +#define BADMAG(x) IA64BADMAG(x) +#define IA64 1 /* Customize coffcode.h */ + +#ifdef COFF_WITH_pep +# undef AOUTSZ +# define AOUTSZ PEPAOUTSZ +# define PEAOUTHDR PEPAOUTHDR +#endif + +#define RTYPE2HOWTO(cache_ptr, dst) \ + (cache_ptr)->howto = howto_table + (dst)->r_type; + +#ifdef COFF_WITH_PE +/* Return true if this relocation should + appear in the output .reloc section. */ + +static boolean +in_reloc_p(abfd, howto) + bfd * abfd ATTRIBUTE_UNUSED; + reloc_howto_type *howto ATTRIBUTE_UNUSED; +{ + return 0; /* We don't do relocs for now... */ +} +#endif + +#include "coffcode.h" + +static const bfd_target * +ia64coff_object_p (abfd) + bfd *abfd; +{ +#ifdef COFF_IMAGE_WITH_PE + { + struct external_PEI_DOS_hdr dos_hdr; + struct external_PEI_IMAGE_hdr image_hdr; + file_ptr offset; + + if (bfd_seek (abfd, 0x00, SEEK_SET) != 0 + || bfd_read (&dos_hdr, 1, sizeof (dos_hdr), abfd) + != sizeof (dos_hdr)) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + /* There are really two magic numbers involved; the magic number + that says this is a NT executable (PEI) and the magic number + that determines the architecture. The former is DOSMAGIC, + stored in the e_magic field. The latter is stored in the + f_magic field. If the NT magic number isn't valid, the + architecture magic number could be mimicked by some other + field (specifically, the number of relocs in section 3). Since + this routine can only be called correctly for a PEI file, check + the e_magic number here, and, if it doesn't match, clobber the + f_magic number so that we don't get a false match. */ + if (bfd_h_get_16 (abfd, (bfd_byte *) dos_hdr.e_magic) != DOSMAGIC) + { + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + offset = bfd_h_get_32 (abfd, (bfd_byte *) dos_hdr.e_lfanew); + if (bfd_seek (abfd, (file_ptr) offset, SEEK_SET) != 0 + || bfd_read (&image_hdr, 1, sizeof (image_hdr), abfd) + != sizeof (image_hdr)) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + if (bfd_h_get_32 (abfd, (bfd_byte *) image_hdr.nt_signature) + != 0x4550) + { + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + /* Here is the hack. coff_object_p wants to read filhsz bytes to + pick up the COFF header for PE, see "struct external_PEI_filehdr" + in include/coff/pe.h. We adjust so that that will work. */ + if (bfd_seek (abfd, + (file_ptr) (offset - sizeof (dos_hdr)), + SEEK_SET) + != 0) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + } +#endif + + return coff_object_p (abfd); +} + +const bfd_target +#ifdef TARGET_SYM + TARGET_SYM = +#else + ia64coff_vec = +#endif +{ +#ifdef TARGET_NAME + TARGET_NAME, +#else + "coff-ia64", /* name */ +#endif + bfd_target_coff_flavour, + BFD_ENDIAN_LITTLE, /* data byte order is little */ + BFD_ENDIAN_LITTLE, /* header byte order is little */ + + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), + +#ifndef COFF_WITH_PE + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */ + | SEC_CODE | SEC_DATA), +#else + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */ + | SEC_CODE | SEC_DATA + | SEC_LINK_ONCE | SEC_LINK_DUPLICATES), +#endif + +#ifdef TARGET_UNDERSCORE + TARGET_UNDERSCORE, /* leading underscore */ +#else + 0, /* leading underscore */ +#endif + '/', /* ar_pad_char */ + 15, /* ar_max_namelen */ + + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ + +/* Note that we allow an object file to be treated as a core file as well. */ + {_bfd_dummy_target, ia64coff_object_p, /* bfd_check_format */ + bfd_generic_archive_p, ia64coff_object_p}, + {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ + bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + + NULL, + + COFF_SWAP_TABLE +}; diff --git a/contrib/binutils/bfd/coff-rs6000.c b/contrib/binutils/bfd/coff-rs6000.c new file mode 100644 index 0000000..ed47000 --- /dev/null +++ b/contrib/binutils/bfd/coff-rs6000.c @@ -0,0 +1,2358 @@ +/* BFD back-end for IBM RS/6000 "XCOFF" files. + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001 + Free Software Foundation, Inc. + FIXME: Can someone provide a transliteration of this name into ASCII? + Using the following chars caused a compiler warning on HIUX (so I replaced + them with octal escapes), and isn't useful without an understanding of what + character set it is. + Written by Metin G. Ozisik, Mimi Ph\373\364ng-Th\345o V\365, + and John Gilmore. + Archive support from Damon A. Permezel. + Contributed by IBM Corporation and Cygnus Support. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "coff/internal.h" +#include "coff/rs6000.h" +#include "libcoff.h" +#define TARGET_NAME "aixcoff-rs6000" +#define TARGET_SYM rs6000coff_vec +#include "xcoff-target.h" + +/* The main body of code is in coffcode.h. */ + +static const char *normalize_filename PARAMS ((bfd *)); + +/* We use our own tdata type. Its first field is the COFF tdata type, + so the COFF routines are compatible. */ + +boolean +_bfd_xcoff_mkobject (abfd) + bfd *abfd; +{ + coff_data_type *coff; + + abfd->tdata.xcoff_obj_data = + ((struct xcoff_tdata *) + bfd_zalloc (abfd, sizeof (struct xcoff_tdata))); + if (abfd->tdata.xcoff_obj_data == NULL) + return false; + coff = coff_data (abfd); + coff->symbols = (coff_symbol_type *) NULL; + coff->conversion_table = (unsigned int *) NULL; + coff->raw_syments = (struct coff_ptr_struct *) NULL; + coff->relocbase = 0; + + xcoff_data (abfd)->modtype = ('1' << 8) | 'L'; + + /* We set cputype to -1 to indicate that it has not been + initialized. */ + xcoff_data (abfd)->cputype = -1; + + xcoff_data (abfd)->csects = NULL; + xcoff_data (abfd)->debug_indices = NULL; + + return true; +} + +/* Copy XCOFF data from one BFD to another. */ + +boolean +_bfd_xcoff_copy_private_bfd_data (ibfd, obfd) + bfd *ibfd; + bfd *obfd; +{ + struct xcoff_tdata *ix, *ox; + asection *sec; + + if (ibfd->xvec != obfd->xvec) + return true; + ix = xcoff_data (ibfd); + ox = xcoff_data (obfd); + ox->full_aouthdr = ix->full_aouthdr; + ox->toc = ix->toc; + if (ix->sntoc == 0) + ox->sntoc = 0; + else + { + sec = coff_section_from_bfd_index (ibfd, ix->sntoc); + if (sec == NULL) + ox->sntoc = 0; + else + ox->sntoc = sec->output_section->target_index; + } + if (ix->snentry == 0) + ox->snentry = 0; + else + { + sec = coff_section_from_bfd_index (ibfd, ix->snentry); + if (sec == NULL) + ox->snentry = 0; + else + ox->snentry = sec->output_section->target_index; + } + ox->text_align_power = ix->text_align_power; + ox->data_align_power = ix->data_align_power; + ox->modtype = ix->modtype; + ox->cputype = ix->cputype; + ox->maxdata = ix->maxdata; + ox->maxstack = ix->maxstack; + return true; +} + +/* I don't think XCOFF really has a notion of local labels based on + name. This will mean that ld -X doesn't actually strip anything. + The AIX native linker does not have a -X option, and it ignores the + -x option. */ + +boolean +_bfd_xcoff_is_local_label_name (abfd, name) + bfd *abfd ATTRIBUTE_UNUSED; + const char *name ATTRIBUTE_UNUSED; +{ + return false; +} + +void +_bfd_xcoff_swap_sym_in (abfd, ext1, in1) + bfd *abfd; + PTR ext1; + PTR in1; +{ + SYMENT *ext = (SYMENT *)ext1; + struct internal_syment *in = (struct internal_syment *)in1; + + if (ext->e.e_name[0] != 0) + { + memcpy(in->_n._n_name, ext->e.e_name, SYMNMLEN); + } + else + { + in->_n._n_n._n_zeroes = 0; + in->_n._n_n._n_offset = + bfd_h_get_32(abfd, (bfd_byte *) ext->e.e.e_offset); + } + + in->n_value = bfd_h_get_32(abfd, (bfd_byte *) ext->e_value); + in->n_scnum = bfd_h_get_16(abfd, (bfd_byte *) ext->e_scnum); + in->n_type = bfd_h_get_16(abfd, (bfd_byte *) ext->e_type); + in->n_sclass = bfd_h_get_8(abfd, ext->e_sclass); + in->n_numaux = bfd_h_get_8(abfd, ext->e_numaux); +} + +unsigned int +_bfd_xcoff_swap_sym_out (abfd, inp, extp) + bfd *abfd; + PTR inp; + PTR extp; +{ + struct internal_syment *in = (struct internal_syment *)inp; + SYMENT *ext =(SYMENT *)extp; + + if (in->_n._n_name[0] != 0) + { + memcpy(ext->e.e_name, in->_n._n_name, SYMNMLEN); + } + else + { + bfd_h_put_32(abfd, 0, (bfd_byte *) ext->e.e.e_zeroes); + bfd_h_put_32(abfd, in->_n._n_n._n_offset, + (bfd_byte *) ext->e.e.e_offset); + } + + bfd_h_put_32(abfd, in->n_value , (bfd_byte *) ext->e_value); + bfd_h_put_16(abfd, in->n_scnum , (bfd_byte *) ext->e_scnum); + bfd_h_put_16(abfd, in->n_type , (bfd_byte *) ext->e_type); + bfd_h_put_8(abfd, in->n_sclass , ext->e_sclass); + bfd_h_put_8(abfd, in->n_numaux , ext->e_numaux); + return bfd_coff_symesz (abfd); +} + +#define PUTWORD bfd_h_put_32 +#define PUTHALF bfd_h_put_16 +#define PUTBYTE bfd_h_put_8 +#define GETWORD bfd_h_get_32 +#define GETHALF bfd_h_get_16 +#define GETBYTE bfd_h_get_8 + +void +_bfd_xcoff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) + bfd *abfd; + PTR ext1; + int type; + int class; + int indx; + int numaux; + PTR in1; +{ + AUXENT *ext = (AUXENT *)ext1; + union internal_auxent *in = (union internal_auxent *)in1; + + switch (class) { + case C_FILE: + if (ext->x_file.x_fname[0] == 0) { + in->x_file.x_n.x_zeroes = 0; + in->x_file.x_n.x_offset = + bfd_h_get_32(abfd, (bfd_byte *) ext->x_file.x_n.x_offset); + } else { + if (numaux > 1) + { + if (indx == 0) + memcpy (in->x_file.x_fname, ext->x_file.x_fname, + numaux * sizeof (AUXENT)); + } + else + { + memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); + } + } + goto end; + + /* RS/6000 "csect" auxents */ + case C_EXT: + case C_HIDEXT: + if (indx + 1 == numaux) + { + in->x_csect.x_scnlen.l = + bfd_h_get_32 (abfd, ext->x_csect.x_scnlen); + in->x_csect.x_parmhash = bfd_h_get_32 (abfd, + ext->x_csect.x_parmhash); + in->x_csect.x_snhash = bfd_h_get_16 (abfd, ext->x_csect.x_snhash); + /* We don't have to hack bitfields in x_smtyp because it's + defined by shifts-and-ands, which are equivalent on all + byte orders. */ + in->x_csect.x_smtyp = bfd_h_get_8 (abfd, ext->x_csect.x_smtyp); + in->x_csect.x_smclas = bfd_h_get_8 (abfd, ext->x_csect.x_smclas); + in->x_csect.x_stab = bfd_h_get_32 (abfd, ext->x_csect.x_stab); + in->x_csect.x_snstab = bfd_h_get_16 (abfd, ext->x_csect.x_snstab); + goto end; + } + break; + + case C_STAT: + case C_LEAFSTAT: + case C_HIDDEN: + if (type == T_NULL) { + in->x_scn.x_scnlen = bfd_h_get_32(abfd, + (bfd_byte *) ext->x_scn.x_scnlen); + in->x_scn.x_nreloc = bfd_h_get_16(abfd, + (bfd_byte *) ext->x_scn.x_nreloc); + in->x_scn.x_nlinno = bfd_h_get_16(abfd, + (bfd_byte *) ext->x_scn.x_nlinno); + /* PE defines some extra fields; we zero them out for + safety. */ + in->x_scn.x_checksum = 0; + in->x_scn.x_associated = 0; + in->x_scn.x_comdat = 0; + + goto end; + } + break; + } + + in->x_sym.x_tagndx.l = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_tagndx); + in->x_sym.x_tvndx = bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_tvndx); + + if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class)) + { + in->x_sym.x_fcnary.x_fcn.x_lnnoptr = bfd_h_get_32(abfd, (bfd_byte *) + ext->x_sym.x_fcnary.x_fcn.x_lnnoptr); + in->x_sym.x_fcnary.x_fcn.x_endndx.l = bfd_h_get_32(abfd, (bfd_byte *) + ext->x_sym.x_fcnary.x_fcn.x_endndx); + } + else + { + in->x_sym.x_fcnary.x_ary.x_dimen[0] = + bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[0]); + in->x_sym.x_fcnary.x_ary.x_dimen[1] = + bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[1]); + in->x_sym.x_fcnary.x_ary.x_dimen[2] = + bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[2]); + in->x_sym.x_fcnary.x_ary.x_dimen[3] = + bfd_h_get_16 (abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]); + } + if (ISFCN(type)) { + in->x_sym.x_misc.x_fsize = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_misc.x_fsize); + } + else { + in->x_sym.x_misc.x_lnsz.x_lnno = bfd_h_get_16(abfd, (bfd_byte *) + ext->x_sym.x_misc.x_lnsz.x_lnno); + in->x_sym.x_misc.x_lnsz.x_size = bfd_h_get_16(abfd, (bfd_byte *) + ext->x_sym.x_misc.x_lnsz.x_size); + } + +end: ; + /* the semicolon is because MSVC doesn't like labels at + end of block. */ + +} + +unsigned int +_bfd_xcoff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) + bfd *abfd; + PTR inp; + int type; + int class; + int indx ATTRIBUTE_UNUSED; + int numaux ATTRIBUTE_UNUSED; + PTR extp; +{ + union internal_auxent *in = (union internal_auxent *)inp; + AUXENT *ext = (AUXENT *)extp; + + memset((PTR)ext, 0, bfd_coff_auxesz (abfd)); + switch (class) + { + case C_FILE: + if (in->x_file.x_fname[0] == 0) + { + PUTWORD(abfd, 0, (bfd_byte *) ext->x_file.x_n.x_zeroes); + PUTWORD(abfd, + in->x_file.x_n.x_offset, + (bfd_byte *) ext->x_file.x_n.x_offset); + } + else + { + memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN); + } + goto end; + + /* RS/6000 "csect" auxents */ + case C_EXT: + case C_HIDEXT: + if (indx + 1 == numaux) + { + PUTWORD (abfd, in->x_csect.x_scnlen.l,ext->x_csect.x_scnlen); + PUTWORD (abfd, in->x_csect.x_parmhash, ext->x_csect.x_parmhash); + PUTHALF (abfd, in->x_csect.x_snhash, ext->x_csect.x_snhash); + /* We don't have to hack bitfields in x_smtyp because it's + defined by shifts-and-ands, which are equivalent on all + byte orders. */ + PUTBYTE (abfd, in->x_csect.x_smtyp, ext->x_csect.x_smtyp); + PUTBYTE (abfd, in->x_csect.x_smclas, ext->x_csect.x_smclas); + PUTWORD (abfd, in->x_csect.x_stab, ext->x_csect.x_stab); + PUTHALF (abfd, in->x_csect.x_snstab, ext->x_csect.x_snstab); + goto end; + } + break; + + case C_STAT: + case C_LEAFSTAT: + case C_HIDDEN: + if (type == T_NULL) { + bfd_h_put_32(abfd, in->x_scn.x_scnlen, (bfd_byte *) ext->x_scn.x_scnlen); + bfd_h_put_16(abfd, in->x_scn.x_nreloc, (bfd_byte *) ext->x_scn.x_nreloc); + bfd_h_put_16(abfd, in->x_scn.x_nlinno, (bfd_byte *) ext->x_scn.x_nlinno); + goto end; + } + break; + } + + PUTWORD(abfd, in->x_sym.x_tagndx.l, (bfd_byte *) ext->x_sym.x_tagndx); + bfd_h_put_16 (abfd, in->x_sym.x_tvndx , (bfd_byte *) ext->x_sym.x_tvndx); + + if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class)) + { + bfd_h_put_32(abfd, in->x_sym.x_fcnary.x_fcn.x_lnnoptr, + (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_lnnoptr); + PUTWORD(abfd, in->x_sym.x_fcnary.x_fcn.x_endndx.l, + (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx); + } + else + { + bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[0], + (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[0]); + bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[1], + (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[1]); + bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[2], + (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[2]); + bfd_h_put_16 (abfd, in->x_sym.x_fcnary.x_ary.x_dimen[3], + (bfd_byte *) ext->x_sym.x_fcnary.x_ary.x_dimen[3]); + } + + if (ISFCN (type)) + PUTWORD (abfd, in->x_sym.x_misc.x_fsize, + (bfd_byte *) ext->x_sym.x_misc.x_fsize); + else + { + bfd_h_put_16(abfd, in->x_sym.x_misc.x_lnsz.x_lnno, + (bfd_byte *)ext->x_sym.x_misc.x_lnsz.x_lnno); + bfd_h_put_16(abfd, in->x_sym.x_misc.x_lnsz.x_size, + (bfd_byte *)ext->x_sym.x_misc.x_lnsz.x_size); + } + +end: + return bfd_coff_auxesz (abfd); +} + +/* The XCOFF reloc table. Actually, XCOFF relocations specify the + bitsize and whether they are signed or not, along with a + conventional type. This table is for the types, which are used for + different algorithms for putting in the reloc. Many of these + relocs need special_function entries, which I have not written. */ + +/* In case we're on a 32-bit machine, construct a 64-bit "-1" value + from smaller values. Start with zero, widen, *then* decrement. */ +#define MINUS_ONE (((bfd_vma)0) - 1) + +reloc_howto_type xcoff_howto_table[] = +{ + /* Standard 32 bit relocation. */ + HOWTO (0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_POS", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 32 bit relocation, but store negative value. */ + HOWTO (1, /* type */ + 0, /* rightshift */ + -2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_NEG", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 32 bit PC relative relocation. */ + HOWTO (2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + 0, /* special_function */ + "R_REL", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16 bit TOC relative relocation. */ + HOWTO (3, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_TOC", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* I don't really know what this is. */ + HOWTO (4, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_RTB", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* External TOC relative symbol. */ + HOWTO (5, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_GL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Local TOC relative symbol. */ + HOWTO (6, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_TCL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + EMPTY_HOWTO (7), + + /* Non modifiable absolute branch. */ + HOWTO (8, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_BA", /* name */ + true, /* partial_inplace */ + 0x3fffffc, /* src_mask */ + 0x3fffffc, /* dst_mask */ + false), /* pcrel_offset */ + + EMPTY_HOWTO (9), + + /* Non modifiable relative branch. */ + HOWTO (0xa, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + 0, /* special_function */ + "R_BR", /* name */ + true, /* partial_inplace */ + 0x3fffffc, /* src_mask */ + 0x3fffffc, /* dst_mask */ + false), /* pcrel_offset */ + + EMPTY_HOWTO (0xb), + + /* Indirect load. */ + HOWTO (0xc, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_RL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Load address. */ + HOWTO (0xd, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_RLA", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + EMPTY_HOWTO (0xe), + + /* Non-relocating reference. */ + HOWTO (0xf, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_REF", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + EMPTY_HOWTO (0x10), + EMPTY_HOWTO (0x11), + + /* TOC relative indirect load. */ + HOWTO (0x12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_TRL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* TOC relative load address. */ + HOWTO (0x13, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_TRLA", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Modifiable relative branch. */ + HOWTO (0x14, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_RRTBI", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Modifiable absolute branch. */ + HOWTO (0x15, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_RRTBA", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Modifiable call absolute indirect. */ + HOWTO (0x16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_CAI", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Modifiable call relative. */ + HOWTO (0x17, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_CREL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Modifiable branch absolute. */ + HOWTO (0x18, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_RBA", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Modifiable branch absolute. */ + HOWTO (0x19, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_RBAC", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Modifiable branch relative. */ + HOWTO (0x1a, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + 0, /* special_function */ + "R_RBR", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* Modifiable branch absolute. */ + HOWTO (0x1b, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_RBRC", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + HOWTO (0, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_POS", /* name */ + true, /* partial_inplace */ + MINUS_ONE, /* src_mask */ + MINUS_ONE, /* dst_mask */ + false) /* pcrel_offset */ + +}; + +/* These are the first two like the above but for 16-bit relocs. */ +static reloc_howto_type xcoff_howto_table_16[] = +{ + /* Standard 16 bit relocation. */ + HOWTO (0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_POS_16", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16 bit relocation, but store negative value. */ + HOWTO (1, /* type */ + 0, /* rightshift */ + -2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_NEG_16", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* 16 bit PC relative relocation. */ + HOWTO (2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + 0, /* special_function */ + "R_REL_16", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false) /* pcrel_offset */ + }; + +void +_bfd_xcoff_rtype2howto (relent, internal) + arelent *relent; + struct internal_reloc *internal; +{ + relent->howto = xcoff_howto_table + internal->r_type; + + if (relent->howto->bitsize != ((unsigned int) internal->r_size & 0x1f) + 1 + && (internal->r_type + < sizeof (xcoff_howto_table_16)/sizeof (xcoff_howto_table_16[0]))) + relent->howto = xcoff_howto_table_16 + internal->r_type; + + /* The r_size field of an XCOFF reloc encodes the bitsize of the + relocation, as well as indicating whether it is signed or not. + Doublecheck that the relocation information gathered from the + type matches this information. The bitsize is not significant + for R_REF relocs. */ + if (relent->howto->dst_mask != 0 + && (relent->howto->bitsize + != ((unsigned int) internal->r_size & 0x3f) + 1)) + abort (); +#if 0 + if ((internal->r_size & 0x80) != 0 + ? (relent->howto->complain_on_overflow != complain_overflow_signed) + : (relent->howto->complain_on_overflow != complain_overflow_bitfield)) + abort (); +#endif +} + +reloc_howto_type * +_bfd_xcoff_reloc_type_lookup (abfd, code) + bfd *abfd ATTRIBUTE_UNUSED; + bfd_reloc_code_real_type code; +{ + switch (code) + { + case BFD_RELOC_PPC_B26: + return &xcoff_howto_table[0xa]; + case BFD_RELOC_PPC_BA26: + return &xcoff_howto_table[8]; + case BFD_RELOC_PPC_TOC16: + return &xcoff_howto_table[3]; + case BFD_RELOC_32: + case BFD_RELOC_CTOR: + return &xcoff_howto_table[0]; + case BFD_RELOC_64: + return &xcoff_howto_table[0x1c]; + default: + return NULL; + } +} + +/* XCOFF archive support. The original version of this code was by + Damon A. Permezel. It was enhanced to permit cross support, and + writing archive files, by Ian Lance Taylor, Cygnus Support. + + XCOFF uses its own archive format. Everything is hooked together + with file offset links, so it is possible to rapidly update an + archive in place. Of course, we don't do that. An XCOFF archive + has a real file header, not just an ARMAG string. The structure of + the file header and of each archive header appear below. + + An XCOFF archive also has a member table, which is a list of + elements in the archive (you can get that by looking through the + linked list, but you have to read a lot more of the file). The + member table has a normal archive header with an empty name. It is + normally (and perhaps must be) the second to last entry in the + archive. The member table data is almost printable ASCII. It + starts with a 12 character decimal string which is the number of + entries in the table. For each entry it has a 12 character decimal + string which is the offset in the archive of that member. These + entries are followed by a series of null terminated strings which + are the member names for each entry. + + Finally, an XCOFF archive has a global symbol table, which is what + we call the armap. The global symbol table has a normal archive + header with an empty name. It is normally (and perhaps must be) + the last entry in the archive. The contents start with a four byte + binary number which is the number of entries. This is followed by + a that many four byte binary numbers; each is the file offset of an + entry in the archive. These numbers are followed by a series of + null terminated strings, which are symbol names. + + AIX 4.3 introduced a new archive format which can handle larger + files and also 32- and 64-bit objects in the same archive. The + things said above remain true except that there is now more than + one global symbol table. The one is used to index 32-bit objects, + the other for 64-bit objects. + + The new archives (recognizable by the new ARMAG string) has larger + field lengths so that we cannot really share any code. Also we have + to take care that we are not generating the new form of archives + on AIX 4.2 or earlier systems. */ + +/* XCOFF archives use this as a magic string. Note that both strings + have the same length. */ + +#define XCOFFARMAG "<aiaff>\012" +#define XCOFFARMAGBIG "<bigaf>\012" +#define SXCOFFARMAG 8 + +/* This terminates an XCOFF archive member name. */ + +#define XCOFFARFMAG "`\012" +#define SXCOFFARFMAG 2 + +/* XCOFF archives start with this (printable) structure. */ + +struct xcoff_ar_file_hdr +{ + /* Magic string. */ + char magic[SXCOFFARMAG]; + + /* Offset of the member table (decimal ASCII string). */ + char memoff[12]; + + /* Offset of the global symbol table (decimal ASCII string). */ + char symoff[12]; + + /* Offset of the first member in the archive (decimal ASCII string). */ + char firstmemoff[12]; + + /* Offset of the last member in the archive (decimal ASCII string). */ + char lastmemoff[12]; + + /* Offset of the first member on the free list (decimal ASCII + string). */ + char freeoff[12]; +}; + +#define SIZEOF_AR_FILE_HDR (5 * 12 + SXCOFFARMAG) + +/* This is the equivalent data structure for the big archive format. */ + +struct xcoff_ar_file_hdr_big +{ + /* Magic string. */ + char magic[SXCOFFARMAG]; + + /* Offset of the member table (decimal ASCII string). */ + char memoff[20]; + + /* Offset of the global symbol table for 32-bit objects (decimal ASCII + string). */ + char symoff[20]; + + /* Offset of the global symbol table for 64-bit objects (decimal ASCII + string). */ + char symoff64[20]; + + /* Offset of the first member in the archive (decimal ASCII string). */ + char firstmemoff[20]; + + /* Offset of the last member in the archive (decimal ASCII string). */ + char lastmemoff[20]; + + /* Offset of the first member on the free list (decimal ASCII + string). */ + char freeoff[20]; +}; + +#define SIZEOF_AR_FILE_HDR_BIG (6 * 20 + SXCOFFARMAG) + +/* Each XCOFF archive member starts with this (printable) structure. */ + +struct xcoff_ar_hdr +{ + /* File size not including the header (decimal ASCII string). */ + char size[12]; + + /* File offset of next archive member (decimal ASCII string). */ + char nextoff[12]; + + /* File offset of previous archive member (decimal ASCII string). */ + char prevoff[12]; + + /* File mtime (decimal ASCII string). */ + char date[12]; + + /* File UID (decimal ASCII string). */ + char uid[12]; + + /* File GID (decimal ASCII string). */ + char gid[12]; + + /* File mode (octal ASCII string). */ + char mode[12]; + + /* Length of file name (decimal ASCII string). */ + char namlen[4]; + + /* This structure is followed by the file name. The length of the + name is given in the namlen field. If the length of the name is + odd, the name is followed by a null byte. The name and optional + null byte are followed by XCOFFARFMAG, which is not included in + namlen. The contents of the archive member follow; the number of + bytes is given in the size field. */ +}; + +#define SIZEOF_AR_HDR (7 * 12 + 4) + +/* The equivalent for the big archive format. */ + +struct xcoff_ar_hdr_big +{ + /* File size not including the header (decimal ASCII string). */ + char size[20]; + + /* File offset of next archive member (decimal ASCII string). */ + char nextoff[20]; + + /* File offset of previous archive member (decimal ASCII string). */ + char prevoff[20]; + + /* File mtime (decimal ASCII string). */ + char date[12]; + + /* File UID (decimal ASCII string). */ + char uid[12]; + + /* File GID (decimal ASCII string). */ + char gid[12]; + + /* File mode (octal ASCII string). */ + char mode[12]; + + /* Length of file name (decimal ASCII string). */ + char namlen[4]; + + /* This structure is followed by the file name. The length of the + name is given in the namlen field. If the length of the name is + odd, the name is followed by a null byte. The name and optional + null byte are followed by XCOFFARFMAG, which is not included in + namlen. The contents of the archive member follow; the number of + bytes is given in the size field. */ +}; + +#define SIZEOF_AR_HDR_BIG (3 * 20 + 4 * 12 + 4) + +/* We often have to distinguish between the old and big file format. + Make it a bit cleaner. We can use `xcoff_ardata' here because the + `hdr' member has the same size and position in both formats. */ +#define xcoff_big_format_p(abfd) \ + (xcoff_ardata (abfd)->magic[1] == 'b') + +/* We store a copy of the xcoff_ar_file_hdr in the tdata field of the + artdata structure. Similar for the big archive. */ +#define xcoff_ardata(abfd) \ + ((struct xcoff_ar_file_hdr *) bfd_ardata (abfd)->tdata) +#define xcoff_ardata_big(abfd) \ + ((struct xcoff_ar_file_hdr_big *) bfd_ardata (abfd)->tdata) + +/* We store a copy of the xcoff_ar_hdr in the arelt_data field of an + archive element. Similar for the big archive. */ +#define arch_eltdata(bfd) ((struct areltdata *) ((bfd)->arelt_data)) +#define arch_xhdr(bfd) \ + ((struct xcoff_ar_hdr *) arch_eltdata (bfd)->arch_header) +#define arch_xhdr_big(bfd) \ + ((struct xcoff_ar_hdr_big *) arch_eltdata (bfd)->arch_header) + +/* Read in the armap of an XCOFF archive. */ + +boolean +_bfd_xcoff_slurp_armap (abfd) + bfd *abfd; +{ + file_ptr off; + size_t namlen; + bfd_size_type sz; + bfd_byte *contents, *cend; + bfd_vma c, i; + carsym *arsym; + bfd_byte *p; + + if (xcoff_ardata (abfd) == NULL) + { + bfd_has_map (abfd) = false; + return true; + } + + if (! xcoff_big_format_p (abfd)) + { + /* This is for the old format. */ + struct xcoff_ar_hdr hdr; + + off = strtol (xcoff_ardata (abfd)->symoff, (char **) NULL, 10); + if (off == 0) + { + bfd_has_map (abfd) = false; + return true; + } + + if (bfd_seek (abfd, off, SEEK_SET) != 0) + return false; + + /* The symbol table starts with a normal archive header. */ + if (bfd_read ((PTR) &hdr, SIZEOF_AR_HDR, 1, abfd) != SIZEOF_AR_HDR) + return false; + + /* Skip the name (normally empty). */ + namlen = strtol (hdr.namlen, (char **) NULL, 10); + if (bfd_seek (abfd, ((namlen + 1) & ~1) + SXCOFFARFMAG, SEEK_CUR) != 0) + return false; + + sz = strtol (hdr.size, (char **) NULL, 10); + + /* Read in the entire symbol table. */ + contents = (bfd_byte *) bfd_alloc (abfd, sz); + if (contents == NULL) + return false; + if (bfd_read ((PTR) contents, 1, sz, abfd) != sz) + return false; + + /* The symbol table starts with a four byte count. */ + c = bfd_h_get_32 (abfd, contents); + + if (c * 4 >= sz) + { + bfd_set_error (bfd_error_bad_value); + return false; + } + + bfd_ardata (abfd)->symdefs = ((carsym *) + bfd_alloc (abfd, c * sizeof (carsym))); + if (bfd_ardata (abfd)->symdefs == NULL) + return false; + + /* After the count comes a list of four byte file offsets. */ + for (i = 0, arsym = bfd_ardata (abfd)->symdefs, p = contents + 4; + i < c; + ++i, ++arsym, p += 4) + arsym->file_offset = bfd_h_get_32 (abfd, p); + } + else + { + /* This is for the new format. */ + struct xcoff_ar_hdr_big hdr; + + off = strtol (xcoff_ardata_big (abfd)->symoff, (char **) NULL, 10); + if (off == 0) + { + bfd_has_map (abfd) = false; + return true; + } + + if (bfd_seek (abfd, off, SEEK_SET) != 0) + return false; + + /* The symbol table starts with a normal archive header. */ + if (bfd_read ((PTR) &hdr, SIZEOF_AR_HDR_BIG, 1, abfd) + != SIZEOF_AR_HDR_BIG) + return false; + + /* Skip the name (normally empty). */ + namlen = strtol (hdr.namlen, (char **) NULL, 10); + if (bfd_seek (abfd, ((namlen + 1) & ~1) + SXCOFFARFMAG, SEEK_CUR) != 0) + return false; + + /* XXX This actually has to be a call to strtoll (at least on 32-bit + machines) since the field width is 20 and there numbers with more + than 32 bits can be represented. */ + sz = strtol (hdr.size, (char **) NULL, 10); + + /* Read in the entire symbol table. */ + contents = (bfd_byte *) bfd_alloc (abfd, sz); + if (contents == NULL) + return false; + if (bfd_read ((PTR) contents, 1, sz, abfd) != sz) + return false; + + /* The symbol table starts with an eight byte count. */ + c = bfd_h_get_64 (abfd, contents); + + if (c * 8 >= sz) + { + bfd_set_error (bfd_error_bad_value); + return false; + } + + bfd_ardata (abfd)->symdefs = ((carsym *) + bfd_alloc (abfd, c * sizeof (carsym))); + if (bfd_ardata (abfd)->symdefs == NULL) + return false; + + /* After the count comes a list of eight byte file offsets. */ + for (i = 0, arsym = bfd_ardata (abfd)->symdefs, p = contents + 8; + i < c; + ++i, ++arsym, p += 8) + arsym->file_offset = bfd_h_get_64 (abfd, p); + } + + /* After the file offsets come null terminated symbol names. */ + cend = contents + sz; + for (i = 0, arsym = bfd_ardata (abfd)->symdefs; + i < c; + ++i, ++arsym, p += strlen ((char *) p) + 1) + { + if (p >= cend) + { + bfd_set_error (bfd_error_bad_value); + return false; + } + arsym->name = (char *) p; + } + + bfd_ardata (abfd)->symdef_count = c; + bfd_has_map (abfd) = true; + + return true; +} + +/* See if this is an XCOFF archive. */ + +const bfd_target * +_bfd_xcoff_archive_p (abfd) + bfd *abfd; +{ + char magic[SXCOFFARMAG]; + + if (bfd_read ((PTR) magic, SXCOFFARMAG, 1, abfd) != SXCOFFARMAG) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + if (strncmp (magic, XCOFFARMAG, SXCOFFARMAG) != 0 + && strncmp (magic, XCOFFARMAGBIG, SXCOFFARMAG) != 0) + { + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + /* We are setting bfd_ardata(abfd) here, but since bfd_ardata + involves a cast, we can't do it as the left operand of + assignment. */ + abfd->tdata.aout_ar_data = + (struct artdata *) bfd_zalloc (abfd, sizeof (struct artdata)); + + if (bfd_ardata (abfd) == (struct artdata *) NULL) + return NULL; + + bfd_ardata (abfd)->cache = NULL; + bfd_ardata (abfd)->archive_head = NULL; + bfd_ardata (abfd)->symdefs = NULL; + bfd_ardata (abfd)->extended_names = NULL; + + /* Now handle the two formats. */ + if (magic[1] != 'b') + { + /* This is the old format. */ + struct xcoff_ar_file_hdr hdr; + + /* Copy over the magic string. */ + memcpy (hdr.magic, magic, SXCOFFARMAG); + + /* Now read the rest of the file header. */ + if (bfd_read ((PTR) &hdr.memoff, SIZEOF_AR_FILE_HDR - SXCOFFARMAG, 1, + abfd) != SIZEOF_AR_FILE_HDR - SXCOFFARMAG) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + bfd_ardata (abfd)->first_file_filepos = strtol (hdr.firstmemoff, + (char **) NULL, 10); + + bfd_ardata (abfd)->tdata = bfd_zalloc (abfd, SIZEOF_AR_FILE_HDR); + if (bfd_ardata (abfd)->tdata == NULL) + return NULL; + + memcpy (bfd_ardata (abfd)->tdata, &hdr, SIZEOF_AR_FILE_HDR); + } + else + { + /* This is the new format. */ + struct xcoff_ar_file_hdr_big hdr; + + /* Copy over the magic string. */ + memcpy (hdr.magic, magic, SXCOFFARMAG); + + /* Now read the rest of the file header. */ + if (bfd_read ((PTR) &hdr.memoff, SIZEOF_AR_FILE_HDR_BIG - SXCOFFARMAG, 1, + abfd) != SIZEOF_AR_FILE_HDR_BIG - SXCOFFARMAG) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + /* XXX This actually has to be a call to strtoll (at least on 32-bit + machines) since the field width is 20 and there numbers with more + than 32 bits can be represented. */ + bfd_ardata (abfd)->first_file_filepos = strtol (hdr.firstmemoff, + (char **) NULL, 10); + + bfd_ardata (abfd)->tdata = bfd_zalloc (abfd, SIZEOF_AR_FILE_HDR_BIG); + if (bfd_ardata (abfd)->tdata == NULL) + return NULL; + + memcpy (bfd_ardata (abfd)->tdata, &hdr, SIZEOF_AR_FILE_HDR_BIG); + } + + if (! _bfd_xcoff_slurp_armap (abfd)) + { + bfd_release (abfd, bfd_ardata (abfd)); + abfd->tdata.aout_ar_data = (struct artdata *) NULL; + return NULL; + } + + return abfd->xvec; +} + +/* Read the archive header in an XCOFF archive. */ + +PTR +_bfd_xcoff_read_ar_hdr (abfd) + bfd *abfd; +{ + size_t namlen; + struct areltdata *ret; + + ret = (struct areltdata *) bfd_alloc (abfd, sizeof (struct areltdata)); + if (ret == NULL) + return NULL; + + if (! xcoff_big_format_p (abfd)) + { + struct xcoff_ar_hdr hdr; + struct xcoff_ar_hdr *hdrp; + + if (bfd_read ((PTR) &hdr, SIZEOF_AR_HDR, 1, abfd) != SIZEOF_AR_HDR) + { + free (ret); + return NULL; + } + + namlen = strtol (hdr.namlen, (char **) NULL, 10); + hdrp = (struct xcoff_ar_hdr *) bfd_alloc (abfd, + SIZEOF_AR_HDR + namlen + 1); + if (hdrp == NULL) + { + free (ret); + return NULL; + } + memcpy (hdrp, &hdr, SIZEOF_AR_HDR); + if (bfd_read ((char *) hdrp + SIZEOF_AR_HDR, 1, namlen, abfd) != namlen) + { + free (ret); + return NULL; + } + ((char *) hdrp)[SIZEOF_AR_HDR + namlen] = '\0'; + + ret->arch_header = (char *) hdrp; + ret->parsed_size = strtol (hdr.size, (char **) NULL, 10); + ret->filename = (char *) hdrp + SIZEOF_AR_HDR; + } + else + { + struct xcoff_ar_hdr_big hdr; + struct xcoff_ar_hdr_big *hdrp; + + if (bfd_read ((PTR) &hdr, SIZEOF_AR_HDR_BIG, 1, abfd) + != SIZEOF_AR_HDR_BIG) + { + free (ret); + return NULL; + } + + namlen = strtol (hdr.namlen, (char **) NULL, 10); + hdrp = (struct xcoff_ar_hdr_big *) bfd_alloc (abfd, + SIZEOF_AR_HDR_BIG + + namlen + 1); + if (hdrp == NULL) + { + free (ret); + return NULL; + } + memcpy (hdrp, &hdr, SIZEOF_AR_HDR_BIG); + if (bfd_read ((char *) hdrp + SIZEOF_AR_HDR_BIG, 1, namlen, abfd) != namlen) + { + free (ret); + return NULL; + } + ((char *) hdrp)[SIZEOF_AR_HDR_BIG + namlen] = '\0'; + + ret->arch_header = (char *) hdrp; + /* XXX This actually has to be a call to strtoll (at least on 32-bit + machines) since the field width is 20 and there numbers with more + than 32 bits can be represented. */ + ret->parsed_size = strtol (hdr.size, (char **) NULL, 10); + ret->filename = (char *) hdrp + SIZEOF_AR_HDR_BIG; + } + + /* Skip over the XCOFFARFMAG at the end of the file name. */ + if (bfd_seek (abfd, (namlen & 1) + SXCOFFARFMAG, SEEK_CUR) != 0) + return NULL; + + return (PTR) ret; +} + +/* Open the next element in an XCOFF archive. */ + +bfd * +_bfd_xcoff_openr_next_archived_file (archive, last_file) + bfd *archive; + bfd *last_file; +{ + file_ptr filestart; + + if (xcoff_ardata (archive) == NULL) + { + bfd_set_error (bfd_error_invalid_operation); + return NULL; + } + + if (! xcoff_big_format_p (archive)) + { + if (last_file == NULL) + filestart = bfd_ardata (archive)->first_file_filepos; + else + filestart = strtol (arch_xhdr (last_file)->nextoff, (char **) NULL, + 10); + + if (filestart == 0 + || filestart == strtol (xcoff_ardata (archive)->memoff, + (char **) NULL, 10) + || filestart == strtol (xcoff_ardata (archive)->symoff, + (char **) NULL, 10)) + { + bfd_set_error (bfd_error_no_more_archived_files); + return NULL; + } + } + else + { + if (last_file == NULL) + filestart = bfd_ardata (archive)->first_file_filepos; + else + /* XXX These actually have to be a calls to strtoll (at least + on 32-bit machines) since the fields's width is 20 and + there numbers with more than 32 bits can be represented. */ + filestart = strtol (arch_xhdr_big (last_file)->nextoff, (char **) NULL, + 10); + + /* XXX These actually have to be calls to strtoll (at least on 32-bit + machines) since the fields's width is 20 and there numbers with more + than 32 bits can be represented. */ + if (filestart == 0 + || filestart == strtol (xcoff_ardata_big (archive)->memoff, + (char **) NULL, 10) + || filestart == strtol (xcoff_ardata_big (archive)->symoff, + (char **) NULL, 10)) + { + bfd_set_error (bfd_error_no_more_archived_files); + return NULL; + } + } + + return _bfd_get_elt_at_filepos (archive, filestart); +} + +/* Stat an element in an XCOFF archive. */ + +int +_bfd_xcoff_generic_stat_arch_elt (abfd, s) + bfd *abfd; + struct stat *s; +{ + if (abfd->arelt_data == NULL) + { + bfd_set_error (bfd_error_invalid_operation); + return -1; + } + + if (! xcoff_big_format_p (abfd)) + { + struct xcoff_ar_hdr *hdrp = arch_xhdr (abfd); + + s->st_mtime = strtol (hdrp->date, (char **) NULL, 10); + s->st_uid = strtol (hdrp->uid, (char **) NULL, 10); + s->st_gid = strtol (hdrp->gid, (char **) NULL, 10); + s->st_mode = strtol (hdrp->mode, (char **) NULL, 8); + s->st_size = arch_eltdata (abfd)->parsed_size; + } + else + { + struct xcoff_ar_hdr_big *hdrp = arch_xhdr_big (abfd); + + s->st_mtime = strtol (hdrp->date, (char **) NULL, 10); + s->st_uid = strtol (hdrp->uid, (char **) NULL, 10); + s->st_gid = strtol (hdrp->gid, (char **) NULL, 10); + s->st_mode = strtol (hdrp->mode, (char **) NULL, 8); + s->st_size = arch_eltdata (abfd)->parsed_size; + } + + return 0; +} + +/* Normalize a file name for inclusion in an archive. */ + +static const char * +normalize_filename (abfd) + bfd *abfd; +{ + const char *file; + const char *filename; + + file = bfd_get_filename (abfd); + filename = strrchr (file, '/'); + if (filename != NULL) + filename++; + else + filename = file; + return filename; +} + +/* Write out an XCOFF armap. */ + +static boolean +xcoff_write_armap_old (abfd, elength, map, orl_count, stridx) + bfd *abfd; + unsigned int elength ATTRIBUTE_UNUSED; + struct orl *map; + unsigned int orl_count; + int stridx; +{ + struct xcoff_ar_hdr hdr; + char *p; + unsigned char buf[4]; + bfd *sub; + file_ptr fileoff; + unsigned int i; + + memset (&hdr, 0, sizeof hdr); + sprintf (hdr.size, "%ld", (long) (4 + orl_count * 4 + stridx)); + sprintf (hdr.nextoff, "%d", 0); + memcpy (hdr.prevoff, xcoff_ardata (abfd)->memoff, 12); + sprintf (hdr.date, "%d", 0); + sprintf (hdr.uid, "%d", 0); + sprintf (hdr.gid, "%d", 0); + sprintf (hdr.mode, "%d", 0); + sprintf (hdr.namlen, "%d", 0); + + /* We need spaces, not null bytes, in the header. */ + for (p = (char *) &hdr; p < (char *) &hdr + SIZEOF_AR_HDR; p++) + if (*p == '\0') + *p = ' '; + + if (bfd_write ((PTR) &hdr, SIZEOF_AR_HDR, 1, abfd) != SIZEOF_AR_HDR + || bfd_write (XCOFFARFMAG, 1, SXCOFFARFMAG, abfd) != SXCOFFARFMAG) + return false; + + bfd_h_put_32 (abfd, orl_count, buf); + if (bfd_write (buf, 1, 4, abfd) != 4) + return false; + + sub = abfd->archive_head; + fileoff = SIZEOF_AR_FILE_HDR; + i = 0; + while (sub != NULL && i < orl_count) + { + size_t namlen; + + while (((bfd *) (map[i]).pos) == sub) + { + bfd_h_put_32 (abfd, fileoff, buf); + if (bfd_write (buf, 1, 4, abfd) != 4) + return false; + ++i; + } + namlen = strlen (normalize_filename (sub)); + namlen = (namlen + 1) &~ 1; + fileoff += (SIZEOF_AR_HDR + + namlen + + SXCOFFARFMAG + + arelt_size (sub)); + fileoff = (fileoff + 1) &~ 1; + sub = sub->next; + } + + for (i = 0; i < orl_count; i++) + { + const char *name; + size_t namlen; + + name = *map[i].name; + namlen = strlen (name); + if (bfd_write (name, 1, namlen + 1, abfd) != namlen + 1) + return false; + } + + if ((stridx & 1) != 0) + { + char b; + + b = '\0'; + if (bfd_write (&b, 1, 1, abfd) != 1) + return false; + } + + return true; +} + +/* Write a single armap in the big format. */ +static boolean +xcoff_write_one_armap_big (abfd, map, orl_count, orl_ccount, stridx, bits64, + prevoff, nextoff) + bfd *abfd; + struct orl *map; + unsigned int orl_count; + unsigned int orl_ccount; + unsigned int stridx; + int bits64; + const char *prevoff; + char *nextoff; +{ + struct xcoff_ar_hdr_big hdr; + char *p; + unsigned char buf[4]; + const bfd_arch_info_type *arch_info = NULL; + bfd *sub; + file_ptr fileoff; + bfd *object_bfd; + unsigned int i; + + memset (&hdr, 0, sizeof hdr); + /* XXX This call actually should use %lld (at least on 32-bit + machines) since the fields's width is 20 and there numbers with + more than 32 bits can be represented. */ + sprintf (hdr.size, "%ld", (long) (4 + orl_ccount * 4 + stridx)); + if (bits64) + sprintf (hdr.nextoff, "%d", 0); + else + sprintf (hdr.nextoff, "%ld", (strtol (prevoff, (char **) NULL, 10) + + 4 + orl_ccount * 4 + stridx)); + memcpy (hdr.prevoff, prevoff, sizeof (hdr.prevoff)); + sprintf (hdr.date, "%d", 0); + sprintf (hdr.uid, "%d", 0); + sprintf (hdr.gid, "%d", 0); + sprintf (hdr.mode, "%d", 0); + sprintf (hdr.namlen, "%d", 0); + + /* We need spaces, not null bytes, in the header. */ + for (p = (char *) &hdr; p < (char *) &hdr + SIZEOF_AR_HDR_BIG; p++) + if (*p == '\0') + *p = ' '; + + memcpy (nextoff, hdr.nextoff, sizeof (hdr.nextoff)); + + if (bfd_write ((PTR) &hdr, SIZEOF_AR_HDR_BIG, 1, abfd) != SIZEOF_AR_HDR_BIG + || bfd_write (XCOFFARFMAG, 1, SXCOFFARFMAG, abfd) != SXCOFFARFMAG) + return false; + + bfd_h_put_32 (abfd, orl_ccount, buf); + if (bfd_write (buf, 1, 4, abfd) != 4) + return false; + + sub = abfd->archive_head; + fileoff = SIZEOF_AR_FILE_HDR_BIG; + i = 0; + while (sub != NULL && i < orl_count) + { + size_t namlen; + + if ((bfd_arch_bits_per_address ((bfd *) map[i].pos) == 64) == bits64) + while (((bfd *) (map[i]).pos) == sub) + { + bfd_h_put_32 (abfd, fileoff, buf); + if (bfd_write (buf, 1, 4, abfd) != 4) + return false; + i++; + } + else + while (((bfd *) (map[i]).pos) == sub) + i++; + + namlen = strlen (normalize_filename (sub)); + namlen = (namlen + 1) &~ 1; + fileoff += (SIZEOF_AR_HDR_BIG + + namlen + + SXCOFFARFMAG + + arelt_size (sub)); + fileoff = (fileoff + 1) &~ 1; + sub = sub->next; + } + + object_bfd = NULL; + for (i = 0; i < orl_count; i++) + { + const char *name; + size_t namlen; + bfd *ob = (bfd *)map[i].pos; + + if (ob != object_bfd) + arch_info = bfd_get_arch_info (ob); + + if (arch_info && (arch_info->bits_per_address == 64) != bits64) + continue; + + name = *map[i].name; + namlen = strlen (name); + if (bfd_write (name, 1, namlen + 1, abfd) != namlen + 1) + return false; + } + + if ((stridx & 1) != 0) + { + char b; + + b = '\0'; + if (bfd_write (&b, 1, 1, abfd) != 1) + return false; + } + + return true; +} + +static boolean +xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) + bfd *abfd; + unsigned int elength ATTRIBUTE_UNUSED; + struct orl *map; + unsigned int orl_count; + int stridx; +{ + unsigned int i; + unsigned int orl_count_32, orl_count_64; + unsigned int stridx_32, stridx_64; + const bfd_arch_info_type *arch_info = NULL; + bfd *object_bfd; + + /* First, we look through the symbols and work out which are + from 32-bit objects and which from 64-bit ones. */ + orl_count_32 = 0; + orl_count_64 = 0; + stridx_32 = 0; + stridx_64 = 0; + object_bfd = NULL; + for (i = 0; i < orl_count; i++) + { + bfd *ob = (bfd *)map[i].pos; + unsigned int len; + if (ob != object_bfd) + arch_info = bfd_get_arch_info (ob); + len = strlen (*map[i].name) + 1; + if (arch_info && arch_info->bits_per_address == 64) + { + orl_count_64++; + stridx_64 += len; + } + else + { + orl_count_32++; + stridx_32 += len; + } + object_bfd = ob; + } + /* A quick sanity check... */ + BFD_ASSERT (orl_count_64 + orl_count_32 == orl_count); + BFD_ASSERT (stridx_64 + stridx_32 == stridx); + + /* Now write out each map. */ + if (! xcoff_write_one_armap_big (abfd, map, orl_count, orl_count_32, + stridx_32, false, + xcoff_ardata_big (abfd)->memoff, + xcoff_ardata_big (abfd)->symoff)) + return false; + if (! xcoff_write_one_armap_big (abfd, map, orl_count, orl_count_64, + stridx_64, true, + xcoff_ardata_big (abfd)->symoff, + xcoff_ardata_big (abfd)->symoff64)) + return false; + + return true; +} + +boolean +_bfd_xcoff_write_armap (abfd, elength, map, orl_count, stridx) + bfd *abfd; + unsigned int elength ATTRIBUTE_UNUSED; + struct orl *map; + unsigned int orl_count; + int stridx; +{ + if (! xcoff_big_format_p (abfd)) + return xcoff_write_armap_old (abfd, elength, map, orl_count, stridx); + else + return xcoff_write_armap_big (abfd, elength, map, orl_count, stridx); +} + +/* Write out an XCOFF archive. We always write an entire archive, + rather than fussing with the freelist and so forth. */ + +static boolean +xcoff_write_archive_contents_old (abfd) + bfd *abfd; +{ + struct xcoff_ar_file_hdr fhdr; + size_t count; + size_t total_namlen; + file_ptr *offsets; + boolean makemap; + boolean hasobjects; + file_ptr prevoff, nextoff; + bfd *sub; + unsigned int i; + struct xcoff_ar_hdr ahdr; + bfd_size_type size; + char *p; + char decbuf[13]; + + memset (&fhdr, 0, sizeof fhdr); + strncpy (fhdr.magic, XCOFFARMAG, SXCOFFARMAG); + sprintf (fhdr.firstmemoff, "%d", SIZEOF_AR_FILE_HDR); + sprintf (fhdr.freeoff, "%d", 0); + + count = 0; + total_namlen = 0; + for (sub = abfd->archive_head; sub != NULL; sub = sub->next) + { + ++count; + total_namlen += strlen (normalize_filename (sub)) + 1; + } + offsets = (file_ptr *) bfd_alloc (abfd, count * sizeof (file_ptr)); + if (offsets == NULL) + return false; + + if (bfd_seek (abfd, SIZEOF_AR_FILE_HDR, SEEK_SET) != 0) + return false; + + makemap = bfd_has_map (abfd); + hasobjects = false; + prevoff = 0; + nextoff = SIZEOF_AR_FILE_HDR; + for (sub = abfd->archive_head, i = 0; sub != NULL; sub = sub->next, i++) + { + const char *name; + size_t namlen; + struct xcoff_ar_hdr *ahdrp; + bfd_size_type remaining; + + if (makemap && ! hasobjects) + { + if (bfd_check_format (sub, bfd_object)) + hasobjects = true; + } + + name = normalize_filename (sub); + namlen = strlen (name); + + if (sub->arelt_data != NULL) + ahdrp = arch_xhdr (sub); + else + ahdrp = NULL; + + if (ahdrp == NULL) + { + struct stat s; + + memset (&ahdr, 0, sizeof ahdr); + ahdrp = &ahdr; + if (stat (bfd_get_filename (sub), &s) != 0) + { + bfd_set_error (bfd_error_system_call); + return false; + } + + sprintf (ahdrp->size, "%ld", (long) s.st_size); + sprintf (ahdrp->date, "%ld", (long) s.st_mtime); + sprintf (ahdrp->uid, "%ld", (long) s.st_uid); + sprintf (ahdrp->gid, "%ld", (long) s.st_gid); + sprintf (ahdrp->mode, "%o", (unsigned int) s.st_mode); + + if (sub->arelt_data == NULL) + { + sub->arelt_data = bfd_alloc (sub, sizeof (struct areltdata)); + if (sub->arelt_data == NULL) + return false; + } + + arch_eltdata (sub)->parsed_size = s.st_size; + } + + sprintf (ahdrp->prevoff, "%ld", (long) prevoff); + sprintf (ahdrp->namlen, "%ld", (long) namlen); + + /* If the length of the name is odd, we write out the null byte + after the name as well. */ + namlen = (namlen + 1) &~ 1; + + remaining = arelt_size (sub); + size = (SIZEOF_AR_HDR + + namlen + + SXCOFFARFMAG + + remaining); + + BFD_ASSERT (nextoff == bfd_tell (abfd)); + + offsets[i] = nextoff; + + prevoff = nextoff; + nextoff += size + (size & 1); + + sprintf (ahdrp->nextoff, "%ld", (long) nextoff); + + /* We need spaces, not null bytes, in the header. */ + for (p = (char *) ahdrp; p < (char *) ahdrp + SIZEOF_AR_HDR; p++) + if (*p == '\0') + *p = ' '; + + if (bfd_write ((PTR) ahdrp, 1, SIZEOF_AR_HDR, abfd) != SIZEOF_AR_HDR + || bfd_write ((PTR) name, 1, namlen, abfd) != namlen + || (bfd_write ((PTR) XCOFFARFMAG, 1, SXCOFFARFMAG, abfd) + != SXCOFFARFMAG)) + return false; + + if (bfd_seek (sub, (file_ptr) 0, SEEK_SET) != 0) + return false; + while (remaining != 0) + { + bfd_size_type amt; + bfd_byte buffer[DEFAULT_BUFFERSIZE]; + + amt = sizeof buffer; + if (amt > remaining) + amt = remaining; + if (bfd_read (buffer, 1, amt, sub) != amt + || bfd_write (buffer, 1, amt, abfd) != amt) + return false; + remaining -= amt; + } + + if ((size & 1) != 0) + { + bfd_byte b; + + b = '\0'; + if (bfd_write (&b, 1, 1, abfd) != 1) + return false; + } + } + + sprintf (fhdr.lastmemoff, "%ld", (long) prevoff); + + /* Write out the member table. */ + + BFD_ASSERT (nextoff == bfd_tell (abfd)); + sprintf (fhdr.memoff, "%ld", (long) nextoff); + + memset (&ahdr, 0, sizeof ahdr); + sprintf (ahdr.size, "%ld", (long) (12 + count * 12 + total_namlen)); + sprintf (ahdr.prevoff, "%ld", (long) prevoff); + sprintf (ahdr.date, "%d", 0); + sprintf (ahdr.uid, "%d", 0); + sprintf (ahdr.gid, "%d", 0); + sprintf (ahdr.mode, "%d", 0); + sprintf (ahdr.namlen, "%d", 0); + + size = (SIZEOF_AR_HDR + + 12 + + count * 12 + + total_namlen + + SXCOFFARFMAG); + + prevoff = nextoff; + nextoff += size + (size & 1); + + if (makemap && hasobjects) + sprintf (ahdr.nextoff, "%ld", (long) nextoff); + else + sprintf (ahdr.nextoff, "%d", 0); + + /* We need spaces, not null bytes, in the header. */ + for (p = (char *) &ahdr; p < (char *) &ahdr + SIZEOF_AR_HDR; p++) + if (*p == '\0') + *p = ' '; + + if (bfd_write ((PTR) &ahdr, 1, SIZEOF_AR_HDR, abfd) != SIZEOF_AR_HDR + || (bfd_write ((PTR) XCOFFARFMAG, 1, SXCOFFARFMAG, abfd) + != SXCOFFARFMAG)) + return false; + + sprintf (decbuf, "%-12ld", (long) count); + if (bfd_write ((PTR) decbuf, 1, 12, abfd) != 12) + return false; + for (i = 0; i < count; i++) + { + sprintf (decbuf, "%-12ld", (long) offsets[i]); + if (bfd_write ((PTR) decbuf, 1, 12, abfd) != 12) + return false; + } + for (sub = abfd->archive_head; sub != NULL; sub = sub->next) + { + const char *name; + size_t namlen; + + name = normalize_filename (sub); + namlen = strlen (name); + if (bfd_write ((PTR) name, 1, namlen + 1, abfd) != namlen + 1) + return false; + } + if ((size & 1) != 0) + { + bfd_byte b; + + b = '\0'; + if (bfd_write ((PTR) &b, 1, 1, abfd) != 1) + return false; + } + + /* Write out the armap, if appropriate. */ + + if (! makemap || ! hasobjects) + sprintf (fhdr.symoff, "%d", 0); + else + { + BFD_ASSERT (nextoff == bfd_tell (abfd)); + sprintf (fhdr.symoff, "%ld", (long) nextoff); + bfd_ardata (abfd)->tdata = (PTR) &fhdr; + if (! _bfd_compute_and_write_armap (abfd, 0)) + return false; + } + + /* Write out the archive file header. */ + + /* We need spaces, not null bytes, in the header. */ + for (p = (char *) &fhdr; p < (char *) &fhdr + SIZEOF_AR_FILE_HDR; p++) + if (*p == '\0') + *p = ' '; + + if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 + || (bfd_write ((PTR) &fhdr, SIZEOF_AR_FILE_HDR, 1, abfd) != + SIZEOF_AR_FILE_HDR)) + return false; + + return true; +} + +static boolean +xcoff_write_archive_contents_big (abfd) + bfd *abfd; +{ + struct xcoff_ar_file_hdr_big fhdr; + size_t count; + size_t total_namlen; + file_ptr *offsets; + boolean makemap; + boolean hasobjects; + file_ptr prevoff, nextoff; + bfd *sub; + unsigned int i; + struct xcoff_ar_hdr_big ahdr; + bfd_size_type size; + char *p; + char decbuf[13]; + + memset (&fhdr, 0, sizeof fhdr); + strncpy (fhdr.magic, XCOFFARMAGBIG, SXCOFFARMAG); + sprintf (fhdr.firstmemoff, "%d", SIZEOF_AR_FILE_HDR_BIG); + sprintf (fhdr.freeoff, "%d", 0); + + count = 0; + total_namlen = 0; + for (sub = abfd->archive_head; sub != NULL; sub = sub->next) + { + ++count; + total_namlen += strlen (normalize_filename (sub)) + 1; + } + offsets = (file_ptr *) bfd_alloc (abfd, count * sizeof (file_ptr)); + if (offsets == NULL) + return false; + + if (bfd_seek (abfd, SIZEOF_AR_FILE_HDR_BIG, SEEK_SET) != 0) + return false; + + makemap = bfd_has_map (abfd); + hasobjects = false; + prevoff = 0; + nextoff = SIZEOF_AR_FILE_HDR_BIG; + for (sub = abfd->archive_head, i = 0; sub != NULL; sub = sub->next, i++) + { + const char *name; + size_t namlen; + struct xcoff_ar_hdr_big *ahdrp; + bfd_size_type remaining; + + if (makemap && ! hasobjects) + { + if (bfd_check_format (sub, bfd_object)) + hasobjects = true; + } + + name = normalize_filename (sub); + namlen = strlen (name); + + if (sub->arelt_data != NULL) + ahdrp = arch_xhdr_big (sub); + else + ahdrp = NULL; + + if (ahdrp == NULL) + { + struct stat s; + + memset (&ahdr, 0, sizeof ahdr); + ahdrp = &ahdr; + /* XXX This should actually be a call to stat64 (at least on + 32-bit machines). */ + if (stat (bfd_get_filename (sub), &s) != 0) + { + bfd_set_error (bfd_error_system_call); + return false; + } + + /* XXX This call actually should use %lld (at least on 32-bit + machines) since the fields's width is 20 and there numbers with + more than 32 bits can be represented. */ + sprintf (ahdrp->size, "%ld", (long) s.st_size); + sprintf (ahdrp->date, "%ld", (long) s.st_mtime); + sprintf (ahdrp->uid, "%ld", (long) s.st_uid); + sprintf (ahdrp->gid, "%ld", (long) s.st_gid); + sprintf (ahdrp->mode, "%o", (unsigned int) s.st_mode); + + if (sub->arelt_data == NULL) + { + sub->arelt_data = bfd_alloc (sub, sizeof (struct areltdata)); + if (sub->arelt_data == NULL) + return false; + } + + arch_eltdata (sub)->parsed_size = s.st_size; + } + + /* XXX These calls actually should use %lld (at least on 32-bit + machines) since the fields's width is 20 and there numbers with + more than 32 bits can be represented. */ + sprintf (ahdrp->prevoff, "%ld", (long) prevoff); + sprintf (ahdrp->namlen, "%ld", (long) namlen); + + /* If the length of the name is odd, we write out the null byte + after the name as well. */ + namlen = (namlen + 1) &~ 1; + + remaining = arelt_size (sub); + size = (SIZEOF_AR_HDR_BIG + + namlen + + SXCOFFARFMAG + + remaining); + + BFD_ASSERT (nextoff == bfd_tell (abfd)); + + offsets[i] = nextoff; + + prevoff = nextoff; + nextoff += size + (size & 1); + + sprintf (ahdrp->nextoff, "%ld", (long) nextoff); + + /* We need spaces, not null bytes, in the header. */ + for (p = (char *) ahdrp; p < (char *) ahdrp + SIZEOF_AR_HDR_BIG; p++) + if (*p == '\0') + *p = ' '; + + if (bfd_write ((PTR) ahdrp, 1, SIZEOF_AR_HDR_BIG, abfd) + != SIZEOF_AR_HDR_BIG + || bfd_write ((PTR) name, 1, namlen, abfd) != namlen + || (bfd_write ((PTR) XCOFFARFMAG, 1, SXCOFFARFMAG, abfd) + != SXCOFFARFMAG)) + return false; + + if (bfd_seek (sub, (file_ptr) 0, SEEK_SET) != 0) + return false; + while (remaining != 0) + { + bfd_size_type amt; + bfd_byte buffer[DEFAULT_BUFFERSIZE]; + + amt = sizeof buffer; + if (amt > remaining) + amt = remaining; + if (bfd_read (buffer, 1, amt, sub) != amt + || bfd_write (buffer, 1, amt, abfd) != amt) + return false; + remaining -= amt; + } + + if ((size & 1) != 0) + { + bfd_byte b; + + b = '\0'; + if (bfd_write (&b, 1, 1, abfd) != 1) + return false; + } + } + + /* XXX This call actually should use %lld (at least on 32-bit + machines) since the fields's width is 20 and there numbers with + more than 32 bits can be represented. */ + sprintf (fhdr.lastmemoff, "%ld", (long) prevoff); + + /* Write out the member table. */ + + BFD_ASSERT (nextoff == bfd_tell (abfd)); + /* XXX This call actually should use %lld (at least on 32-bit + machines) since the fields's width is 20 and there numbers with + more than 32 bits can be represented. */ + sprintf (fhdr.memoff, "%ld", (long) nextoff); + + memset (&ahdr, 0, sizeof ahdr); + /* XXX The next two calls actually should use %lld (at least on 32-bit + machines) since the fields's width is 20 and there numbers with + more than 32 bits can be represented. */ + sprintf (ahdr.size, "%ld", (long) (12 + count * 12 + total_namlen)); + sprintf (ahdr.prevoff, "%ld", (long) prevoff); + sprintf (ahdr.date, "%d", 0); + sprintf (ahdr.uid, "%d", 0); + sprintf (ahdr.gid, "%d", 0); + sprintf (ahdr.mode, "%d", 0); + sprintf (ahdr.namlen, "%d", 0); + + size = (SIZEOF_AR_HDR_BIG + + 12 + + count * 12 + + total_namlen + + SXCOFFARFMAG); + + prevoff = nextoff; + nextoff += size + (size & 1); + + if (makemap && hasobjects) + /* XXX This call actually should use %lld (at least on 32-bit + machines) since the fields's width is 20 and there numbers with + more than 32 bits can be represented. */ + sprintf (ahdr.nextoff, "%ld", (long) nextoff); + else + sprintf (ahdr.nextoff, "%d", 0); + + /* We need spaces, not null bytes, in the header. */ + for (p = (char *) &ahdr; p < (char *) &ahdr + SIZEOF_AR_HDR_BIG; p++) + if (*p == '\0') + *p = ' '; + + if (bfd_write ((PTR) &ahdr, 1, SIZEOF_AR_HDR_BIG, abfd) != SIZEOF_AR_HDR_BIG + || (bfd_write ((PTR) XCOFFARFMAG, 1, SXCOFFARFMAG, abfd) + != SXCOFFARFMAG)) + return false; + + sprintf (decbuf, "%-12ld", (long) count); + if (bfd_write ((PTR) decbuf, 1, 12, abfd) != 12) + return false; + for (i = 0; i < count; i++) + { + sprintf (decbuf, "%-12ld", (long) offsets[i]); + if (bfd_write ((PTR) decbuf, 1, 12, abfd) != 12) + return false; + } + for (sub = abfd->archive_head; sub != NULL; sub = sub->next) + { + const char *name; + size_t namlen; + + name = normalize_filename (sub); + namlen = strlen (name); + if (bfd_write ((PTR) name, 1, namlen + 1, abfd) != namlen + 1) + return false; + } + if ((size & 1) != 0) + { + bfd_byte b; + + b = '\0'; + if (bfd_write ((PTR) &b, 1, 1, abfd) != 1) + return false; + } + + /* Write out the armap, if appropriate. */ + + if (! makemap || ! hasobjects) + sprintf (fhdr.symoff, "%d", 0); + else + { + BFD_ASSERT (nextoff == bfd_tell (abfd)); + /* XXX This call actually should use %lld (at least on 32-bit + machines) since the fields's width is 20 and there numbers with + more than 32 bits can be represented. */ + bfd_ardata (abfd)->tdata = (PTR) &fhdr; + if (! _bfd_compute_and_write_armap (abfd, 0)) + return false; + } + + /* Write out the archive file header. */ + + /* We need spaces, not null bytes, in the header. */ + for (p = (char *) &fhdr; p < (char *) &fhdr + SIZEOF_AR_FILE_HDR_BIG; p++) + if (*p == '\0') + *p = ' '; + + if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 + || (bfd_write ((PTR) &fhdr, SIZEOF_AR_FILE_HDR_BIG, 1, abfd) != + SIZEOF_AR_FILE_HDR_BIG)) + return false; + + return true; +} + +boolean +_bfd_xcoff_write_archive_contents (abfd) + bfd *abfd; +{ + if (! xcoff_big_format_p (abfd)) + return xcoff_write_archive_contents_old (abfd); + else + return xcoff_write_archive_contents_big (abfd); +} + +/* We can't use the usual coff_sizeof_headers routine, because AIX + always uses an a.out header. */ + +int +_bfd_xcoff_sizeof_headers (abfd, reloc) + bfd *abfd; + boolean reloc ATTRIBUTE_UNUSED; +{ + int size; + + size = FILHSZ; + if (xcoff_data (abfd)->full_aouthdr) + size += AOUTSZ; + else + size += SMALL_AOUTSZ; + size += abfd->section_count * SCNHSZ; + return size; +} diff --git a/contrib/binutils/bfd/cpu-ia64-opc.c b/contrib/binutils/bfd/cpu-ia64-opc.c new file mode 100644 index 0000000..8c22942 --- /dev/null +++ b/contrib/binutils/bfd/cpu-ia64-opc.c @@ -0,0 +1,589 @@ +/* Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Logically, this code should be part of libopcode but since some of + the operand insertion/extraction functions help bfd to implement + relocations, this code is included as part of elf64-ia64.c. This + avoids circular dependencies between libopcode and libbfd and also + obviates the need for applications to link in libopcode when all + they really want is libbfd. + + --davidm Mon Apr 13 22:14:02 1998 */ + +#include "../opcodes/ia64-opc.h" + +#define NELEMS(a) ((int) (sizeof (a) / sizeof ((a)[0]))) + +static const char* +ins_rsvd (const struct ia64_operand *self ATTRIBUTE_UNUSED, + ia64_insn value ATTRIBUTE_UNUSED, ia64_insn *code ATTRIBUTE_UNUSED) +{ + return "internal error---this shouldn't happen"; +} + +static const char* +ext_rsvd (const struct ia64_operand *self ATTRIBUTE_UNUSED, + ia64_insn code ATTRIBUTE_UNUSED, ia64_insn *valuep ATTRIBUTE_UNUSED) +{ + return "internal error---this shouldn't happen"; +} + +static const char* +ins_const (const struct ia64_operand *self ATTRIBUTE_UNUSED, + ia64_insn value ATTRIBUTE_UNUSED, ia64_insn *code ATTRIBUTE_UNUSED) +{ + return 0; +} + +static const char* +ext_const (const struct ia64_operand *self ATTRIBUTE_UNUSED, + ia64_insn code ATTRIBUTE_UNUSED, ia64_insn *valuep ATTRIBUTE_UNUSED) +{ + return 0; +} + +static const char* +ins_reg (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + if (value >= 1u << self->field[0].bits) + return "register number out of range"; + + *code |= value << self->field[0].shift; + return 0; +} + +static const char* +ext_reg (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + *valuep = ((code >> self->field[0].shift) + & ((1u << self->field[0].bits) - 1)); + return 0; +} + +static const char* +ins_immu (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + ia64_insn new = 0; + int i; + + for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i) + { + new |= ((value & ((((ia64_insn) 1) << self->field[i].bits) - 1)) + << self->field[i].shift); + value >>= self->field[i].bits; + } + if (value) + return "integer operand out of range"; + + *code |= new; + return 0; +} + +static const char* +ext_immu (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + BFD_HOST_U_64_BIT value = 0; + int i, bits = 0, total = 0; + + for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i) + { + bits = self->field[i].bits; + value |= ((code >> self->field[i].shift) + & ((((BFD_HOST_U_64_BIT) 1) << bits) - 1)) << total; + total += bits; + } + *valuep = value; + return 0; +} + +static const char* +ins_immus8 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + if (value & 0x7) + return "value not an integer multiple of 8"; + return ins_immu (self, value >> 3, code); +} + +static const char* +ext_immus8 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + const char *result; + + result = ext_immu (self, code, valuep); + if (result) + return result; + + *valuep = *valuep << 3; + return 0; +} + +static const char* +ins_imms_scaled (const struct ia64_operand *self, ia64_insn value, + ia64_insn *code, int scale) +{ + BFD_HOST_64_BIT svalue = value, sign_bit = 0; + ia64_insn new = 0; + int i; + + svalue >>= scale; + + for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i) + { + new |= ((svalue & ((((ia64_insn) 1) << self->field[i].bits) - 1)) + << self->field[i].shift); + sign_bit = (svalue >> (self->field[i].bits - 1)) & 1; + svalue >>= self->field[i].bits; + } + if ((!sign_bit && svalue != 0) || (sign_bit && svalue != -1)) + return "integer operand out of range"; + + *code |= new; + return 0; +} + +static const char* +ext_imms_scaled (const struct ia64_operand *self, ia64_insn code, + ia64_insn *valuep, int scale) +{ + int i, bits = 0, total = 0, shift; + BFD_HOST_64_BIT val = 0; + + for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i) + { + bits = self->field[i].bits; + val |= ((code >> self->field[i].shift) + & ((((BFD_HOST_U_64_BIT) 1) << bits) - 1)) << total; + total += bits; + } + /* sign extend: */ + shift = 8*sizeof (val) - total; + val = (val << shift) >> shift; + + *valuep = (val << scale); + return 0; +} + +static const char* +ins_imms (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + return ins_imms_scaled (self, value, code, 0); +} + +static const char* +ins_immsu4 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + if (value == (BFD_HOST_U_64_BIT) 0x100000000) + value = 0; + else + value = (((BFD_HOST_64_BIT)value << 32) >> 32); + + return ins_imms_scaled (self, value, code, 0); +} + +static const char* +ext_imms (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + return ext_imms_scaled (self, code, valuep, 0); +} + +static const char* +ins_immsm1 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + --value; + return ins_imms_scaled (self, value, code, 0); +} + +static const char* +ins_immsm1u4 (const struct ia64_operand *self, ia64_insn value, + ia64_insn *code) +{ + if (value == (BFD_HOST_U_64_BIT) 0x100000000) + value = 0; + else + value = (((BFD_HOST_64_BIT)value << 32) >> 32); + + --value; + return ins_imms_scaled (self, value, code, 0); +} + +static const char* +ext_immsm1 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + const char *res = ext_imms_scaled (self, code, valuep, 0); + + ++*valuep; + return res; +} + +static const char* +ins_imms1 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + return ins_imms_scaled (self, value, code, 1); +} + +static const char* +ext_imms1 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + return ext_imms_scaled (self, code, valuep, 1); +} + +static const char* +ins_imms4 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + return ins_imms_scaled (self, value, code, 4); +} + +static const char* +ext_imms4 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + return ext_imms_scaled (self, code, valuep, 4); +} + +static const char* +ins_imms16 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + return ins_imms_scaled (self, value, code, 16); +} + +static const char* +ext_imms16 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + return ext_imms_scaled (self, code, valuep, 16); +} + +static const char* +ins_cimmu (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + ia64_insn mask = (((ia64_insn) 1) << self->field[0].bits) - 1; + return ins_immu (self, value ^ mask, code); +} + +static const char* +ext_cimmu (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + const char *result; + ia64_insn mask; + + mask = (((ia64_insn) 1) << self->field[0].bits) - 1; + result = ext_immu (self, code, valuep); + if (!result) + { + mask = (((ia64_insn) 1) << self->field[0].bits) - 1; + *valuep ^= mask; + } + return result; +} + +static const char* +ins_cnt (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + --value; + if (value >= ((BFD_HOST_U_64_BIT) 1) << self->field[0].bits) + return "count out of range"; + + *code |= value << self->field[0].shift; + return 0; +} + +static const char* +ext_cnt (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + *valuep = ((code >> self->field[0].shift) + & ((((BFD_HOST_U_64_BIT) 1) << self->field[0].bits) - 1)) + 1; + return 0; +} + +static const char* +ins_cnt2b (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + --value; + + if (value > 2) + return "count must be in range 1..3"; + + *code |= value << self->field[0].shift; + return 0; +} + +static const char* +ext_cnt2b (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + *valuep = ((code >> self->field[0].shift) & 0x3) + 1; + return 0; +} + +static const char* +ins_cnt2c (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + switch (value) + { + case 0: value = 0; break; + case 7: value = 1; break; + case 15: value = 2; break; + case 16: value = 3; break; + default: return "count must be 0, 7, 15, or 16"; + } + *code |= value << self->field[0].shift; + return 0; +} + +static const char* +ext_cnt2c (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + ia64_insn value; + + value = (code >> self->field[0].shift) & 0x3; + switch (value) + { + case 0: value = 0; break; + case 1: value = 7; break; + case 2: value = 15; break; + case 3: value = 16; break; + } + *valuep = value; + return 0; +} + +static const char* +ins_inc3 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + BFD_HOST_64_BIT val = value; + BFD_HOST_U_64_BIT sign = 0; + + if (val < 0) + { + sign = 0x4; + value = -value; + } + switch (value) + { + case 1: value = 3; break; + case 4: value = 2; break; + case 8: value = 1; break; + case 16: value = 0; break; + default: return "count must be +/- 1, 4, 8, or 16"; + } + *code |= (sign | value) << self->field[0].shift; + return 0; +} + +static const char* +ext_inc3 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + BFD_HOST_64_BIT val; + int negate; + + val = (code >> self->field[0].shift) & 0x7; + negate = val & 0x4; + switch (val & 0x3) + { + case 0: val = 16; break; + case 1: val = 8; break; + case 2: val = 4; break; + case 3: val = 1; break; + } + if (negate) + val = -val; + + *valuep = val; + return 0; +} + +#define CST IA64_OPND_CLASS_CST +#define REG IA64_OPND_CLASS_REG +#define IND IA64_OPND_CLASS_IND +#define ABS IA64_OPND_CLASS_ABS +#define REL IA64_OPND_CLASS_REL + +#define SDEC IA64_OPND_FLAG_DECIMAL_SIGNED +#define UDEC IA64_OPND_FLAG_DECIMAL_UNSIGNED + +const struct ia64_operand elf64_ia64_operands[IA64_OPND_COUNT] = + { + /* constants: */ + { CST, ins_const, ext_const, "NIL", {{ 0, 0}}, 0, "<none>" }, + { CST, ins_const, ext_const, "ar.ccv", {{ 0, 0}}, 0, "ar.ccv" }, + { CST, ins_const, ext_const, "ar.pfs", {{ 0, 0}}, 0, "ar.pfs" }, + { CST, ins_const, ext_const, "1", {{ 0, 0}}, 0, "1" }, + { CST, ins_const, ext_const, "8", {{ 0, 0}}, 0, "8" }, + { CST, ins_const, ext_const, "16", {{ 0, 0}}, 0, "16" }, + { CST, ins_const, ext_const, "r0", {{ 0, 0}}, 0, "r0" }, + { CST, ins_const, ext_const, "ip", {{ 0, 0}}, 0, "ip" }, + { CST, ins_const, ext_const, "pr", {{ 0, 0}}, 0, "pr" }, + { CST, ins_const, ext_const, "pr.rot", {{ 0, 0}}, 0, "pr.rot" }, + { CST, ins_const, ext_const, "psr", {{ 0, 0}}, 0, "psr" }, + { CST, ins_const, ext_const, "psr.l", {{ 0, 0}}, 0, "psr.l" }, + { CST, ins_const, ext_const, "psr.um", {{ 0, 0}}, 0, "psr.um" }, + + /* register operands: */ + { REG, ins_reg, ext_reg, "ar", {{ 7, 20}}, 0, /* AR3 */ + "an application register" }, + { REG, ins_reg, ext_reg, "b", {{ 3, 6}}, 0, /* B1 */ + "a branch register" }, + { REG, ins_reg, ext_reg, "b", {{ 3, 13}}, 0, /* B2 */ + "a branch register"}, + { REG, ins_reg, ext_reg, "cr", {{ 7, 20}}, 0, /* CR */ + "a control register"}, + { REG, ins_reg, ext_reg, "f", {{ 7, 6}}, 0, /* F1 */ + "a floating-point register" }, + { REG, ins_reg, ext_reg, "f", {{ 7, 13}}, 0, /* F2 */ + "a floating-point register" }, + { REG, ins_reg, ext_reg, "f", {{ 7, 20}}, 0, /* F3 */ + "a floating-point register" }, + { REG, ins_reg, ext_reg, "f", {{ 7, 27}}, 0, /* F4 */ + "a floating-point register" }, + { REG, ins_reg, ext_reg, "p", {{ 6, 6}}, 0, /* P1 */ + "a predicate register" }, + { REG, ins_reg, ext_reg, "p", {{ 6, 27}}, 0, /* P2 */ + "a predicate register" }, + { REG, ins_reg, ext_reg, "r", {{ 7, 6}}, 0, /* R1 */ + "a general register" }, + { REG, ins_reg, ext_reg, "r", {{ 7, 13}}, 0, /* R2 */ + "a general register" }, + { REG, ins_reg, ext_reg, "r", {{ 7, 20}}, 0, /* R3 */ + "a general register" }, + { REG, ins_reg, ext_reg, "r", {{ 2, 20}}, 0, /* R3_2 */ + "a general register r0-r3" }, + + /* indirect operands: */ + { IND, ins_reg, ext_reg, "cpuid", {{7, 20}}, 0, /* CPUID_R3 */ + "a cpuid register" }, + { IND, ins_reg, ext_reg, "dbr", {{7, 20}}, 0, /* DBR_R3 */ + "a dbr register" }, + { IND, ins_reg, ext_reg, "dtr", {{7, 20}}, 0, /* DTR_R3 */ + "a dtr register" }, + { IND, ins_reg, ext_reg, "itr", {{7, 20}}, 0, /* ITR_R3 */ + "an itr register" }, + { IND, ins_reg, ext_reg, "ibr", {{7, 20}}, 0, /* IBR_R3 */ + "an ibr register" }, + { IND, ins_reg, ext_reg, "", {{7, 20}}, 0, /* MR3 */ + "an indirect memory address" }, + { IND, ins_reg, ext_reg, "msr", {{7, 20}}, 0, /* MSR_R3 */ + "an msr register" }, + { IND, ins_reg, ext_reg, "pkr", {{7, 20}}, 0, /* PKR_R3 */ + "a pkr register" }, + { IND, ins_reg, ext_reg, "pmc", {{7, 20}}, 0, /* PMC_R3 */ + "a pmc register" }, + { IND, ins_reg, ext_reg, "pmd", {{7, 20}}, 0, /* PMD_R3 */ + "a pmd register" }, + { IND, ins_reg, ext_reg, "rr", {{7, 20}}, 0, /* RR_R3 */ + "an rr register" }, + + /* immediate operands: */ + { ABS, ins_cimmu, ext_cimmu, 0, {{ 5, 20 }}, UDEC, /* CCNT5 */ + "a 5-bit count (0-31)" }, + { ABS, ins_cnt, ext_cnt, 0, {{ 2, 27 }}, UDEC, /* CNT2a */ + "a 2-bit count (1-4)" }, + { ABS, ins_cnt2b, ext_cnt2b, 0, {{ 2, 27 }}, UDEC, /* CNT2b */ + "a 2-bit count (1-3)" }, + { ABS, ins_cnt2c, ext_cnt2c, 0, {{ 2, 30 }}, UDEC, /* CNT2c */ + "a count (0, 7, 15, or 16)" }, + { ABS, ins_immu, ext_immu, 0, {{ 5, 14}}, UDEC, /* CNT5 */ + "a 5-bit count (0-31)" }, + { ABS, ins_immu, ext_immu, 0, {{ 6, 27}}, UDEC, /* CNT6 */ + "a 6-bit count (0-63)" }, + { ABS, ins_cimmu, ext_cimmu, 0, {{ 6, 20}}, UDEC, /* CPOS6a */ + "a 6-bit bit pos (0-63)" }, + { ABS, ins_cimmu, ext_cimmu, 0, {{ 6, 14}}, UDEC, /* CPOS6b */ + "a 6-bit bit pos (0-63)" }, + { ABS, ins_cimmu, ext_cimmu, 0, {{ 6, 31}}, UDEC, /* CPOS6c */ + "a 6-bit bit pos (0-63)" }, + { ABS, ins_imms, ext_imms, 0, {{ 1, 36}}, SDEC, /* IMM1 */ + "a 1-bit integer (-1, 0)" }, + { ABS, ins_immu, ext_immu, 0, {{ 2, 13}}, UDEC, /* IMMU2 */ + "a 2-bit unsigned (0-3)" }, + { ABS, ins_immu, ext_immu, 0, {{ 7, 13}}, 0, /* IMMU7a */ + "a 7-bit unsigned (0-127)" }, + { ABS, ins_immu, ext_immu, 0, {{ 7, 20}}, 0, /* IMMU7b */ + "a 7-bit unsigned (0-127)" }, + { ABS, ins_immu, ext_immu, 0, {{ 7, 13}}, UDEC, /* SOF */ + "a frame size (register count)" }, + { ABS, ins_immu, ext_immu, 0, {{ 7, 20}}, UDEC, /* SOL */ + "a local register count" }, + { ABS, ins_immus8,ext_immus8,0, {{ 4, 27}}, UDEC, /* SOR */ + "a rotating register count (integer multiple of 8)" }, + { ABS, ins_imms, ext_imms, 0, /* IMM8 */ + {{ 7, 13}, { 1, 36}}, SDEC, + "an 8-bit integer (-128-127)" }, + { ABS, ins_immsu4, ext_imms, 0, /* IMM8U4 */ + {{ 7, 13}, { 1, 36}}, SDEC, + "an 8-bit signed integer for 32-bit unsigned compare (-128-127)" }, + { ABS, ins_immsm1, ext_immsm1, 0, /* IMM8M1 */ + {{ 7, 13}, { 1, 36}}, SDEC, + "an 8-bit integer (-127-128)" }, + { ABS, ins_immsm1u4, ext_immsm1, 0, /* IMM8M1U4 */ + {{ 7, 13}, { 1, 36}}, SDEC, + "an 8-bit integer for 32-bit unsigned compare (-127-(-1),1-128,0x100000000)" }, + { ABS, ins_immsm1, ext_immsm1, 0, /* IMM8M1U8 */ + {{ 7, 13}, { 1, 36}}, SDEC, + "an 8-bit integer for 64-bit unsigned compare (-127-(-1),1-128,0x10000000000000000)" }, + { ABS, ins_immu, ext_immu, 0, {{ 2, 33}, { 7, 20}}, 0, /* IMMU9 */ + "a 9-bit unsigned (0-511)" }, + { ABS, ins_imms, ext_imms, 0, /* IMM9a */ + {{ 7, 6}, { 1, 27}, { 1, 36}}, SDEC, + "a 9-bit integer (-256-255)" }, + { ABS, ins_imms, ext_imms, 0, /* IMM9b */ + {{ 7, 13}, { 1, 27}, { 1, 36}}, SDEC, + "a 9-bit integer (-256-255)" }, + { ABS, ins_imms, ext_imms, 0, /* IMM14 */ + {{ 7, 13}, { 6, 27}, { 1, 36}}, SDEC, + "a 14-bit integer (-8192-8191)" }, + { ABS, ins_imms1, ext_imms1, 0, /* IMM17 */ + {{ 7, 6}, { 8, 24}, { 1, 36}}, 0, + "a 17-bit integer (-65536-65535)" }, + { ABS, ins_immu, ext_immu, 0, {{20, 6}, { 1, 36}}, 0, /* IMMU21 */ + "a 21-bit unsigned" }, + { ABS, ins_imms, ext_imms, 0, /* IMM22 */ + {{ 7, 13}, { 9, 27}, { 5, 22}, { 1, 36}}, SDEC, + "a 22-bit signed integer" }, + { ABS, ins_immu, ext_immu, 0, /* IMMU24 */ + {{21, 6}, { 2, 31}, { 1, 36}}, 0, + "a 24-bit unsigned" }, + { ABS, ins_imms16,ext_imms16,0, {{27, 6}, { 1, 36}}, 0, /* IMM44 */ + "a 44-bit unsigned (least 16 bits ignored/zeroes)" }, + { ABS, ins_rsvd, ext_rsvd, 0, {{0, 0}}, 0, /* IMMU62 */ + "a 62-bit unsigned" }, + { ABS, ins_rsvd, ext_rsvd, 0, {{0, 0}}, 0, /* IMMU64 */ + "a 64-bit unsigned" }, + { ABS, ins_inc3, ext_inc3, 0, {{ 3, 13}}, SDEC, /* INC3 */ + "an increment (+/- 1, 4, 8, or 16)" }, + { ABS, ins_cnt, ext_cnt, 0, {{ 4, 27}}, UDEC, /* LEN4 */ + "a 4-bit length (1-16)" }, + { ABS, ins_cnt, ext_cnt, 0, {{ 6, 27}}, UDEC, /* LEN6 */ + "a 6-bit length (1-64)" }, + { ABS, ins_immu, ext_immu, 0, {{ 4, 20}}, 0, /* MBTYPE4 */ + "a mix type (@rev, @mix, @shuf, @alt, or @brcst)" }, + { ABS, ins_immu, ext_immu, 0, {{ 8, 20}}, 0, /* MBTYPE8 */ + "an 8-bit mix type" }, + { ABS, ins_immu, ext_immu, 0, {{ 6, 14}}, UDEC, /* POS6 */ + "a 6-bit bit pos (0-63)" }, + { REL, ins_imms4, ext_imms4, 0, {{ 7, 6}, { 2, 33}}, 0, /* TAG13 */ + "a branch tag" }, + { REL, ins_imms4, ext_imms4, 0, {{ 9, 24}}, 0, /* TAG13b */ + "a branch tag" }, + { REL, ins_imms4, ext_imms4, 0, {{20, 6}, { 1, 36}}, 0, /* TGT25 */ + "a branch target" }, + { REL, ins_imms4, ext_imms4, 0, /* TGT25b */ + {{ 7, 6}, {13, 20}, { 1, 36}}, 0, + "a branch target" }, + { REL, ins_imms4, ext_imms4, 0, {{20, 13}, { 1, 36}}, 0, /* TGT25c */ + "a branch target" }, + { REL, ins_rsvd, ext_rsvd, 0, {{0, 0}}, 0, /* TGT64 */ + "a branch target" }, + }; diff --git a/contrib/binutils/bfd/cpu-ia64.c b/contrib/binutils/bfd/cpu-ia64.c new file mode 100644 index 0000000..1f36568 --- /dev/null +++ b/contrib/binutils/bfd/cpu-ia64.c @@ -0,0 +1,57 @@ +/* BFD support for the ia64 architecture. + Copyright 1998, 1999, 2000 Free Software Foundation, Inc. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" + +const bfd_arch_info_type bfd_ia64_elf32_arch = + { + 64, /* 64 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_ia64, + bfd_mach_ia64_elf32, + "ia64", + "ia64-elf32", + 3, /* log2 of section alignment */ + true, /* the one and only */ + bfd_default_compatible, + bfd_default_scan , + 0, + }; + +const bfd_arch_info_type bfd_ia64_arch = + { + 64, /* 64 bits in a word */ + 64, /* 64 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_ia64, + bfd_mach_ia64_elf64, + "ia64", + "ia64-elf64", + 3, /* log2 of section alignment */ + true, /* the one and only */ + bfd_default_compatible, + bfd_default_scan , + &bfd_ia64_elf32_arch, + }; + +#include "cpu-ia64-opc.c" diff --git a/contrib/binutils/bfd/cpu-rs6000.c b/contrib/binutils/bfd/cpu-rs6000.c new file mode 100644 index 0000000..89b9230 --- /dev/null +++ b/contrib/binutils/bfd/cpu-rs6000.c @@ -0,0 +1,116 @@ +/* BFD back-end for rs6000 support + Copyright 1990, 1991, 1993, 1995, 2000 Free Software Foundation, Inc. + FIXME: Can someone provide a transliteration of this name into ASCII? + Using the following chars caused a compiler warning on HIUX (so I replaced + them with octal escapes), and isn't useful without an understanding of what + character set it is. + Written by Mimi Ph\373\364ng-Th\345o V\365 of IBM + and John Gilmore of Cygnus Support. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" + +/* The RS/6000 architecture is compatible with the PowerPC common + architecture. */ + +static const bfd_arch_info_type *rs6000_compatible + PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *)); + +static const bfd_arch_info_type * +rs6000_compatible (a,b) + const bfd_arch_info_type *a; + const bfd_arch_info_type *b; +{ + BFD_ASSERT (a->arch == bfd_arch_rs6000); + switch (b->arch) + { + default: + return NULL; + case bfd_arch_rs6000: + return bfd_default_compatible (a, b); + case bfd_arch_powerpc: + if (b->mach == 0) + return b; + return NULL; + } + /*NOTREACHED*/ +} + +static const bfd_arch_info_type arch_info_struct[] = +{ + { + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_rs6000, + bfd_mach_rs6k_rs1, + "rs6000", + "rs6000:rs1", + 3, + false, /* not the default */ + rs6000_compatible, + bfd_default_scan, + &arch_info_struct[1] + }, + { + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_rs6000, + bfd_mach_rs6k_rsc, + "rs6000", + "rs6000:rsc", + 3, + false, /* not the default */ + rs6000_compatible, + bfd_default_scan, + &arch_info_struct[2] + }, + { + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_rs6000, + bfd_mach_rs6k_rs2, + "rs6000", + "rs6000:rs2", + 3, + false, /* not the default */ + rs6000_compatible, + bfd_default_scan, + 0 + } +}; + +const bfd_arch_info_type bfd_rs6000_arch = + { + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_rs6000, + bfd_mach_rs6k, /* POWER common architecture */ + "rs6000", + "rs6000:6000", + 3, + true, /* the default */ + rs6000_compatible, + bfd_default_scan, + &arch_info_struct[0] + }; diff --git a/contrib/binutils/bfd/efi-app-ia64.c b/contrib/binutils/bfd/efi-app-ia64.c new file mode 100644 index 0000000..6104568 --- /dev/null +++ b/contrib/binutils/bfd/efi-app-ia64.c @@ -0,0 +1,35 @@ +/* BFD back-end for HP/Intel IA-64 EFI application files. + Copyright 1999, 2000, 2001 Free Software Foundation, Inc. + Contributed by David Mosberger <davidm@hpl.hp.com> + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" + +#define TARGET_SYM bfd_efi_app_ia64_vec +#define TARGET_NAME "efi-app-ia64" +#define COFF_IMAGE_WITH_PE +#define COFF_WITH_PE +#define COFF_WITH_pep +#define PCRELOFFSET true +#define TARGET_UNDERSCORE '_' +#define COFF_LONG_SECTION_NAMES +#define PEI_TARGET_SUBSYSTEM IMAGE_SUBSYSTEM_EFI_APPLICATION +#define PEI_FORCE_MINIMUM_ALIGNMENT + +#include "coff-ia64.c" diff --git a/contrib/binutils/bfd/elfxx-ia64.c b/contrib/binutils/bfd/elfxx-ia64.c new file mode 100644 index 0000000..c86f7a9 --- /dev/null +++ b/contrib/binutils/bfd/elfxx-ia64.c @@ -0,0 +1,4235 @@ +/* IA-64 support for 64-bit ELF + Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "elf-bfd.h" +#include "opcode/ia64.h" +#include "elf/ia64.h" + +/* + * THE RULES for all the stuff the linker creates -- + * + * GOT Entries created in response to LTOFF or LTOFF_FPTR + * relocations. Dynamic relocs created for dynamic + * symbols in an application; REL relocs for locals + * in a shared library. + * + * FPTR The canonical function descriptor. Created for local + * symbols in applications. Descriptors for dynamic symbols + * and local symbols in shared libraries are created by + * ld.so. Thus there are no dynamic relocs against these + * objects. The FPTR relocs for such _are_ passed through + * to the dynamic relocation tables. + * + * FULL_PLT Created for a PCREL21B relocation against a dynamic symbol. + * Requires the creation of a PLTOFF entry. This does not + * require any dynamic relocations. + * + * PLTOFF Created by PLTOFF relocations. For local symbols, this + * is an alternate function descriptor, and in shared libraries + * requires two REL relocations. Note that this cannot be + * transformed into an FPTR relocation, since it must be in + * range of the GP. For dynamic symbols, this is a function + * descriptor for a MIN_PLT entry, and requires one IPLT reloc. + * + * MIN_PLT Created by PLTOFF entries against dynamic symbols. This + * does not reqire dynamic relocations. + */ + +#define USE_RELA /* we want RELA relocs, not REL */ + +#define NELEMS(a) ((int) (sizeof (a) / sizeof ((a)[0]))) + +typedef struct bfd_hash_entry *(*new_hash_entry_func) + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); + +/* In dynamically (linker-) created sections, we generally need to keep track + of the place a symbol or expression got allocated to. This is done via hash + tables that store entries of the following type. */ + +struct elfNN_ia64_dyn_sym_info +{ + /* The addend for which this entry is relevant. */ + bfd_vma addend; + + /* Next addend in the list. */ + struct elfNN_ia64_dyn_sym_info *next; + + bfd_vma got_offset; + bfd_vma fptr_offset; + bfd_vma pltoff_offset; + bfd_vma plt_offset; + bfd_vma plt2_offset; + + /* The symbol table entry, if any, that this was derrived from. */ + struct elf_link_hash_entry *h; + + /* Used to count non-got, non-plt relocations for delayed sizing + of relocation sections. */ + struct elfNN_ia64_dyn_reloc_entry + { + struct elfNN_ia64_dyn_reloc_entry *next; + asection *srel; + int type; + int count; + } *reloc_entries; + + /* True when the section contents have been updated. */ + unsigned got_done : 1; + unsigned fptr_done : 1; + unsigned pltoff_done : 1; + + /* True for the different kinds of linker data we want created. */ + unsigned want_got : 1; + unsigned want_fptr : 1; + unsigned want_ltoff_fptr : 1; + unsigned want_plt : 1; + unsigned want_plt2 : 1; + unsigned want_pltoff : 1; +}; + +struct elfNN_ia64_local_hash_entry +{ + struct bfd_hash_entry root; + struct elfNN_ia64_dyn_sym_info *info; +}; + +struct elfNN_ia64_local_hash_table +{ + struct bfd_hash_table root; + /* No additional fields for now. */ +}; + +struct elfNN_ia64_link_hash_entry +{ + struct elf_link_hash_entry root; + struct elfNN_ia64_dyn_sym_info *info; +}; + +struct elfNN_ia64_link_hash_table +{ + /* The main hash table */ + struct elf_link_hash_table root; + + asection *got_sec; /* the linkage table section (or NULL) */ + asection *rel_got_sec; /* dynamic relocation section for same */ + asection *fptr_sec; /* function descriptor table (or NULL) */ + asection *plt_sec; /* the primary plt section (or NULL) */ + asection *pltoff_sec; /* private descriptors for plt (or NULL) */ + asection *rel_pltoff_sec; /* dynamic relocation section for same */ + + bfd_size_type minplt_entries; /* number of minplt entries */ + + struct elfNN_ia64_local_hash_table loc_hash_table; +}; + +#define elfNN_ia64_hash_table(p) \ + ((struct elfNN_ia64_link_hash_table *) ((p)->hash)) + +static bfd_reloc_status_type elfNN_ia64_reloc + PARAMS ((bfd *abfd, arelent *reloc, asymbol *sym, PTR data, + asection *input_section, bfd *output_bfd, char **error_message)); +static reloc_howto_type * lookup_howto + PARAMS ((unsigned int rtype)); +static reloc_howto_type *elfNN_ia64_reloc_type_lookup + PARAMS ((bfd *abfd, bfd_reloc_code_real_type bfd_code)); +static void elfNN_ia64_info_to_howto + PARAMS ((bfd *abfd, arelent *bfd_reloc, ElfNN_Internal_Rela *elf_reloc)); +static boolean elfNN_ia64_relax_section + PARAMS((bfd *abfd, asection *sec, struct bfd_link_info *link_info, + boolean *again)); +static boolean is_unwind_section_name + PARAMS ((const char *)); +static boolean elfNN_ia64_section_from_shdr + PARAMS ((bfd *, ElfNN_Internal_Shdr *, char *)); +static boolean elfNN_ia64_fake_sections + PARAMS ((bfd *abfd, ElfNN_Internal_Shdr *hdr, asection *sec)); +static void elfNN_ia64_final_write_processing + PARAMS ((bfd *abfd, boolean linker)); +static boolean elfNN_ia64_add_symbol_hook + PARAMS ((bfd *abfd, struct bfd_link_info *info, const Elf_Internal_Sym *sym, + const char **namep, flagword *flagsp, asection **secp, + bfd_vma *valp)); +static int elfNN_ia64_additional_program_headers + PARAMS ((bfd *abfd)); +static boolean elfNN_ia64_is_local_label_name + PARAMS ((bfd *abfd, const char *name)); +static boolean elfNN_ia64_dynamic_symbol_p + PARAMS ((struct elf_link_hash_entry *h, struct bfd_link_info *info)); +static boolean elfNN_ia64_local_hash_table_init + PARAMS ((struct elfNN_ia64_local_hash_table *ht, bfd *abfd, + new_hash_entry_func new)); +static struct bfd_hash_entry *elfNN_ia64_new_loc_hash_entry + PARAMS ((struct bfd_hash_entry *entry, struct bfd_hash_table *table, + const char *string)); +static struct bfd_hash_entry *elfNN_ia64_new_elf_hash_entry + PARAMS ((struct bfd_hash_entry *entry, struct bfd_hash_table *table, + const char *string)); +static struct bfd_link_hash_table *elfNN_ia64_hash_table_create + PARAMS ((bfd *abfd)); +static struct elfNN_ia64_local_hash_entry *elfNN_ia64_local_hash_lookup + PARAMS ((struct elfNN_ia64_local_hash_table *table, const char *string, + boolean create, boolean copy)); +static void elfNN_ia64_dyn_sym_traverse + PARAMS ((struct elfNN_ia64_link_hash_table *ia64_info, + boolean (*func) (struct elfNN_ia64_dyn_sym_info *, PTR), + PTR info)); +static boolean elfNN_ia64_create_dynamic_sections + PARAMS ((bfd *abfd, struct bfd_link_info *info)); +static struct elfNN_ia64_dyn_sym_info * get_dyn_sym_info + PARAMS ((struct elfNN_ia64_link_hash_table *ia64_info, + struct elf_link_hash_entry *h, + bfd *abfd, const Elf_Internal_Rela *rel, boolean create)); +static asection *get_got + PARAMS ((bfd *abfd, struct bfd_link_info *info, + struct elfNN_ia64_link_hash_table *ia64_info)); +static asection *get_fptr + PARAMS ((bfd *abfd, struct bfd_link_info *info, + struct elfNN_ia64_link_hash_table *ia64_info)); +static asection *get_pltoff + PARAMS ((bfd *abfd, struct bfd_link_info *info, + struct elfNN_ia64_link_hash_table *ia64_info)); +static asection *get_reloc_section + PARAMS ((bfd *abfd, struct elfNN_ia64_link_hash_table *ia64_info, + asection *sec, boolean create)); +static boolean count_dyn_reloc + PARAMS ((bfd *abfd, struct elfNN_ia64_dyn_sym_info *dyn_i, + asection *srel, int type)); +static boolean elfNN_ia64_check_relocs + PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *sec, + const Elf_Internal_Rela *relocs)); +static boolean elfNN_ia64_adjust_dynamic_symbol + PARAMS ((struct bfd_link_info *info, struct elf_link_hash_entry *h)); +static unsigned long global_sym_index + PARAMS ((struct elf_link_hash_entry *h)); +static boolean allocate_fptr + PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean allocate_global_data_got + PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean allocate_global_fptr_got + PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean allocate_local_got + PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean allocate_pltoff_entries + PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean allocate_plt_entries + PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean allocate_plt2_entries + PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean allocate_dynrel_entries + PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean elfNN_ia64_size_dynamic_sections + PARAMS ((bfd *output_bfd, struct bfd_link_info *info)); +static bfd_reloc_status_type elfNN_ia64_install_value + PARAMS ((bfd *abfd, bfd_byte *hit_addr, bfd_vma val, unsigned int r_type)); +static void elfNN_ia64_install_dyn_reloc + PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *sec, + asection *srel, bfd_vma offset, unsigned int type, + long dynindx, bfd_vma addend)); +static bfd_vma set_got_entry + PARAMS ((bfd *abfd, struct bfd_link_info *info, + struct elfNN_ia64_dyn_sym_info *dyn_i, long dynindx, + bfd_vma addend, bfd_vma value, unsigned int dyn_r_type)); +static bfd_vma set_fptr_entry + PARAMS ((bfd *abfd, struct bfd_link_info *info, + struct elfNN_ia64_dyn_sym_info *dyn_i, + bfd_vma value)); +static bfd_vma set_pltoff_entry + PARAMS ((bfd *abfd, struct bfd_link_info *info, + struct elfNN_ia64_dyn_sym_info *dyn_i, + bfd_vma value, boolean)); +static boolean elfNN_ia64_final_link + PARAMS ((bfd *abfd, struct bfd_link_info *info)); +static boolean elfNN_ia64_relocate_section + PARAMS ((bfd *output_bfd, struct bfd_link_info *info, bfd *input_bfd, + asection *input_section, bfd_byte *contents, + Elf_Internal_Rela *relocs, Elf_Internal_Sym *local_syms, + asection **local_sections)); +static boolean elfNN_ia64_finish_dynamic_symbol + PARAMS ((bfd *output_bfd, struct bfd_link_info *info, + struct elf_link_hash_entry *h, Elf_Internal_Sym *sym)); +static boolean elfNN_ia64_finish_dynamic_sections + PARAMS ((bfd *abfd, struct bfd_link_info *info)); +static boolean elfNN_ia64_set_private_flags + PARAMS ((bfd *abfd, flagword flags)); +static boolean elfNN_ia64_copy_private_bfd_data + PARAMS ((bfd *ibfd, bfd *obfd)); +static boolean elfNN_ia64_merge_private_bfd_data + PARAMS ((bfd *ibfd, bfd *obfd)); +static boolean elfNN_ia64_print_private_bfd_data + PARAMS ((bfd *abfd, PTR ptr)); + +/* ia64-specific relocation */ + +/* Perform a relocation. Not much to do here as all the hard work is + done in elfNN_ia64_final_link_relocate. */ +static bfd_reloc_status_type +elfNN_ia64_reloc (abfd, reloc, sym, data, input_section, + output_bfd, error_message) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *reloc; + asymbol *sym ATTRIBUTE_UNUSED; + PTR data ATTRIBUTE_UNUSED; + asection *input_section; + bfd *output_bfd; + char **error_message; +{ + if (output_bfd) + { + reloc->address += input_section->output_offset; + return bfd_reloc_ok; + } + *error_message = "Unsupported call to elfNN_ia64_reloc"; + return bfd_reloc_notsupported; +} + +#define IA64_HOWTO(TYPE, NAME, SIZE, PCREL, IN) \ + HOWTO (TYPE, 0, SIZE, 0, PCREL, 0, complain_overflow_signed, \ + elfNN_ia64_reloc, NAME, false, 0, 0, IN) + +/* This table has to be sorted according to increasing number of the + TYPE field. */ +static reloc_howto_type ia64_howto_table[] = + { + IA64_HOWTO (R_IA64_NONE, "NONE", 0, false, true), + + IA64_HOWTO (R_IA64_IMM14, "IMM14", 0, false, true), + IA64_HOWTO (R_IA64_IMM22, "IMM22", 0, false, true), + IA64_HOWTO (R_IA64_IMM64, "IMM64", 0, false, true), + IA64_HOWTO (R_IA64_DIR32MSB, "DIR32MSB", 2, false, true), + IA64_HOWTO (R_IA64_DIR32LSB, "DIR32LSB", 2, false, true), + IA64_HOWTO (R_IA64_DIR64MSB, "DIR64MSB", 4, false, true), + IA64_HOWTO (R_IA64_DIR64LSB, "DIR64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_GPREL22, "GPREL22", 0, false, true), + IA64_HOWTO (R_IA64_GPREL64I, "GPREL64I", 0, false, true), + IA64_HOWTO (R_IA64_GPREL32MSB, "GPREL32MSB", 2, false, true), + IA64_HOWTO (R_IA64_GPREL32LSB, "GPREL32LSB", 2, false, true), + IA64_HOWTO (R_IA64_GPREL64MSB, "GPREL64MSB", 4, false, true), + IA64_HOWTO (R_IA64_GPREL64LSB, "GPREL64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_LTOFF22, "LTOFF22", 0, false, true), + IA64_HOWTO (R_IA64_LTOFF64I, "LTOFF64I", 0, false, true), + + IA64_HOWTO (R_IA64_PLTOFF22, "PLTOFF22", 0, false, true), + IA64_HOWTO (R_IA64_PLTOFF64I, "PLTOFF64I", 0, false, true), + IA64_HOWTO (R_IA64_PLTOFF64MSB, "PLTOFF64MSB", 4, false, true), + IA64_HOWTO (R_IA64_PLTOFF64LSB, "PLTOFF64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_FPTR64I, "FPTR64I", 0, false, true), + IA64_HOWTO (R_IA64_FPTR32MSB, "FPTR32MSB", 2, false, true), + IA64_HOWTO (R_IA64_FPTR32LSB, "FPTR32LSB", 2, false, true), + IA64_HOWTO (R_IA64_FPTR64MSB, "FPTR64MSB", 4, false, true), + IA64_HOWTO (R_IA64_FPTR64LSB, "FPTR64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_PCREL60B, "PCREL60B", 0, true, true), + IA64_HOWTO (R_IA64_PCREL21B, "PCREL21B", 0, true, true), + IA64_HOWTO (R_IA64_PCREL21M, "PCREL21M", 0, true, true), + IA64_HOWTO (R_IA64_PCREL21F, "PCREL21F", 0, true, true), + IA64_HOWTO (R_IA64_PCREL32MSB, "PCREL32MSB", 2, true, true), + IA64_HOWTO (R_IA64_PCREL32LSB, "PCREL32LSB", 2, true, true), + IA64_HOWTO (R_IA64_PCREL64MSB, "PCREL64MSB", 4, true, true), + IA64_HOWTO (R_IA64_PCREL64LSB, "PCREL64LSB", 4, true, true), + + IA64_HOWTO (R_IA64_LTOFF_FPTR22, "LTOFF_FPTR22", 0, false, true), + IA64_HOWTO (R_IA64_LTOFF_FPTR64I, "LTOFF_FPTR64I", 0, false, true), + IA64_HOWTO (R_IA64_LTOFF_FPTR64MSB, "LTOFF_FPTR64MSB", 4, false, true), + IA64_HOWTO (R_IA64_LTOFF_FPTR64LSB, "LTOFF_FPTR64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_SEGREL32MSB, "SEGREL32MSB", 2, false, true), + IA64_HOWTO (R_IA64_SEGREL32LSB, "SEGREL32LSB", 2, false, true), + IA64_HOWTO (R_IA64_SEGREL64MSB, "SEGREL64MSB", 4, false, true), + IA64_HOWTO (R_IA64_SEGREL64LSB, "SEGREL64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_SECREL32MSB, "SECREL32MSB", 2, false, true), + IA64_HOWTO (R_IA64_SECREL32LSB, "SECREL32LSB", 2, false, true), + IA64_HOWTO (R_IA64_SECREL64MSB, "SECREL64MSB", 4, false, true), + IA64_HOWTO (R_IA64_SECREL64LSB, "SECREL64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_REL32MSB, "REL32MSB", 2, false, true), + IA64_HOWTO (R_IA64_REL32LSB, "REL32LSB", 2, false, true), + IA64_HOWTO (R_IA64_REL64MSB, "REL64MSB", 4, false, true), + IA64_HOWTO (R_IA64_REL64LSB, "REL64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_LTV32MSB, "LTV32MSB", 2, false, true), + IA64_HOWTO (R_IA64_LTV32LSB, "LTV32LSB", 2, false, true), + IA64_HOWTO (R_IA64_LTV64MSB, "LTV64MSB", 4, false, true), + IA64_HOWTO (R_IA64_LTV64LSB, "LTV64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_PCREL21BI, "PCREL21BI", 0, true, true), + IA64_HOWTO (R_IA64_PCREL22, "PCREL22", 0, true, true), + IA64_HOWTO (R_IA64_PCREL64I, "PCREL64I", 0, true, true), + + IA64_HOWTO (R_IA64_IPLTMSB, "IPLTMSB", 4, false, true), + IA64_HOWTO (R_IA64_IPLTLSB, "IPLTLSB", 4, false, true), + IA64_HOWTO (R_IA64_COPY, "COPY", 4, false, true), + IA64_HOWTO (R_IA64_LTOFF22X, "LTOFF22X", 0, false, true), + IA64_HOWTO (R_IA64_LDXMOV, "LDXMOV", 0, false, true), + + IA64_HOWTO (R_IA64_TPREL22, "TPREL22", 0, false, false), + IA64_HOWTO (R_IA64_TPREL64MSB, "TPREL64MSB", 8, false, false), + IA64_HOWTO (R_IA64_TPREL64LSB, "TPREL64LSB", 8, false, false), + IA64_HOWTO (R_IA64_LTOFF_TP22, "LTOFF_TP22", 0, false, false), + }; + +static unsigned char elf_code_to_howto_index[R_IA64_MAX_RELOC_CODE + 1]; + +/* Given a BFD reloc type, return the matching HOWTO structure. */ + +static reloc_howto_type* +lookup_howto (rtype) + unsigned int rtype; +{ + static int inited = 0; + int i; + + if (!inited) + { + inited = 1; + + memset (elf_code_to_howto_index, 0xff, sizeof (elf_code_to_howto_index)); + for (i = 0; i < NELEMS (ia64_howto_table); ++i) + elf_code_to_howto_index[ia64_howto_table[i].type] = i; + } + + BFD_ASSERT (rtype <= R_IA64_MAX_RELOC_CODE); + i = elf_code_to_howto_index[rtype]; + if (i >= NELEMS (ia64_howto_table)) + return 0; + return ia64_howto_table + i; +} + +static reloc_howto_type* +elfNN_ia64_reloc_type_lookup (abfd, bfd_code) + bfd *abfd ATTRIBUTE_UNUSED; + bfd_reloc_code_real_type bfd_code; +{ + unsigned int rtype; + + switch (bfd_code) + { + case BFD_RELOC_NONE: rtype = R_IA64_NONE; break; + + case BFD_RELOC_IA64_IMM14: rtype = R_IA64_IMM14; break; + case BFD_RELOC_IA64_IMM22: rtype = R_IA64_IMM22; break; + case BFD_RELOC_IA64_IMM64: rtype = R_IA64_IMM64; break; + + case BFD_RELOC_IA64_DIR32MSB: rtype = R_IA64_DIR32MSB; break; + case BFD_RELOC_IA64_DIR32LSB: rtype = R_IA64_DIR32LSB; break; + case BFD_RELOC_IA64_DIR64MSB: rtype = R_IA64_DIR64MSB; break; + case BFD_RELOC_IA64_DIR64LSB: rtype = R_IA64_DIR64LSB; break; + + case BFD_RELOC_IA64_GPREL22: rtype = R_IA64_GPREL22; break; + case BFD_RELOC_IA64_GPREL64I: rtype = R_IA64_GPREL64I; break; + case BFD_RELOC_IA64_GPREL32MSB: rtype = R_IA64_GPREL32MSB; break; + case BFD_RELOC_IA64_GPREL32LSB: rtype = R_IA64_GPREL32LSB; break; + case BFD_RELOC_IA64_GPREL64MSB: rtype = R_IA64_GPREL64MSB; break; + case BFD_RELOC_IA64_GPREL64LSB: rtype = R_IA64_GPREL64LSB; break; + + case BFD_RELOC_IA64_LTOFF22: rtype = R_IA64_LTOFF22; break; + case BFD_RELOC_IA64_LTOFF64I: rtype = R_IA64_LTOFF64I; break; + + case BFD_RELOC_IA64_PLTOFF22: rtype = R_IA64_PLTOFF22; break; + case BFD_RELOC_IA64_PLTOFF64I: rtype = R_IA64_PLTOFF64I; break; + case BFD_RELOC_IA64_PLTOFF64MSB: rtype = R_IA64_PLTOFF64MSB; break; + case BFD_RELOC_IA64_PLTOFF64LSB: rtype = R_IA64_PLTOFF64LSB; break; + case BFD_RELOC_IA64_FPTR64I: rtype = R_IA64_FPTR64I; break; + case BFD_RELOC_IA64_FPTR32MSB: rtype = R_IA64_FPTR32MSB; break; + case BFD_RELOC_IA64_FPTR32LSB: rtype = R_IA64_FPTR32LSB; break; + case BFD_RELOC_IA64_FPTR64MSB: rtype = R_IA64_FPTR64MSB; break; + case BFD_RELOC_IA64_FPTR64LSB: rtype = R_IA64_FPTR64LSB; break; + + case BFD_RELOC_IA64_PCREL21B: rtype = R_IA64_PCREL21B; break; + case BFD_RELOC_IA64_PCREL21BI: rtype = R_IA64_PCREL21BI; break; + case BFD_RELOC_IA64_PCREL21M: rtype = R_IA64_PCREL21M; break; + case BFD_RELOC_IA64_PCREL21F: rtype = R_IA64_PCREL21F; break; + case BFD_RELOC_IA64_PCREL22: rtype = R_IA64_PCREL22; break; + case BFD_RELOC_IA64_PCREL60B: rtype = R_IA64_PCREL60B; break; + case BFD_RELOC_IA64_PCREL64I: rtype = R_IA64_PCREL64I; break; + case BFD_RELOC_IA64_PCREL32MSB: rtype = R_IA64_PCREL32MSB; break; + case BFD_RELOC_IA64_PCREL32LSB: rtype = R_IA64_PCREL32LSB; break; + case BFD_RELOC_IA64_PCREL64MSB: rtype = R_IA64_PCREL64MSB; break; + case BFD_RELOC_IA64_PCREL64LSB: rtype = R_IA64_PCREL64LSB; break; + + case BFD_RELOC_IA64_LTOFF_FPTR22: rtype = R_IA64_LTOFF_FPTR22; break; + case BFD_RELOC_IA64_LTOFF_FPTR64I: rtype = R_IA64_LTOFF_FPTR64I; break; + case BFD_RELOC_IA64_LTOFF_FPTR64MSB: rtype = R_IA64_LTOFF_FPTR64MSB; break; + case BFD_RELOC_IA64_LTOFF_FPTR64LSB: rtype = R_IA64_LTOFF_FPTR64LSB; break; + + case BFD_RELOC_IA64_SEGREL32MSB: rtype = R_IA64_SEGREL32MSB; break; + case BFD_RELOC_IA64_SEGREL32LSB: rtype = R_IA64_SEGREL32LSB; break; + case BFD_RELOC_IA64_SEGREL64MSB: rtype = R_IA64_SEGREL64MSB; break; + case BFD_RELOC_IA64_SEGREL64LSB: rtype = R_IA64_SEGREL64LSB; break; + + case BFD_RELOC_IA64_SECREL32MSB: rtype = R_IA64_SECREL32MSB; break; + case BFD_RELOC_IA64_SECREL32LSB: rtype = R_IA64_SECREL32LSB; break; + case BFD_RELOC_IA64_SECREL64MSB: rtype = R_IA64_SECREL64MSB; break; + case BFD_RELOC_IA64_SECREL64LSB: rtype = R_IA64_SECREL64LSB; break; + + case BFD_RELOC_IA64_REL32MSB: rtype = R_IA64_REL32MSB; break; + case BFD_RELOC_IA64_REL32LSB: rtype = R_IA64_REL32LSB; break; + case BFD_RELOC_IA64_REL64MSB: rtype = R_IA64_REL64MSB; break; + case BFD_RELOC_IA64_REL64LSB: rtype = R_IA64_REL64LSB; break; + + case BFD_RELOC_IA64_LTV32MSB: rtype = R_IA64_LTV32MSB; break; + case BFD_RELOC_IA64_LTV32LSB: rtype = R_IA64_LTV32LSB; break; + case BFD_RELOC_IA64_LTV64MSB: rtype = R_IA64_LTV64MSB; break; + case BFD_RELOC_IA64_LTV64LSB: rtype = R_IA64_LTV64LSB; break; + + case BFD_RELOC_IA64_IPLTMSB: rtype = R_IA64_IPLTMSB; break; + case BFD_RELOC_IA64_IPLTLSB: rtype = R_IA64_IPLTLSB; break; + case BFD_RELOC_IA64_COPY: rtype = R_IA64_COPY; break; + case BFD_RELOC_IA64_LTOFF22X: rtype = R_IA64_LTOFF22X; break; + case BFD_RELOC_IA64_LDXMOV: rtype = R_IA64_LDXMOV; break; + + case BFD_RELOC_IA64_TPREL22: rtype = R_IA64_TPREL22; break; + case BFD_RELOC_IA64_TPREL64MSB: rtype = R_IA64_TPREL64MSB; break; + case BFD_RELOC_IA64_TPREL64LSB: rtype = R_IA64_TPREL64LSB; break; + case BFD_RELOC_IA64_LTOFF_TP22: rtype = R_IA64_LTOFF_TP22; break; + + default: return 0; + } + return lookup_howto (rtype); +} + +/* Given a ELF reloc, return the matching HOWTO structure. */ + +static void +elfNN_ia64_info_to_howto (abfd, bfd_reloc, elf_reloc) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *bfd_reloc; + ElfNN_Internal_Rela *elf_reloc; +{ + bfd_reloc->howto = lookup_howto (ELFNN_R_TYPE (elf_reloc->r_info)); +} + +#define PLT_HEADER_SIZE (3 * 16) +#define PLT_MIN_ENTRY_SIZE (1 * 16) +#define PLT_FULL_ENTRY_SIZE (2 * 16) +#define PLT_RESERVED_WORDS 3 + +static const bfd_byte plt_header[PLT_HEADER_SIZE] = +{ + 0x0b, 0x10, 0x00, 0x1c, 0x00, 0x21, /* [MMI] mov r2=r14;; */ + 0xe0, 0x00, 0x08, 0x00, 0x48, 0x00, /* addl r14=0,r2 */ + 0x00, 0x00, 0x04, 0x00, /* nop.i 0x0;; */ + 0x0b, 0x80, 0x20, 0x1c, 0x18, 0x14, /* [MMI] ld8 r16=[r14],8;; */ + 0x10, 0x41, 0x38, 0x30, 0x28, 0x00, /* ld8 r17=[r14],8 */ + 0x00, 0x00, 0x04, 0x00, /* nop.i 0x0;; */ + 0x11, 0x08, 0x00, 0x1c, 0x18, 0x10, /* [MIB] ld8 r1=[r14] */ + 0x60, 0x88, 0x04, 0x80, 0x03, 0x00, /* mov b6=r17 */ + 0x60, 0x00, 0x80, 0x00 /* br.few b6;; */ +}; + +static const bfd_byte plt_min_entry[PLT_MIN_ENTRY_SIZE] = +{ + 0x11, 0x78, 0x00, 0x00, 0x00, 0x24, /* [MIB] mov r15=0 */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, /* nop.i 0x0 */ + 0x00, 0x00, 0x00, 0x40 /* br.few 0 <PLT0>;; */ +}; + +static const bfd_byte plt_full_entry[PLT_FULL_ENTRY_SIZE] = +{ + 0x0b, 0x78, 0x00, 0x02, 0x00, 0x24, /* [MMI] addl r15=0,r1;; */ + 0x00, 0x41, 0x3c, 0x30, 0x28, 0xc0, /* ld8 r16=[r15],8 */ + 0x01, 0x08, 0x00, 0x84, /* mov r14=r1;; */ + 0x11, 0x08, 0x00, 0x1e, 0x18, 0x10, /* [MIB] ld8 r1=[r15] */ + 0x60, 0x80, 0x04, 0x80, 0x03, 0x00, /* mov b6=r16 */ + 0x60, 0x00, 0x80, 0x00 /* br.few b6;; */ +}; + +#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" + +/* Select out of range branch fixup type. Note that Itanium does + not support brl, and so it gets emulated by the kernel. */ +#undef USE_BRL + +static const bfd_byte oor_brl[16] = +{ + 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* brl.sptk.few tgt;; */ + 0x00, 0x00, 0x00, 0xc0 +}; + +static const bfd_byte oor_ip[48] = +{ + 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, /* movl r15=0 */ + 0x01, 0x00, 0x00, 0x60, + 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MII] nop.m 0 */ + 0x00, 0x01, 0x00, 0x60, 0x00, 0x00, /* mov r16=ip;; */ + 0xf2, 0x80, 0x00, 0x80, /* add r16=r15,r16;; */ + 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MIB] nop.m 0 */ + 0x60, 0x80, 0x04, 0x80, 0x03, 0x00, /* mov b6=r16 */ + 0x60, 0x00, 0x80, 0x00 /* br b6;; */ +}; + +/* These functions do relaxation for IA-64 ELF. + + This is primarily to support branches to targets out of range; + relaxation of R_IA64_LTOFF22X and R_IA64_LDXMOV not yet supported. */ + +static boolean +elfNN_ia64_relax_section (abfd, sec, link_info, again) + bfd *abfd; + asection *sec; + struct bfd_link_info *link_info; + boolean *again; +{ + struct one_fixup + { + struct one_fixup *next; + asection *tsec; + bfd_vma toff; + bfd_vma trampoff; + }; + + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Rela *internal_relocs; + Elf_Internal_Rela *free_relocs = NULL; + Elf_Internal_Rela *irel, *irelend; + bfd_byte *contents; + bfd_byte *free_contents = NULL; + ElfNN_External_Sym *extsyms; + ElfNN_External_Sym *free_extsyms = NULL; + struct elfNN_ia64_link_hash_table *ia64_info; + struct one_fixup *fixups = NULL; + boolean changed_contents = false; + boolean changed_relocs = false; + + /* Assume we're not going to change any sizes, and we'll only need + one pass. */ + *again = false; + + /* Nothing to do if there are no relocations. */ + if ((sec->flags & SEC_RELOC) == 0 + || sec->reloc_count == 0) + return true; + + /* If this is the first time we have been called for this section, + initialize the cooked size. */ + if (sec->_cooked_size == 0) + sec->_cooked_size = sec->_raw_size; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + + /* Load the relocations for this section. */ + internal_relocs = (_bfd_elfNN_link_read_relocs + (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, + link_info->keep_memory)); + if (internal_relocs == NULL) + goto error_return; + + if (! link_info->keep_memory) + free_relocs = internal_relocs; + + ia64_info = elfNN_ia64_hash_table (link_info); + irelend = internal_relocs + sec->reloc_count; + + for (irel = internal_relocs; irel < irelend; irel++) + if (ELFNN_R_TYPE (irel->r_info) == (int) R_IA64_PCREL21B) + break; + + /* No branch-type relocations. */ + if (irel == irelend) + { + if (free_relocs != NULL) + free (free_relocs); + return true; + } + + /* Get the section contents. */ + if (elf_section_data (sec)->this_hdr.contents != NULL) + contents = elf_section_data (sec)->this_hdr.contents; + else + { + contents = (bfd_byte *) bfd_malloc (sec->_raw_size); + if (contents == NULL) + goto error_return; + free_contents = contents; + + if (! bfd_get_section_contents (abfd, sec, contents, + (file_ptr) 0, sec->_raw_size)) + goto error_return; + } + + /* Read this BFD's symbols. */ + if (symtab_hdr->contents != NULL) + extsyms = (ElfNN_External_Sym *) symtab_hdr->contents; + else + { + extsyms = (ElfNN_External_Sym *) bfd_malloc (symtab_hdr->sh_size); + if (extsyms == NULL) + goto error_return; + free_extsyms = extsyms; + if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 + || (bfd_read (extsyms, 1, symtab_hdr->sh_size, abfd) + != symtab_hdr->sh_size)) + goto error_return; + } + + for (; irel < irelend; irel++) + { + bfd_vma symaddr, reladdr, trampoff, toff, roff; + Elf_Internal_Sym isym; + asection *tsec; + struct one_fixup *f; + + if (ELFNN_R_TYPE (irel->r_info) != (int) R_IA64_PCREL21B) + continue; + + /* Get the value of the symbol referred to by the reloc. */ + if (ELFNN_R_SYM (irel->r_info) < symtab_hdr->sh_info) + { + /* A local symbol. */ + bfd_elfNN_swap_symbol_in (abfd, + extsyms + ELFNN_R_SYM (irel->r_info), + &isym); + if (isym.st_shndx == SHN_UNDEF) + continue; /* We can't do anthing with undefined symbols. */ + else if (isym.st_shndx == SHN_ABS) + tsec = bfd_abs_section_ptr; + else if (isym.st_shndx == SHN_COMMON) + tsec = bfd_com_section_ptr; + else if (isym.st_shndx > 0 && isym.st_shndx < SHN_LORESERVE) + tsec = bfd_section_from_elf_index (abfd, isym.st_shndx); + else + continue; /* who knows. */ + + toff = isym.st_value; + } + else + { + unsigned long indx; + struct elf_link_hash_entry *h; + struct elfNN_ia64_dyn_sym_info *dyn_i; + + indx = ELFNN_R_SYM (irel->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + BFD_ASSERT (h != NULL); + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + dyn_i = get_dyn_sym_info (ia64_info, h, abfd, irel, false); + + /* For branches to dynamic symbols, we're interested instead + in a branch to the PLT entry. */ + if (dyn_i && dyn_i->want_plt2) + { + tsec = ia64_info->plt_sec; + toff = dyn_i->plt2_offset; + } + else + { + /* We can't do anthing with undefined symbols. */ + if (h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak) + continue; + + tsec = h->root.u.def.section; + toff = h->root.u.def.value; + } + } + + symaddr = (tsec->output_section->vma + + tsec->output_offset + + toff + + irel->r_addend); + + roff = irel->r_offset; + reladdr = (sec->output_section->vma + + sec->output_offset + + roff) & -4; + + /* If the branch is in range, no need to do anything. */ + if ((bfd_signed_vma) (symaddr - reladdr) >= -0x1000000 + && (bfd_signed_vma) (symaddr - reladdr) <= 0x0FFFFF0) + continue; + + /* If the branch and target are in the same section, you've + got one honking big section and we can't help you. You'll + get an error message later. */ + if (tsec == sec) + continue; + + /* Look for an existing fixup to this address. */ + for (f = fixups; f ; f = f->next) + if (f->tsec == tsec && f->toff == toff) + break; + + if (f == NULL) + { + /* Two alternatives: If it's a branch to a PLT entry, we can + make a copy of the FULL_PLT entry. Otherwise, we'll have + to use a `brl' insn to get where we're going. */ + + int size; + + if (tsec == ia64_info->plt_sec) + size = sizeof (plt_full_entry); + else + { +#ifdef USE_BRL + size = sizeof (oor_brl); +#else + size = sizeof (oor_ip); +#endif + } + + /* Resize the current section to make room for the new branch. */ + trampoff = (sec->_cooked_size + 15) & -16; + contents = (bfd_byte *) bfd_realloc (contents, trampoff + size); + if (contents == NULL) + goto error_return; + sec->_cooked_size = trampoff + size; + + if (tsec == ia64_info->plt_sec) + { + memcpy (contents + trampoff, plt_full_entry, size); + + /* Hijack the old relocation for use as the PLTOFF reloc. */ + irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info), + R_IA64_PLTOFF22); + irel->r_offset = trampoff; + } + else + { +#ifdef USE_BRL + memcpy (contents + trampoff, oor_brl, size); + irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info), + R_IA64_PCREL60B); + irel->r_offset = trampoff + 2; +#else + memcpy (contents + trampoff, oor_ip, size); + irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info), + R_IA64_PCREL64I); + irel->r_addend -= 16; + irel->r_offset = trampoff + 2; +#endif + } + + /* Record the fixup so we don't do it again this section. */ + f = (struct one_fixup *) bfd_malloc (sizeof (*f)); + f->next = fixups; + f->tsec = tsec; + f->toff = toff; + f->trampoff = trampoff; + fixups = f; + } + else + { + /* Nop out the reloc, since we're finalizing things here. */ + irel->r_info = ELFNN_R_INFO (0, R_IA64_NONE); + } + + /* Fix up the existing branch to hit the trampoline. Hope like + hell this doesn't overflow too. */ + if (elfNN_ia64_install_value (abfd, contents + roff, + f->trampoff - (roff & -4), + R_IA64_PCREL21B) != bfd_reloc_ok) + goto error_return; + + changed_contents = true; + changed_relocs = true; + } + + /* Clean up and go home. */ + while (fixups) + { + struct one_fixup *f = fixups; + fixups = fixups->next; + free (f); + } + + if (changed_relocs) + elf_section_data (sec)->relocs = internal_relocs; + else if (free_relocs != NULL) + free (free_relocs); + + if (changed_contents) + elf_section_data (sec)->this_hdr.contents = contents; + else if (free_contents != NULL) + { + if (! link_info->keep_memory) + free (free_contents); + else + { + /* Cache the section contents for elf_link_input_bfd. */ + elf_section_data (sec)->this_hdr.contents = contents; + } + } + + if (free_extsyms != NULL) + { + if (! link_info->keep_memory) + free (free_extsyms); + else + { + /* Cache the symbols for elf_link_input_bfd. */ + symtab_hdr->contents = extsyms; + } + } + + *again = changed_contents || changed_relocs; + return true; + + error_return: + if (free_relocs != NULL) + free (free_relocs); + if (free_contents != NULL) + free (free_contents); + if (free_extsyms != NULL) + free (free_extsyms); + return false; +} + +/* Return true if NAME is an unwind table section name. */ + +static inline boolean +is_unwind_section_name (name) + const char *name; +{ + size_t len1, len2, len3; + + len1 = sizeof (ELF_STRING_ia64_unwind) - 1; + len2 = sizeof (ELF_STRING_ia64_unwind_info) - 1; + len3 = sizeof (ELF_STRING_ia64_unwind_once) - 1; + return ((strncmp (name, ELF_STRING_ia64_unwind, len1) == 0 + && strncmp (name, ELF_STRING_ia64_unwind_info, len2) != 0) + || strncmp (name, ELF_STRING_ia64_unwind_once, len3) == 0); +} + +/* Handle an IA-64 specific section when reading an object file. This + is called when elfcode.h finds a section with an unknown type. */ + +static boolean +elfNN_ia64_section_from_shdr (abfd, hdr, name) + bfd *abfd; + ElfNN_Internal_Shdr *hdr; + char *name; +{ + asection *newsect; + + /* There ought to be a place to keep ELF backend specific flags, but + at the moment there isn't one. We just keep track of the + sections by their name, instead. Fortunately, the ABI gives + suggested names for all the MIPS specific sections, so we will + probably get away with this. */ + switch (hdr->sh_type) + { + case SHT_IA_64_UNWIND: + break; + + case SHT_IA_64_EXT: + if (strcmp (name, ELF_STRING_ia64_archext) != 0) + return false; + break; + + default: + return false; + } + + if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name)) + return false; + newsect = hdr->bfd_section; + + return true; +} + +/* Convert IA-64 specific section flags to bfd internal section flags. */ + +/* ??? There is no bfd internal flag equivalent to the SHF_IA_64_NORECOV + flag. */ + +static boolean +elfNN_ia64_section_flags (flags, hdr) + flagword *flags; + ElfNN_Internal_Shdr *hdr; +{ + if (hdr->sh_flags & SHF_IA_64_SHORT) + *flags |= SEC_SMALL_DATA; + + return true; +} + +/* Set the correct type for an IA-64 ELF section. We do this by the + section name, which is a hack, but ought to work. */ + +static boolean +elfNN_ia64_fake_sections (abfd, hdr, sec) + bfd *abfd ATTRIBUTE_UNUSED; + ElfNN_Internal_Shdr *hdr; + asection *sec; +{ + register const char *name; + + name = bfd_get_section_name (abfd, sec); + + if (is_unwind_section_name (name)) + { + /* We don't have the sections numbered at this point, so sh_info + is set later, in elfNN_ia64_final_write_processing. */ + hdr->sh_type = SHT_IA_64_UNWIND; + hdr->sh_flags |= SHF_LINK_ORDER; + } + else if (strcmp (name, ELF_STRING_ia64_archext) == 0) + hdr->sh_type = SHT_IA_64_EXT; + else if (strcmp (name, ".reloc") == 0) + /* + * This is an ugly, but unfortunately necessary hack that is + * needed when producing EFI binaries on IA-64. It tells + * elf.c:elf_fake_sections() not to consider ".reloc" as a section + * containing ELF relocation info. We need this hack in order to + * be able to generate ELF binaries that can be translated into + * EFI applications (which are essentially COFF objects). Those + * files contain a COFF ".reloc" section inside an ELFNN object, + * which would normally cause BFD to segfault because it would + * attempt to interpret this section as containing relocation + * entries for section "oc". With this hack enabled, ".reloc" + * will be treated as a normal data section, which will avoid the + * segfault. However, you won't be able to create an ELFNN binary + * with a section named "oc" that needs relocations, but that's + * the kind of ugly side-effects you get when detecting section + * types based on their names... In practice, this limitation is + * unlikely to bite. + */ + hdr->sh_type = SHT_PROGBITS; + + if (sec->flags & SEC_SMALL_DATA) + hdr->sh_flags |= SHF_IA_64_SHORT; + + return true; +} + +/* The final processing done just before writing out an IA-64 ELF + object file. */ + +static void +elfNN_ia64_final_write_processing (abfd, linker) + bfd *abfd; + boolean linker ATTRIBUTE_UNUSED; +{ + Elf_Internal_Shdr *hdr; + const char *sname; + asection *text_sect, *s; + size_t len; + + for (s = abfd->sections; s; s = s->next) + { + hdr = &elf_section_data (s)->this_hdr; + switch (hdr->sh_type) + { + case SHT_IA_64_UNWIND: + /* See comments in gas/config/tc-ia64.c:dot_endp on why we + have to do this. */ + sname = bfd_get_section_name (abfd, s); + len = sizeof (ELF_STRING_ia64_unwind) - 1; + if (sname && strncmp (sname, ELF_STRING_ia64_unwind, len) == 0) + { + sname += len; + + if (sname[0] == '\0') + /* .IA_64.unwind -> .text */ + text_sect = bfd_get_section_by_name (abfd, ".text"); + else + /* .IA_64.unwindFOO -> FOO */ + text_sect = bfd_get_section_by_name (abfd, sname); + } + else if (sname + && (len = sizeof (ELF_STRING_ia64_unwind_once) - 1, + strncmp (sname, ELF_STRING_ia64_unwind_once, len)) == 0) + { + /* .gnu.linkonce.ia64unw.FOO -> .gnu.linkonce.t.FOO */ + size_t len2 = sizeof (".gnu.linkonce.t.") - 1; + char *once_name = alloca (len2 + strlen (sname) - len + 1); + + memcpy (once_name, ".gnu.linkonce.t.", len2); + strcpy (once_name + len2, sname + len); + text_sect = bfd_get_section_by_name (abfd, once_name); + } + else + /* last resort: fall back on .text */ + text_sect = bfd_get_section_by_name (abfd, ".text"); + + if (text_sect) + { + /* The IA-64 processor-specific ABI requires setting + sh_link to the unwind section, whereas HP-UX requires + sh_info to do so. For maximum compatibility, we'll + set both for now... */ + hdr->sh_link = elf_section_data (text_sect)->this_idx; + hdr->sh_info = elf_section_data (text_sect)->this_idx; + } + break; + } + } +} + +/* Hook called by the linker routine which adds symbols from an object + file. We use it to put .comm items in .sbss, and not .bss. */ + +static boolean +elfNN_ia64_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) + bfd *abfd; + struct bfd_link_info *info; + const Elf_Internal_Sym *sym; + const char **namep ATTRIBUTE_UNUSED; + flagword *flagsp ATTRIBUTE_UNUSED; + asection **secp; + bfd_vma *valp; +{ + if (sym->st_shndx == SHN_COMMON + && !info->relocateable + && sym->st_size <= (unsigned) bfd_get_gp_size (abfd)) + { + /* Common symbols less than or equal to -G nn bytes are + automatically put into .sbss. */ + + asection *scomm = bfd_get_section_by_name (abfd, ".scommon"); + + if (scomm == NULL) + { + scomm = bfd_make_section (abfd, ".scommon"); + if (scomm == NULL + || !bfd_set_section_flags (abfd, scomm, (SEC_ALLOC + | SEC_IS_COMMON + | SEC_LINKER_CREATED))) + return false; + } + + *secp = scomm; + *valp = sym->st_size; + } + + return true; +} + +/* Return the number of additional phdrs we will need. */ + +static int +elfNN_ia64_additional_program_headers (abfd) + bfd *abfd; +{ + asection *s; + int ret = 0; + + /* See if we need a PT_IA_64_ARCHEXT segment. */ + s = bfd_get_section_by_name (abfd, ELF_STRING_ia64_archext); + if (s && (s->flags & SEC_LOAD)) + ++ret; + + /* Count how many PT_IA_64_UNWIND segments we need. */ + for (s = abfd->sections; s; s = s->next) + if (is_unwind_section_name(s->name) && (s->flags & SEC_LOAD)) + ++ret; + + return ret; +} + +static boolean +elfNN_ia64_modify_segment_map (abfd) + bfd *abfd; +{ + struct elf_segment_map *m, **pm; + Elf_Internal_Shdr *hdr; + asection *s; + + /* If we need a PT_IA_64_ARCHEXT segment, it must come before + all PT_LOAD segments. */ + s = bfd_get_section_by_name (abfd, ELF_STRING_ia64_archext); + if (s && (s->flags & SEC_LOAD)) + { + for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + if (m->p_type == PT_IA_64_ARCHEXT) + break; + if (m == NULL) + { + m = (struct elf_segment_map *) bfd_zalloc (abfd, sizeof *m); + if (m == NULL) + return false; + + m->p_type = PT_IA_64_ARCHEXT; + m->count = 1; + m->sections[0] = s; + + /* We want to put it after the PHDR and INTERP segments. */ + pm = &elf_tdata (abfd)->segment_map; + while (*pm != NULL + && ((*pm)->p_type == PT_PHDR + || (*pm)->p_type == PT_INTERP)) + pm = &(*pm)->next; + + m->next = *pm; + *pm = m; + } + } + + /* Install PT_IA_64_UNWIND segments, if needed. */ + for (s = abfd->sections; s; s = s->next) + { + hdr = &elf_section_data (s)->this_hdr; + if (hdr->sh_type != SHT_IA_64_UNWIND) + continue; + + if (s && (s->flags & SEC_LOAD)) + { + for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + if (m->p_type == PT_IA_64_UNWIND && m->sections[0] == s) + break; + + if (m == NULL) + { + m = (struct elf_segment_map *) bfd_zalloc (abfd, sizeof *m); + if (m == NULL) + return false; + + m->p_type = PT_IA_64_UNWIND; + m->count = 1; + m->sections[0] = s; + m->next = NULL; + + /* We want to put it last. */ + pm = &elf_tdata (abfd)->segment_map; + while (*pm != NULL) + pm = &(*pm)->next; + *pm = m; + } + } + } + + /* Turn on PF_IA_64_NORECOV if needed. This involves traversing all of + the input sections for each output section in the segment and testing + for SHF_IA_64_NORECOV on each. */ + for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + if (m->p_type == PT_LOAD) + { + int i; + for (i = m->count - 1; i >= 0; --i) + { + struct bfd_link_order *order = m->sections[i]->link_order_head; + while (order) + { + if (order->type == bfd_indirect_link_order) + { + asection *is = order->u.indirect.section; + bfd_vma flags = elf_section_data(is)->this_hdr.sh_flags; + if (flags & SHF_IA_64_NORECOV) + { + m->p_flags |= PF_IA_64_NORECOV; + goto found; + } + } + order = order->next; + } + } + found:; + } + + return true; +} + +/* According to the Tahoe assembler spec, all labels starting with a + '.' are local. */ + +static boolean +elfNN_ia64_is_local_label_name (abfd, name) + bfd *abfd ATTRIBUTE_UNUSED; + const char *name; +{ + return name[0] == '.'; +} + +/* Should we do dynamic things to this symbol? */ + +static boolean +elfNN_ia64_dynamic_symbol_p (h, info) + struct elf_link_hash_entry *h; + struct bfd_link_info *info; +{ + if (h == NULL) + return false; + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (h->dynindx == -1) + return false; + switch (ELF_ST_VISIBILITY (h->other)) + { + case STV_INTERNAL: + case STV_HIDDEN: + return false; + } + + if (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_defweak) + return true; + + if ((info->shared && !info->symbolic) + || ((h->elf_link_hash_flags + & (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)) + == (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR))) + return true; + + return false; +} + +static boolean +elfNN_ia64_local_hash_table_init (ht, abfd, new) + struct elfNN_ia64_local_hash_table *ht; + bfd *abfd ATTRIBUTE_UNUSED; + new_hash_entry_func new; +{ + memset (ht, 0, sizeof (*ht)); + return bfd_hash_table_init (&ht->root, new); +} + +static struct bfd_hash_entry* +elfNN_ia64_new_loc_hash_entry (entry, table, string) + struct bfd_hash_entry *entry; + struct bfd_hash_table *table; + const char *string; +{ + struct elfNN_ia64_local_hash_entry *ret; + ret = (struct elfNN_ia64_local_hash_entry *) entry; + + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (!ret) + ret = bfd_hash_allocate (table, sizeof (*ret)); + + if (!ret) + return 0; + + /* Initialize our local data. All zeros, and definitely easier + than setting a handful of bit fields. */ + memset (ret, 0, sizeof (*ret)); + + /* Call the allocation method of the superclass. */ + ret = ((struct elfNN_ia64_local_hash_entry *) + bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string)); + + return (struct bfd_hash_entry *) ret; +} + +static struct bfd_hash_entry* +elfNN_ia64_new_elf_hash_entry (entry, table, string) + struct bfd_hash_entry *entry; + struct bfd_hash_table *table; + const char *string; +{ + struct elfNN_ia64_link_hash_entry *ret; + ret = (struct elfNN_ia64_link_hash_entry *) entry; + + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (!ret) + ret = bfd_hash_allocate (table, sizeof (*ret)); + + if (!ret) + return 0; + + /* Initialize our local data. All zeros, and definitely easier + than setting a handful of bit fields. */ + memset (ret, 0, sizeof (*ret)); + + /* Call the allocation method of the superclass. */ + ret = ((struct elfNN_ia64_link_hash_entry *) + _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret, + table, string)); + + return (struct bfd_hash_entry *) ret; +} + +static void +elfNN_ia64_hash_copy_indirect (xdir, xind) + struct elf_link_hash_entry *xdir, *xind; +{ + struct elfNN_ia64_link_hash_entry *dir, *ind; + + dir = (struct elfNN_ia64_link_hash_entry *)xdir; + ind = (struct elfNN_ia64_link_hash_entry *)xind; + + /* Copy down any references that we may have already seen to the + symbol which just became indirect. */ + + dir->root.elf_link_hash_flags |= + (ind->root.elf_link_hash_flags + & (ELF_LINK_HASH_REF_DYNAMIC + | ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK)); + + /* Copy over the got and plt data. This would have been done + by check_relocs. */ + + if (dir->info == NULL) + { + struct elfNN_ia64_dyn_sym_info *dyn_i; + + dir->info = dyn_i = ind->info; + ind->info = NULL; + + /* Fix up the dyn_sym_info pointers to the global symbol. */ + for (; dyn_i; dyn_i = dyn_i->next) + dyn_i->h = &dir->root; + } + BFD_ASSERT (ind->info == NULL); + + /* Copy over the dynindx. */ + + if (dir->root.dynindx == -1) + { + dir->root.dynindx = ind->root.dynindx; + dir->root.dynstr_index = ind->root.dynstr_index; + ind->root.dynindx = -1; + ind->root.dynstr_index = 0; + } + BFD_ASSERT (ind->root.dynindx == -1); +} + +static void +elfNN_ia64_hash_hide_symbol (info, xh) + struct bfd_link_info *info ATTRIBUTE_UNUSED; + struct elf_link_hash_entry *xh; +{ + struct elfNN_ia64_link_hash_entry *h; + struct elfNN_ia64_dyn_sym_info *dyn_i; + + h = (struct elfNN_ia64_link_hash_entry *)xh; + + h->root.elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + if ((h->root.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0) + h->root.dynindx = -1; + + for (dyn_i = h->info; dyn_i; dyn_i = dyn_i->next) + dyn_i->want_plt2 = 0; +} + +/* Create the derived linker hash table. The IA-64 ELF port uses this + derived hash table to keep information specific to the IA-64 ElF + linker (without using static variables). */ + +static struct bfd_link_hash_table* +elfNN_ia64_hash_table_create (abfd) + bfd *abfd; +{ + struct elfNN_ia64_link_hash_table *ret; + + ret = bfd_alloc (abfd, sizeof (*ret)); + if (!ret) + return 0; + if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, + elfNN_ia64_new_elf_hash_entry)) + { + bfd_release (abfd, ret); + return 0; + } + + if (!elfNN_ia64_local_hash_table_init (&ret->loc_hash_table, abfd, + elfNN_ia64_new_loc_hash_entry)) + return 0; + return &ret->root.root; +} + +/* Look up an entry in a Alpha ELF linker hash table. */ + +static INLINE struct elfNN_ia64_local_hash_entry * +elfNN_ia64_local_hash_lookup(table, string, create, copy) + struct elfNN_ia64_local_hash_table *table; + const char *string; + boolean create, copy; +{ + return ((struct elfNN_ia64_local_hash_entry *) + bfd_hash_lookup (&table->root, string, create, copy)); +} + +/* Traverse both local and global hash tables. */ + +struct elfNN_ia64_dyn_sym_traverse_data +{ + boolean (*func) PARAMS ((struct elfNN_ia64_dyn_sym_info *, PTR)); + PTR data; +}; + +static boolean +elfNN_ia64_global_dyn_sym_thunk (xentry, xdata) + struct bfd_hash_entry *xentry; + PTR xdata; +{ + struct elfNN_ia64_link_hash_entry *entry + = (struct elfNN_ia64_link_hash_entry *) xentry; + struct elfNN_ia64_dyn_sym_traverse_data *data + = (struct elfNN_ia64_dyn_sym_traverse_data *) xdata; + struct elfNN_ia64_dyn_sym_info *dyn_i; + + for (dyn_i = entry->info; dyn_i; dyn_i = dyn_i->next) + if (! (*data->func) (dyn_i, data->data)) + return false; + return true; +} + +static boolean +elfNN_ia64_local_dyn_sym_thunk (xentry, xdata) + struct bfd_hash_entry *xentry; + PTR xdata; +{ + struct elfNN_ia64_local_hash_entry *entry + = (struct elfNN_ia64_local_hash_entry *) xentry; + struct elfNN_ia64_dyn_sym_traverse_data *data + = (struct elfNN_ia64_dyn_sym_traverse_data *) xdata; + struct elfNN_ia64_dyn_sym_info *dyn_i; + + for (dyn_i = entry->info; dyn_i; dyn_i = dyn_i->next) + if (! (*data->func) (dyn_i, data->data)) + return false; + return true; +} + +static void +elfNN_ia64_dyn_sym_traverse (ia64_info, func, data) + struct elfNN_ia64_link_hash_table *ia64_info; + boolean (*func) PARAMS ((struct elfNN_ia64_dyn_sym_info *, PTR)); + PTR data; +{ + struct elfNN_ia64_dyn_sym_traverse_data xdata; + + xdata.func = func; + xdata.data = data; + + elf_link_hash_traverse (&ia64_info->root, + elfNN_ia64_global_dyn_sym_thunk, &xdata); + bfd_hash_traverse (&ia64_info->loc_hash_table.root, + elfNN_ia64_local_dyn_sym_thunk, &xdata); +} + +static boolean +elfNN_ia64_create_dynamic_sections (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + struct elfNN_ia64_link_hash_table *ia64_info; + asection *s; + + if (! _bfd_elf_create_dynamic_sections (abfd, info)) + return false; + + ia64_info = elfNN_ia64_hash_table (info); + + ia64_info->plt_sec = bfd_get_section_by_name (abfd, ".plt"); + ia64_info->got_sec = bfd_get_section_by_name (abfd, ".got"); + + { + flagword flags = bfd_get_section_flags (abfd, ia64_info->got_sec); + bfd_set_section_flags (abfd, ia64_info->got_sec, SEC_SMALL_DATA | flags); + } + + if (!get_pltoff (abfd, info, ia64_info)) + return false; + + s = bfd_make_section(abfd, ".rela.IA_64.pltoff"); + if (s == NULL + || !bfd_set_section_flags (abfd, s, (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED + | SEC_READONLY)) + || !bfd_set_section_alignment (abfd, s, 3)) + return false; + ia64_info->rel_pltoff_sec = s; + + s = bfd_make_section(abfd, ".rela.got"); + if (s == NULL + || !bfd_set_section_flags (abfd, s, (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED + | SEC_READONLY)) + || !bfd_set_section_alignment (abfd, s, 3)) + return false; + ia64_info->rel_got_sec = s; + + return true; +} + +/* Find and/or create a descriptor for dynamic symbol info. This will + vary based on global or local symbol, and the addend to the reloc. */ + +static struct elfNN_ia64_dyn_sym_info * +get_dyn_sym_info (ia64_info, h, abfd, rel, create) + struct elfNN_ia64_link_hash_table *ia64_info; + struct elf_link_hash_entry *h; + bfd *abfd; + const Elf_Internal_Rela *rel; + boolean create; +{ + struct elfNN_ia64_dyn_sym_info **pp; + struct elfNN_ia64_dyn_sym_info *dyn_i; + bfd_vma addend = rel ? rel->r_addend : 0; + + if (h) + pp = &((struct elfNN_ia64_link_hash_entry *)h)->info; + else + { + struct elfNN_ia64_local_hash_entry *loc_h; + char *addr_name; + size_t len; + + /* Construct a string for use in the elfNN_ia64_local_hash_table. + The name describes what was once anonymous memory. */ + + len = sizeof (void*)*2 + 1 + sizeof (bfd_vma)*4 + 1 + 1; + len += 10; /* %p slop */ + + addr_name = alloca (len); + sprintf (addr_name, "%p:%lx", (void *) abfd, ELFNN_R_SYM (rel->r_info)); + + /* Collect the canonical entry data for this address. */ + loc_h = elfNN_ia64_local_hash_lookup (&ia64_info->loc_hash_table, + addr_name, create, create); + BFD_ASSERT (loc_h); + + pp = &loc_h->info; + } + + for (dyn_i = *pp; dyn_i && dyn_i->addend != addend; dyn_i = *pp) + pp = &dyn_i->next; + + if (dyn_i == NULL && create) + { + dyn_i = (struct elfNN_ia64_dyn_sym_info *) + bfd_zalloc (abfd, sizeof *dyn_i); + *pp = dyn_i; + dyn_i->addend = addend; + } + + return dyn_i; +} + +static asection * +get_got (abfd, info, ia64_info) + bfd *abfd; + struct bfd_link_info *info; + struct elfNN_ia64_link_hash_table *ia64_info; +{ + asection *got; + bfd *dynobj; + + got = ia64_info->got_sec; + if (!got) + { + flagword flags; + + dynobj = ia64_info->root.dynobj; + if (!dynobj) + ia64_info->root.dynobj = dynobj = abfd; + if (!_bfd_elf_create_got_section (dynobj, info)) + return 0; + + got = bfd_get_section_by_name (dynobj, ".got"); + BFD_ASSERT (got); + ia64_info->got_sec = got; + + flags = bfd_get_section_flags (abfd, got); + bfd_set_section_flags (abfd, got, SEC_SMALL_DATA | flags); + } + + return got; +} + +/* Create function descriptor section (.opd). This section is called .opd + because it contains "official prodecure descriptors". The "official" + refers to the fact that these descriptors are used when taking the address + of a procedure, thus ensuring a unique address for each procedure. */ + +static asection * +get_fptr (abfd, info, ia64_info) + bfd *abfd; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + struct elfNN_ia64_link_hash_table *ia64_info; +{ + asection *fptr; + bfd *dynobj; + + fptr = ia64_info->fptr_sec; + if (!fptr) + { + dynobj = ia64_info->root.dynobj; + if (!dynobj) + ia64_info->root.dynobj = dynobj = abfd; + + fptr = bfd_make_section (dynobj, ".opd"); + if (!fptr + || !bfd_set_section_flags (dynobj, fptr, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_READONLY + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, fptr, 4)) + { + BFD_ASSERT (0); + return NULL; + } + + ia64_info->fptr_sec = fptr; + } + + return fptr; +} + +static asection * +get_pltoff (abfd, info, ia64_info) + bfd *abfd; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + struct elfNN_ia64_link_hash_table *ia64_info; +{ + asection *pltoff; + bfd *dynobj; + + pltoff = ia64_info->pltoff_sec; + if (!pltoff) + { + dynobj = ia64_info->root.dynobj; + if (!dynobj) + ia64_info->root.dynobj = dynobj = abfd; + + pltoff = bfd_make_section (dynobj, ELF_STRING_ia64_pltoff); + if (!pltoff + || !bfd_set_section_flags (dynobj, pltoff, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_SMALL_DATA + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, pltoff, 4)) + { + BFD_ASSERT (0); + return NULL; + } + + ia64_info->pltoff_sec = pltoff; + } + + return pltoff; +} + +static asection * +get_reloc_section (abfd, ia64_info, sec, create) + bfd *abfd; + struct elfNN_ia64_link_hash_table *ia64_info; + asection *sec; + boolean create; +{ + const char *srel_name; + asection *srel; + bfd *dynobj; + + srel_name = (bfd_elf_string_from_elf_section + (abfd, elf_elfheader(abfd)->e_shstrndx, + elf_section_data(sec)->rel_hdr.sh_name)); + if (srel_name == NULL) + return NULL; + + BFD_ASSERT ((strncmp (srel_name, ".rela", 5) == 0 + && strcmp (bfd_get_section_name (abfd, sec), + srel_name+5) == 0) + || (strncmp (srel_name, ".rel", 4) == 0 + && strcmp (bfd_get_section_name (abfd, sec), + srel_name+4) == 0)); + + dynobj = ia64_info->root.dynobj; + if (!dynobj) + ia64_info->root.dynobj = dynobj = abfd; + + srel = bfd_get_section_by_name (dynobj, srel_name); + if (srel == NULL && create) + { + srel = bfd_make_section (dynobj, srel_name); + if (srel == NULL + || !bfd_set_section_flags (dynobj, srel, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED + | SEC_READONLY)) + || !bfd_set_section_alignment (dynobj, srel, 3)) + return NULL; + } + + return srel; +} + +static boolean +count_dyn_reloc (abfd, dyn_i, srel, type) + bfd *abfd; + struct elfNN_ia64_dyn_sym_info *dyn_i; + asection *srel; + int type; +{ + struct elfNN_ia64_dyn_reloc_entry *rent; + + for (rent = dyn_i->reloc_entries; rent; rent = rent->next) + if (rent->srel == srel && rent->type == type) + break; + + if (!rent) + { + rent = (struct elfNN_ia64_dyn_reloc_entry *) + bfd_alloc (abfd, sizeof (*rent)); + if (!rent) + return false; + + rent->next = dyn_i->reloc_entries; + rent->srel = srel; + rent->type = type; + rent->count = 0; + dyn_i->reloc_entries = rent; + } + rent->count++; + + return true; +} + +static boolean +elfNN_ia64_check_relocs (abfd, info, sec, relocs) + bfd *abfd; + struct bfd_link_info *info; + asection *sec; + const Elf_Internal_Rela *relocs; +{ + struct elfNN_ia64_link_hash_table *ia64_info; + const Elf_Internal_Rela *relend; + Elf_Internal_Shdr *symtab_hdr; + const Elf_Internal_Rela *rel; + asection *got, *fptr, *srel; + + if (info->relocateable) + return true; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + ia64_info = elfNN_ia64_hash_table (info); + + got = fptr = srel = NULL; + + relend = relocs + sec->reloc_count; + for (rel = relocs; rel < relend; ++rel) + { + enum { + NEED_GOT = 1, + NEED_FPTR = 2, + NEED_PLTOFF = 4, + NEED_MIN_PLT = 8, + NEED_FULL_PLT = 16, + NEED_DYNREL = 32, + NEED_LTOFF_FPTR = 64, + }; + + struct elf_link_hash_entry *h = NULL; + unsigned long r_symndx = ELFNN_R_SYM (rel->r_info); + struct elfNN_ia64_dyn_sym_info *dyn_i; + int need_entry; + boolean maybe_dynamic; + int dynrel_type = R_IA64_NONE; + + if (r_symndx >= symtab_hdr->sh_info) + { + /* We're dealing with a global symbol -- find its hash entry + and mark it as being referenced. */ + long indx = r_symndx - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR; + } + + /* We can only get preliminary data on whether a symbol is + locally or externally defined, as not all of the input files + have yet been processed. Do something with what we know, as + this may help reduce memory usage and processing time later. */ + maybe_dynamic = false; + if (h && ((info->shared && ! info->symbolic) + || ! (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) + || h->root.type == bfd_link_hash_defweak)) + maybe_dynamic = true; + + need_entry = 0; + switch (ELFNN_R_TYPE (rel->r_info)) + { + case R_IA64_TPREL22: + case R_IA64_TPREL64MSB: + case R_IA64_TPREL64LSB: + case R_IA64_LTOFF_TP22: + return false; + + case R_IA64_LTOFF_FPTR22: + case R_IA64_LTOFF_FPTR64I: + case R_IA64_LTOFF_FPTR64MSB: + case R_IA64_LTOFF_FPTR64LSB: + need_entry = NEED_FPTR | NEED_GOT | NEED_LTOFF_FPTR; + break; + + case R_IA64_FPTR64I: + case R_IA64_FPTR32MSB: + case R_IA64_FPTR32LSB: + case R_IA64_FPTR64MSB: + case R_IA64_FPTR64LSB: + if (info->shared || h) + need_entry = NEED_FPTR | NEED_DYNREL; + else + need_entry = NEED_FPTR; + dynrel_type = R_IA64_FPTR64LSB; + break; + + case R_IA64_LTOFF22: + case R_IA64_LTOFF22X: + case R_IA64_LTOFF64I: + need_entry = NEED_GOT; + break; + + case R_IA64_PLTOFF22: + case R_IA64_PLTOFF64I: + case R_IA64_PLTOFF64MSB: + case R_IA64_PLTOFF64LSB: + need_entry = NEED_PLTOFF; + if (h) + { + if (maybe_dynamic) + need_entry |= NEED_MIN_PLT; + } + else + { + (*info->callbacks->warning) + (info, _("@pltoff reloc against local symbol"), 0, + abfd, 0, 0); + } + break; + + case R_IA64_PCREL21B: + case R_IA64_PCREL60B: + /* Depending on where this symbol is defined, we may or may not + need a full plt entry. Only skip if we know we'll not need + the entry -- static or symbolic, and the symbol definition + has already been seen. */ + if (maybe_dynamic && rel->r_addend == 0) + need_entry = NEED_FULL_PLT; + break; + + case R_IA64_IMM14: + case R_IA64_IMM22: + case R_IA64_IMM64: + case R_IA64_DIR32MSB: + case R_IA64_DIR32LSB: + case R_IA64_DIR64MSB: + case R_IA64_DIR64LSB: + /* Shared objects will always need at least a REL relocation. */ + if (info->shared || maybe_dynamic) + need_entry = NEED_DYNREL; + dynrel_type = R_IA64_DIR64LSB; + break; + + case R_IA64_IPLTMSB: + case R_IA64_IPLTLSB: + /* Shared objects will always need at least a REL relocation. */ + if (info->shared || maybe_dynamic) + need_entry = NEED_DYNREL; + dynrel_type = R_IA64_IPLTLSB; + break; + + case R_IA64_PCREL22: + case R_IA64_PCREL64I: + case R_IA64_PCREL32MSB: + case R_IA64_PCREL32LSB: + case R_IA64_PCREL64MSB: + case R_IA64_PCREL64LSB: + if (maybe_dynamic) + need_entry = NEED_DYNREL; + dynrel_type = R_IA64_PCREL64LSB; + break; + } + + if (!need_entry) + continue; + + if ((need_entry & NEED_FPTR) != 0 + && rel->r_addend) + { + (*info->callbacks->warning) + (info, _("non-zero addend in @fptr reloc"), 0, + abfd, 0, 0); + } + + dyn_i = get_dyn_sym_info (ia64_info, h, abfd, rel, true); + + /* Record whether or not this is a local symbol. */ + dyn_i->h = h; + + /* Create what's needed. */ + if (need_entry & NEED_GOT) + { + if (!got) + { + got = get_got (abfd, info, ia64_info); + if (!got) + return false; + } + dyn_i->want_got = 1; + } + if (need_entry & NEED_FPTR) + { + if (!fptr) + { + fptr = get_fptr (abfd, info, ia64_info); + if (!fptr) + return false; + } + + /* FPTRs for shared libraries are allocated by the dynamic + linker. Make sure this local symbol will appear in the + dynamic symbol table. */ + if (!h && info->shared) + { + if (! (_bfd_elfNN_link_record_local_dynamic_symbol + (info, abfd, r_symndx))) + return false; + } + + dyn_i->want_fptr = 1; + } + if (need_entry & NEED_LTOFF_FPTR) + dyn_i->want_ltoff_fptr = 1; + if (need_entry & (NEED_MIN_PLT | NEED_FULL_PLT)) + { + if (!ia64_info->root.dynobj) + ia64_info->root.dynobj = abfd; + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + dyn_i->want_plt = 1; + } + if (need_entry & NEED_FULL_PLT) + dyn_i->want_plt2 = 1; + if (need_entry & NEED_PLTOFF) + dyn_i->want_pltoff = 1; + if ((need_entry & NEED_DYNREL) && (sec->flags & SEC_ALLOC)) + { + if (!srel) + { + srel = get_reloc_section (abfd, ia64_info, sec, true); + if (!srel) + return false; + } + if (!count_dyn_reloc (abfd, dyn_i, srel, dynrel_type)) + return false; + } + } + + return true; +} + +struct elfNN_ia64_allocate_data +{ + struct bfd_link_info *info; + bfd_size_type ofs; +}; + +/* For cleanliness, and potentially faster dynamic loading, allocate + external GOT entries first. */ + +static boolean +allocate_global_data_got (dyn_i, data) + struct elfNN_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data; + + if (dyn_i->want_got + && ! dyn_i->want_fptr + && elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info)) + { + dyn_i->got_offset = x->ofs; + x->ofs += 8; + } + return true; +} + +/* Next, allocate all the GOT entries used by LTOFF_FPTR relocs. */ + +static boolean +allocate_global_fptr_got (dyn_i, data) + struct elfNN_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data; + + if (dyn_i->want_got + && dyn_i->want_fptr + && elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info)) + { + dyn_i->got_offset = x->ofs; + x->ofs += 8; + } + return true; +} + +/* Lastly, allocate all the GOT entries for local data. */ + +static boolean +allocate_local_got (dyn_i, data) + struct elfNN_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data; + + if (dyn_i->want_got + && ! elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info)) + { + dyn_i->got_offset = x->ofs; + x->ofs += 8; + } + return true; +} + +/* Search for the index of a global symbol in it's defining object file. */ + +static unsigned long +global_sym_index (h) + struct elf_link_hash_entry *h; +{ + struct elf_link_hash_entry **p; + bfd *obj; + + BFD_ASSERT (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak); + + obj = h->root.u.def.section->owner; + for (p = elf_sym_hashes (obj); *p != h; ++p) + continue; + + return p - elf_sym_hashes (obj) + elf_tdata (obj)->symtab_hdr.sh_info; +} + +/* Allocate function descriptors. We can do these for every function + in a main executable that is not exported. */ + +static boolean +allocate_fptr (dyn_i, data) + struct elfNN_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data; + + if (dyn_i->want_fptr) + { + struct elf_link_hash_entry *h = dyn_i->h; + + if (h) + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (x->info->shared) + { + if (h && h->dynindx == -1) + { + BFD_ASSERT ((h->root.type == bfd_link_hash_defined) + || (h->root.type == bfd_link_hash_defweak)); + + if (!_bfd_elfNN_link_record_local_dynamic_symbol + (x->info, h->root.u.def.section->owner, + global_sym_index (h))) + return false; + } + + dyn_i->want_fptr = 0; + } + else if (h == NULL || h->dynindx == -1) + { + dyn_i->fptr_offset = x->ofs; + x->ofs += 16; + } + else + dyn_i->want_fptr = 0; + } + return true; +} + +/* Allocate all the minimal PLT entries. */ + +static boolean +allocate_plt_entries (dyn_i, data) + struct elfNN_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data; + + if (dyn_i->want_plt) + { + struct elf_link_hash_entry *h = dyn_i->h; + + if (h) + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + /* ??? Versioned symbols seem to lose ELF_LINK_HASH_NEEDS_PLT. */ + if (elfNN_ia64_dynamic_symbol_p (h, x->info)) + { + bfd_size_type offset = x->ofs; + if (offset == 0) + offset = PLT_HEADER_SIZE; + dyn_i->plt_offset = offset; + x->ofs = offset + PLT_MIN_ENTRY_SIZE; + + dyn_i->want_pltoff = 1; + } + else + { + dyn_i->want_plt = 0; + dyn_i->want_plt2 = 0; + } + } + return true; +} + +/* Allocate all the full PLT entries. */ + +static boolean +allocate_plt2_entries (dyn_i, data) + struct elfNN_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data; + + if (dyn_i->want_plt2) + { + struct elf_link_hash_entry *h = dyn_i->h; + bfd_size_type ofs = x->ofs; + + dyn_i->plt2_offset = ofs; + x->ofs = ofs + PLT_FULL_ENTRY_SIZE; + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + dyn_i->h->plt.offset = ofs; + } + return true; +} + +/* Allocate all the PLTOFF entries requested by relocations and + plt entries. We can't share space with allocated FPTR entries, + because the latter are not necessarily addressable by the GP. + ??? Relaxation might be able to determine that they are. */ + +static boolean +allocate_pltoff_entries (dyn_i, data) + struct elfNN_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data; + + if (dyn_i->want_pltoff) + { + dyn_i->pltoff_offset = x->ofs; + x->ofs += 16; + } + return true; +} + +/* Allocate dynamic relocations for those symbols that turned out + to be dynamic. */ + +static boolean +allocate_dynrel_entries (dyn_i, data) + struct elfNN_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data; + struct elfNN_ia64_link_hash_table *ia64_info; + struct elfNN_ia64_dyn_reloc_entry *rent; + boolean dynamic_symbol, shared; + + ia64_info = elfNN_ia64_hash_table (x->info); + dynamic_symbol = elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info); + shared = x->info->shared; + + /* Take care of the normal data relocations. */ + + for (rent = dyn_i->reloc_entries; rent; rent = rent->next) + { + int count = rent->count; + + switch (rent->type) + { + case R_IA64_FPTR64LSB: + /* Allocate one iff !want_fptr, which by this point will + be true only if we're actually allocating one statically + in the main executable. */ + if (dyn_i->want_fptr) + continue; + break; + case R_IA64_PCREL64LSB: + if (!dynamic_symbol) + continue; + break; + case R_IA64_DIR64LSB: + if (!dynamic_symbol && !shared) + continue; + break; + case R_IA64_IPLTLSB: + if (!dynamic_symbol && !shared) + continue; + /* Use two REL relocations for IPLT relocations + against local symbols. */ + if (!dynamic_symbol) + count *= 2; + break; + default: + abort (); + } + rent->srel->_raw_size += sizeof (ElfNN_External_Rela) * count; + } + + /* Take care of the GOT and PLT relocations. */ + + if (((dynamic_symbol || shared) && dyn_i->want_got) + || (dyn_i->want_ltoff_fptr && dyn_i->h && dyn_i->h->dynindx != -1)) + ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela); + + if (dyn_i->want_pltoff) + { + bfd_size_type t = 0; + + /* Dynamic symbols get one IPLT relocation. Local symbols in + shared libraries get two REL relocations. Local symbols in + main applications get nothing. */ + if (dynamic_symbol) + t = sizeof (ElfNN_External_Rela); + else if (shared) + t = 2 * sizeof (ElfNN_External_Rela); + + ia64_info->rel_pltoff_sec->_raw_size += t; + } + + return true; +} + +static boolean +elfNN_ia64_adjust_dynamic_symbol (info, h) + struct bfd_link_info *info ATTRIBUTE_UNUSED; + struct elf_link_hash_entry *h; +{ + /* ??? Undefined symbols with PLT entries should be re-defined + to be the PLT entry. */ + + /* If this is a weak symbol, and there is a real definition, the + processor independent code will have arranged for us to see the + real definition first, and we can just use the same value. */ + if (h->weakdef != NULL) + { + BFD_ASSERT (h->weakdef->root.type == bfd_link_hash_defined + || h->weakdef->root.type == bfd_link_hash_defweak); + h->root.u.def.section = h->weakdef->root.u.def.section; + h->root.u.def.value = h->weakdef->root.u.def.value; + return true; + } + + /* If this is a reference to a symbol defined by a dynamic object which + is not a function, we might allocate the symbol in our .dynbss section + and allocate a COPY dynamic relocation. + + But IA-64 code is canonically PIC, so as a rule we can avoid this sort + of hackery. */ + + return true; +} + +static boolean +elfNN_ia64_size_dynamic_sections (output_bfd, info) + bfd *output_bfd; + struct bfd_link_info *info; +{ + struct elfNN_ia64_allocate_data data; + struct elfNN_ia64_link_hash_table *ia64_info; + asection *sec; + bfd *dynobj; + boolean reltext = false; + boolean relplt = false; + + dynobj = elf_hash_table(info)->dynobj; + ia64_info = elfNN_ia64_hash_table (info); + BFD_ASSERT(dynobj != NULL); + data.info = info; + + /* Set the contents of the .interp section to the interpreter. */ + if (ia64_info->root.dynamic_sections_created + && !info->shared) + { + sec = bfd_get_section_by_name (dynobj, ".interp"); + BFD_ASSERT (sec != NULL); + sec->contents = (bfd_byte *) ELF_DYNAMIC_INTERPRETER; + sec->_raw_size = strlen (ELF_DYNAMIC_INTERPRETER) + 1; + } + + /* Allocate the GOT entries. */ + + if (ia64_info->got_sec) + { + data.ofs = 0; + elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_global_data_got, &data); + elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_global_fptr_got, &data); + elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_local_got, &data); + ia64_info->got_sec->_raw_size = data.ofs; + } + + /* Allocate the FPTR entries. */ + + if (ia64_info->fptr_sec) + { + data.ofs = 0; + elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_fptr, &data); + ia64_info->fptr_sec->_raw_size = data.ofs; + } + + /* Now that we've seen all of the input files, we can decide which + symbols need plt entries. Allocate the minimal PLT entries first. + We do this even though dynamic_sections_created may be false, because + this has the side-effect of clearing want_plt and want_plt2. */ + + data.ofs = 0; + elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_plt_entries, &data); + + ia64_info->minplt_entries = 0; + if (data.ofs) + { + ia64_info->minplt_entries + = (data.ofs - PLT_HEADER_SIZE) / PLT_MIN_ENTRY_SIZE; + } + + /* Align the pointer for the plt2 entries. */ + data.ofs = (data.ofs + 31) & -32; + + elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_plt2_entries, &data); + if (data.ofs != 0) + { + BFD_ASSERT (ia64_info->root.dynamic_sections_created); + + ia64_info->plt_sec->_raw_size = data.ofs; + + /* If we've got a .plt, we need some extra memory for the dynamic + linker. We stuff these in .got.plt. */ + sec = bfd_get_section_by_name (dynobj, ".got.plt"); + sec->_raw_size = 8 * PLT_RESERVED_WORDS; + } + + /* Allocate the PLTOFF entries. */ + + if (ia64_info->pltoff_sec) + { + data.ofs = 0; + elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_pltoff_entries, &data); + ia64_info->pltoff_sec->_raw_size = data.ofs; + } + + if (ia64_info->root.dynamic_sections_created) + { + /* Allocate space for the dynamic relocations that turned out to be + required. */ + + elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_dynrel_entries, &data); + } + + /* We have now determined the sizes of the various dynamic sections. + Allocate memory for them. */ + for (sec = dynobj->sections; sec != NULL; sec = sec->next) + { + boolean strip; + + if (!(sec->flags & SEC_LINKER_CREATED)) + continue; + + /* If we don't need this section, strip it from the output file. + There were several sections primarily related to dynamic + linking that must be create before the linker maps input + sections to output sections. The linker does that before + bfd_elf_size_dynamic_sections is called, and it is that + function which decides whether anything needs to go into + these sections. */ + + strip = (sec->_raw_size == 0); + + if (sec == ia64_info->got_sec) + strip = false; + else if (sec == ia64_info->rel_got_sec) + { + if (strip) + ia64_info->rel_got_sec = NULL; + else + /* We use the reloc_count field as a counter if we need to + copy relocs into the output file. */ + sec->reloc_count = 0; + } + else if (sec == ia64_info->fptr_sec) + { + if (strip) + ia64_info->fptr_sec = NULL; + } + else if (sec == ia64_info->plt_sec) + { + if (strip) + ia64_info->plt_sec = NULL; + } + else if (sec == ia64_info->pltoff_sec) + { + if (strip) + ia64_info->pltoff_sec = NULL; + } + else if (sec == ia64_info->rel_pltoff_sec) + { + if (strip) + ia64_info->rel_pltoff_sec = NULL; + else + { + relplt = true; + /* We use the reloc_count field as a counter if we need to + copy relocs into the output file. */ + sec->reloc_count = 0; + } + } + else + { + const char *name; + + /* It's OK to base decisions on the section name, because none + of the dynobj section names depend upon the input files. */ + name = bfd_get_section_name (dynobj, sec); + + if (strcmp (name, ".got.plt") == 0) + strip = false; + else if (strncmp (name, ".rel", 4) == 0) + { + if (!strip) + { + const char *outname; + asection *target; + + /* If this relocation section applies to a read only + section, then we probably need a DT_TEXTREL entry. */ + outname = bfd_get_section_name (output_bfd, + sec->output_section); + if (outname[4] == 'a') + outname += 5; + else + outname += 4; + + target = bfd_get_section_by_name (output_bfd, outname); + if (target != NULL + && (target->flags & SEC_READONLY) != 0 + && (target->flags & SEC_ALLOC) != 0) + reltext = true; + + /* We use the reloc_count field as a counter if we need to + copy relocs into the output file. */ + sec->reloc_count = 0; + } + } + else + continue; + } + + if (strip) + _bfd_strip_section_from_output (info, sec); + else + { + /* Allocate memory for the section contents. */ + sec->contents = (bfd_byte *) bfd_zalloc(dynobj, sec->_raw_size); + if (sec->contents == NULL && sec->_raw_size != 0) + return false; + } + } + + if (elf_hash_table (info)->dynamic_sections_created) + { + /* Add some entries to the .dynamic section. We fill in the values + later (in finish_dynamic_sections) but we must add the entries now + so that we get the correct size for the .dynamic section. */ + + if (!info->shared) + { + /* The DT_DEBUG entry is filled in by the dynamic linker and used + by the debugger. */ + if (!bfd_elfNN_add_dynamic_entry (info, DT_DEBUG, 0)) + return false; + } + + if (! bfd_elfNN_add_dynamic_entry (info, DT_IA_64_PLT_RESERVE, 0)) + return false; + if (! bfd_elfNN_add_dynamic_entry (info, DT_PLTGOT, 0)) + return false; + + if (relplt) + { + if (! bfd_elfNN_add_dynamic_entry (info, DT_PLTRELSZ, 0) + || ! bfd_elfNN_add_dynamic_entry (info, DT_PLTREL, DT_RELA) + || ! bfd_elfNN_add_dynamic_entry (info, DT_JMPREL, 0)) + return false; + } + + if (! bfd_elfNN_add_dynamic_entry (info, DT_RELA, 0) + || ! bfd_elfNN_add_dynamic_entry (info, DT_RELASZ, 0) + || ! bfd_elfNN_add_dynamic_entry (info, DT_RELAENT, + sizeof (ElfNN_External_Rela))) + return false; + + if (reltext) + { + if (! bfd_elfNN_add_dynamic_entry (info, DT_TEXTREL, 0)) + return false; + info->flags |= DF_TEXTREL; + } + } + + /* ??? Perhaps force __gp local. */ + + return true; +} + +static bfd_reloc_status_type +elfNN_ia64_install_value (abfd, hit_addr, val, r_type) + bfd *abfd; + bfd_byte *hit_addr; + bfd_vma val; + unsigned int r_type; +{ + const struct ia64_operand *op; + int bigendian = 0, shift = 0; + bfd_vma t0, t1, insn, dword; + enum ia64_opnd opnd; + const char *err; + size_t size = 8; + + opnd = IA64_OPND_NIL; + switch (r_type) + { + case R_IA64_NONE: + case R_IA64_LDXMOV: + return bfd_reloc_ok; + + /* Instruction relocations. */ + + case R_IA64_IMM14: opnd = IA64_OPND_IMM14; break; + + case R_IA64_PCREL21F: opnd = IA64_OPND_TGT25; break; + case R_IA64_PCREL21M: opnd = IA64_OPND_TGT25b; break; + case R_IA64_PCREL60B: opnd = IA64_OPND_TGT64; break; + case R_IA64_PCREL21B: + case R_IA64_PCREL21BI: + opnd = IA64_OPND_TGT25c; + break; + + case R_IA64_IMM22: + case R_IA64_GPREL22: + case R_IA64_LTOFF22: + case R_IA64_LTOFF22X: + case R_IA64_PLTOFF22: + case R_IA64_PCREL22: + case R_IA64_LTOFF_FPTR22: + opnd = IA64_OPND_IMM22; + break; + + case R_IA64_IMM64: + case R_IA64_GPREL64I: + case R_IA64_LTOFF64I: + case R_IA64_PLTOFF64I: + case R_IA64_PCREL64I: + case R_IA64_FPTR64I: + case R_IA64_LTOFF_FPTR64I: + opnd = IA64_OPND_IMMU64; + break; + + /* Data relocations. */ + + case R_IA64_DIR32MSB: + case R_IA64_GPREL32MSB: + case R_IA64_FPTR32MSB: + case R_IA64_PCREL32MSB: + case R_IA64_SEGREL32MSB: + case R_IA64_SECREL32MSB: + case R_IA64_LTV32MSB: + size = 4; bigendian = 1; + break; + + case R_IA64_DIR32LSB: + case R_IA64_GPREL32LSB: + case R_IA64_FPTR32LSB: + case R_IA64_PCREL32LSB: + case R_IA64_SEGREL32LSB: + case R_IA64_SECREL32LSB: + case R_IA64_LTV32LSB: + size = 4; bigendian = 0; + break; + + case R_IA64_DIR64MSB: + case R_IA64_GPREL64MSB: + case R_IA64_PLTOFF64MSB: + case R_IA64_FPTR64MSB: + case R_IA64_PCREL64MSB: + case R_IA64_LTOFF_FPTR64MSB: + case R_IA64_SEGREL64MSB: + case R_IA64_SECREL64MSB: + case R_IA64_LTV64MSB: + size = 8; bigendian = 1; + break; + + case R_IA64_DIR64LSB: + case R_IA64_GPREL64LSB: + case R_IA64_PLTOFF64LSB: + case R_IA64_FPTR64LSB: + case R_IA64_PCREL64LSB: + case R_IA64_LTOFF_FPTR64LSB: + case R_IA64_SEGREL64LSB: + case R_IA64_SECREL64LSB: + case R_IA64_LTV64LSB: + size = 8; bigendian = 0; + break; + + /* Unsupported / Dynamic relocations. */ + default: + return bfd_reloc_notsupported; + } + + switch (opnd) + { + case IA64_OPND_IMMU64: + hit_addr -= (long) hit_addr & 0x3; + t0 = bfd_get_64 (abfd, hit_addr); + t1 = bfd_get_64 (abfd, hit_addr + 8); + + /* tmpl/s: bits 0.. 5 in t0 + slot 0: bits 5..45 in t0 + slot 1: bits 46..63 in t0, bits 0..22 in t1 + slot 2: bits 23..63 in t1 */ + + /* First, clear the bits that form the 64 bit constant. */ + t0 &= ~(0x3ffffLL << 46); + t1 &= ~(0x7fffffLL + | (( (0x07fLL << 13) | (0x1ffLL << 27) + | (0x01fLL << 22) | (0x001LL << 21) + | (0x001LL << 36)) << 23)); + + t0 |= ((val >> 22) & 0x03ffffLL) << 46; /* 18 lsbs of imm41 */ + t1 |= ((val >> 40) & 0x7fffffLL) << 0; /* 23 msbs of imm41 */ + t1 |= ( (((val >> 0) & 0x07f) << 13) /* imm7b */ + | (((val >> 7) & 0x1ff) << 27) /* imm9d */ + | (((val >> 16) & 0x01f) << 22) /* imm5c */ + | (((val >> 21) & 0x001) << 21) /* ic */ + | (((val >> 63) & 0x001) << 36)) << 23; /* i */ + + bfd_put_64 (abfd, t0, hit_addr); + bfd_put_64 (abfd, t1, hit_addr + 8); + break; + + case IA64_OPND_TGT64: + hit_addr -= (long) hit_addr & 0x3; + t0 = bfd_get_64 (abfd, hit_addr); + t1 = bfd_get_64 (abfd, hit_addr + 8); + + /* tmpl/s: bits 0.. 5 in t0 + slot 0: bits 5..45 in t0 + slot 1: bits 46..63 in t0, bits 0..22 in t1 + slot 2: bits 23..63 in t1 */ + + /* First, clear the bits that form the 64 bit constant. */ + t0 &= ~(0x3ffffLL << 46); + t1 &= ~(0x7fffffLL + | ((1LL << 36 | 0xfffffLL << 13) << 23)); + + val >>= 4; + t0 |= ((val >> 20) & 0xffffLL) << 2 << 46; /* 16 lsbs of imm39 */ + t1 |= ((val >> 36) & 0x7fffffLL) << 0; /* 23 msbs of imm39 */ + t1 |= ((((val >> 0) & 0xfffffLL) << 13) /* imm20b */ + | (((val >> 59) & 0x1LL) << 36)) << 23; /* i */ + + bfd_put_64 (abfd, t0, hit_addr); + bfd_put_64 (abfd, t1, hit_addr + 8); + break; + + default: + switch ((long) hit_addr & 0x3) + { + case 0: shift = 5; break; + case 1: shift = 14; hit_addr += 3; break; + case 2: shift = 23; hit_addr += 6; break; + case 3: return bfd_reloc_notsupported; /* shouldn't happen... */ + } + dword = bfd_get_64 (abfd, hit_addr); + insn = (dword >> shift) & 0x1ffffffffffLL; + + op = elf64_ia64_operands + opnd; + err = (*op->insert) (op, val, &insn); + if (err) + return bfd_reloc_overflow; + + dword &= ~(0x1ffffffffffLL << shift); + dword |= (insn << shift); + bfd_put_64 (abfd, dword, hit_addr); + break; + + case IA64_OPND_NIL: + /* A data relocation. */ + if (bigendian) + if (size == 4) + bfd_putb32 (val, hit_addr); + else + bfd_putb64 (val, hit_addr); + else + if (size == 4) + bfd_putl32 (val, hit_addr); + else + bfd_putl64 (val, hit_addr); + break; + } + + return bfd_reloc_ok; +} + +static void +elfNN_ia64_install_dyn_reloc (abfd, info, sec, srel, offset, type, + dynindx, addend) + bfd *abfd; + struct bfd_link_info *info; + asection *sec; + asection *srel; + bfd_vma offset; + unsigned int type; + long dynindx; + bfd_vma addend; +{ + Elf_Internal_Rela outrel; + + outrel.r_offset = (sec->output_section->vma + + sec->output_offset + + offset); + + BFD_ASSERT (dynindx != -1); + outrel.r_info = ELFNN_R_INFO (dynindx, type); + outrel.r_addend = addend; + + if (elf_section_data (sec)->stab_info != NULL) + { + /* This may be NULL for linker-generated relocations, as it is + inconvenient to pass all the bits around. And this shouldn't + happen. */ + BFD_ASSERT (info != NULL); + + offset = (_bfd_stab_section_offset + (abfd, &elf_hash_table (info)->stab_info, sec, + &elf_section_data (sec)->stab_info, offset)); + if (offset == (bfd_vma) -1) + { + /* Run for the hills. We shouldn't be outputting a relocation + for this. So do what everyone else does and output a no-op. */ + outrel.r_info = ELFNN_R_INFO (0, R_IA64_NONE); + outrel.r_addend = 0; + offset = 0; + } + outrel.r_offset = offset; + } + + bfd_elfNN_swap_reloca_out (abfd, &outrel, + ((ElfNN_External_Rela *) srel->contents + + srel->reloc_count++)); + BFD_ASSERT (sizeof (ElfNN_External_Rela) * srel->reloc_count + <= srel->_cooked_size); +} + +/* Store an entry for target address TARGET_ADDR in the linkage table + and return the gp-relative address of the linkage table entry. */ + +static bfd_vma +set_got_entry (abfd, info, dyn_i, dynindx, addend, value, dyn_r_type) + bfd *abfd; + struct bfd_link_info *info; + struct elfNN_ia64_dyn_sym_info *dyn_i; + long dynindx; + bfd_vma addend; + bfd_vma value; + unsigned int dyn_r_type; +{ + struct elfNN_ia64_link_hash_table *ia64_info; + asection *got_sec; + + ia64_info = elfNN_ia64_hash_table (info); + got_sec = ia64_info->got_sec; + + BFD_ASSERT ((dyn_i->got_offset & 7) == 0); + + if (! dyn_i->got_done) + { + dyn_i->got_done = true; + + /* Store the target address in the linkage table entry. */ + bfd_put_64 (abfd, value, got_sec->contents + dyn_i->got_offset); + + /* Install a dynamic relocation if needed. */ + if (info->shared + || elfNN_ia64_dynamic_symbol_p (dyn_i->h, info) + || (dynindx != -1 && dyn_r_type == R_IA64_FPTR64LSB)) + { + if (dynindx == -1) + { + dyn_r_type = R_IA64_REL64LSB; + dynindx = 0; + addend = value; + } + + if (bfd_big_endian (abfd)) + { + switch (dyn_r_type) + { + case R_IA64_REL64LSB: + dyn_r_type = R_IA64_REL64MSB; + break; + case R_IA64_DIR64LSB: + dyn_r_type = R_IA64_DIR64MSB; + break; + case R_IA64_FPTR64LSB: + dyn_r_type = R_IA64_FPTR64MSB; + break; + default: + BFD_ASSERT (false); + break; + } + } + + elfNN_ia64_install_dyn_reloc (abfd, NULL, got_sec, + ia64_info->rel_got_sec, + dyn_i->got_offset, dyn_r_type, + dynindx, addend); + } + } + + /* Return the address of the linkage table entry. */ + value = (got_sec->output_section->vma + + got_sec->output_offset + + dyn_i->got_offset); + + return value; +} + +/* Fill in a function descriptor consisting of the function's code + address and its global pointer. Return the descriptor's address. */ + +static bfd_vma +set_fptr_entry (abfd, info, dyn_i, value) + bfd *abfd; + struct bfd_link_info *info; + struct elfNN_ia64_dyn_sym_info *dyn_i; + bfd_vma value; +{ + struct elfNN_ia64_link_hash_table *ia64_info; + asection *fptr_sec; + + ia64_info = elfNN_ia64_hash_table (info); + fptr_sec = ia64_info->fptr_sec; + + if (!dyn_i->fptr_done) + { + dyn_i->fptr_done = 1; + + /* Fill in the function descriptor. */ + bfd_put_64 (abfd, value, fptr_sec->contents + dyn_i->fptr_offset); + bfd_put_64 (abfd, _bfd_get_gp_value (abfd), + fptr_sec->contents + dyn_i->fptr_offset + 8); + } + + /* Return the descriptor's address. */ + value = (fptr_sec->output_section->vma + + fptr_sec->output_offset + + dyn_i->fptr_offset); + + return value; +} + +/* Fill in a PLTOFF entry consisting of the function's code address + and its global pointer. Return the descriptor's address. */ + +static bfd_vma +set_pltoff_entry (abfd, info, dyn_i, value, is_plt) + bfd *abfd; + struct bfd_link_info *info; + struct elfNN_ia64_dyn_sym_info *dyn_i; + bfd_vma value; + boolean is_plt; +{ + struct elfNN_ia64_link_hash_table *ia64_info; + asection *pltoff_sec; + + ia64_info = elfNN_ia64_hash_table (info); + pltoff_sec = ia64_info->pltoff_sec; + + /* Don't do anything if this symbol uses a real PLT entry. In + that case, we'll fill this in during finish_dynamic_symbol. */ + if ((! dyn_i->want_plt || is_plt) + && !dyn_i->pltoff_done) + { + bfd_vma gp = _bfd_get_gp_value (abfd); + + /* Fill in the function descriptor. */ + bfd_put_64 (abfd, value, pltoff_sec->contents + dyn_i->pltoff_offset); + bfd_put_64 (abfd, gp, pltoff_sec->contents + dyn_i->pltoff_offset + 8); + + /* Install dynamic relocations if needed. */ + if (!is_plt && info->shared) + { + unsigned int dyn_r_type; + + if (bfd_big_endian (abfd)) + dyn_r_type = R_IA64_REL64MSB; + else + dyn_r_type = R_IA64_REL64LSB; + + elfNN_ia64_install_dyn_reloc (abfd, NULL, pltoff_sec, + ia64_info->rel_pltoff_sec, + dyn_i->pltoff_offset, + dyn_r_type, 0, value); + elfNN_ia64_install_dyn_reloc (abfd, NULL, pltoff_sec, + ia64_info->rel_pltoff_sec, + dyn_i->pltoff_offset + 8, + dyn_r_type, 0, gp); + } + + dyn_i->pltoff_done = 1; + } + + /* Return the descriptor's address. */ + value = (pltoff_sec->output_section->vma + + pltoff_sec->output_offset + + dyn_i->pltoff_offset); + + return value; +} + +/* Called through qsort to sort the .IA_64.unwind section during a + non-relocatable link. Set elfNN_ia64_unwind_entry_compare_bfd + to the output bfd so we can do proper endianness frobbing. */ + +static bfd *elfNN_ia64_unwind_entry_compare_bfd; + +static int +elfNN_ia64_unwind_entry_compare (a, b) + PTR a; + PTR b; +{ + bfd_vma av, bv; + + av = bfd_get_64 (elfNN_ia64_unwind_entry_compare_bfd, a); + bv = bfd_get_64 (elfNN_ia64_unwind_entry_compare_bfd, b); + + return (av < bv ? -1 : av > bv ? 1 : 0); +} + +static boolean +elfNN_ia64_final_link (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + struct elfNN_ia64_link_hash_table *ia64_info; + asection *unwind_output_sec; + + ia64_info = elfNN_ia64_hash_table (info); + + /* Make sure we've got ourselves a nice fat __gp value. */ + if (!info->relocateable) + { + bfd_vma min_vma = (bfd_vma) -1, max_vma = 0; + bfd_vma min_short_vma = min_vma, max_short_vma = 0; + struct elf_link_hash_entry *gp; + bfd_vma gp_val; + asection *os; + + /* Find the min and max vma of all sections marked short. Also + collect min and max vma of any type, for use in selecting a + nice gp. */ + for (os = abfd->sections; os ; os = os->next) + { + bfd_vma lo, hi; + + if ((os->flags & SEC_ALLOC) == 0) + continue; + + lo = os->vma; + hi = os->vma + os->_raw_size; + if (hi < lo) + hi = (bfd_vma) -1; + + if (min_vma > lo) + min_vma = lo; + if (max_vma < hi) + max_vma = hi; + if (os->flags & SEC_SMALL_DATA) + { + if (min_short_vma > lo) + min_short_vma = lo; + if (max_short_vma < hi) + max_short_vma = hi; + } + } + + /* See if the user wants to force a value. */ + gp = elf_link_hash_lookup (elf_hash_table (info), "__gp", false, + false, false); + + if (gp + && (gp->root.type == bfd_link_hash_defined + || gp->root.type == bfd_link_hash_defweak)) + { + asection *gp_sec = gp->root.u.def.section; + gp_val = (gp->root.u.def.value + + gp_sec->output_section->vma + + gp_sec->output_offset); + } + else + { + /* Pick a sensible value. */ + + asection *got_sec = ia64_info->got_sec; + + /* Start with just the address of the .got. */ + if (got_sec) + gp_val = got_sec->output_section->vma; + else if (max_short_vma != 0) + gp_val = min_short_vma; + else + gp_val = min_vma; + + /* If it is possible to address the entire image, but we + don't with the choice above, adjust. */ + if (max_vma - min_vma < 0x400000 + && max_vma - gp_val <= 0x200000 + && gp_val - min_vma > 0x200000) + gp_val = min_vma + 0x200000; + else if (max_short_vma != 0) + { + /* If we don't cover all the short data, adjust. */ + if (max_short_vma - gp_val >= 0x200000) + gp_val = min_short_vma + 0x200000; + + /* If we're addressing stuff past the end, adjust back. */ + if (gp_val > max_vma) + gp_val = max_vma - 0x200000 + 8; + } + } + + /* Validate whether all SHF_IA_64_SHORT sections are within + range of the chosen GP. */ + + if (max_short_vma != 0) + { + if (max_short_vma - min_short_vma >= 0x400000) + { + (*_bfd_error_handler) + (_("%s: short data segment overflowed (0x%lx >= 0x400000)"), + bfd_get_filename (abfd), + (unsigned long) (max_short_vma - min_short_vma)); + return false; + } + else if ((gp_val > min_short_vma + && gp_val - min_short_vma > 0x200000) + || (gp_val < max_short_vma + && max_short_vma - gp_val >= 0x200000)) + { + (*_bfd_error_handler) + (_("%s: __gp does not cover short data segment"), + bfd_get_filename (abfd)); + return false; + } + } + + _bfd_set_gp_value (abfd, gp_val); + + if (gp) + { + gp->root.type = bfd_link_hash_defined; + gp->root.u.def.value = gp_val; + gp->root.u.def.section = bfd_abs_section_ptr; + } + } + + /* If we're producing a final executable, we need to sort the contents + of the .IA_64.unwind section. Force this section to be relocated + into memory rather than written immediately to the output file. */ + unwind_output_sec = NULL; + if (!info->relocateable) + { + asection *s = bfd_get_section_by_name (abfd, ELF_STRING_ia64_unwind); + if (s) + { + unwind_output_sec = s->output_section; + unwind_output_sec->contents + = bfd_malloc (unwind_output_sec->_raw_size); + if (unwind_output_sec->contents == NULL) + return false; + } + } + + /* Invoke the regular ELF backend linker to do all the work. */ + if (!bfd_elfNN_bfd_final_link (abfd, info)) + return false; + + if (unwind_output_sec) + { + elfNN_ia64_unwind_entry_compare_bfd = abfd; + qsort (unwind_output_sec->contents, unwind_output_sec->_raw_size / 24, + 24, elfNN_ia64_unwind_entry_compare); + + if (! bfd_set_section_contents (abfd, unwind_output_sec, + unwind_output_sec->contents, 0, + unwind_output_sec->_raw_size)) + return false; + } + + return true; +} + +static boolean +elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, + contents, relocs, local_syms, local_sections) + bfd *output_bfd; + struct bfd_link_info *info; + bfd *input_bfd; + asection *input_section; + bfd_byte *contents; + Elf_Internal_Rela *relocs; + Elf_Internal_Sym *local_syms; + asection **local_sections; +{ + struct elfNN_ia64_link_hash_table *ia64_info; + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Rela *rel; + Elf_Internal_Rela *relend; + asection *srel; + boolean ret_val = true; /* for non-fatal errors */ + bfd_vma gp_val; + + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + ia64_info = elfNN_ia64_hash_table (info); + + /* Infect various flags from the input section to the output section. */ + if (info->relocateable) + { + bfd_vma flags; + + flags = elf_section_data(input_section)->this_hdr.sh_flags; + flags &= SHF_IA_64_NORECOV; + + elf_section_data(input_section->output_section) + ->this_hdr.sh_flags |= flags; + } + + gp_val = _bfd_get_gp_value (output_bfd); + srel = get_reloc_section (input_bfd, ia64_info, input_section, false); + + rel = relocs; + relend = relocs + input_section->reloc_count; + for (; rel < relend; ++rel) + { + struct elf_link_hash_entry *h; + struct elfNN_ia64_dyn_sym_info *dyn_i; + bfd_reloc_status_type r; + reloc_howto_type *howto; + unsigned long r_symndx; + Elf_Internal_Sym *sym; + unsigned int r_type; + bfd_vma value; + asection *sym_sec; + bfd_byte *hit_addr; + boolean dynamic_symbol_p; + boolean undef_weak_ref; + + r_type = ELFNN_R_TYPE (rel->r_info); + if (r_type > R_IA64_MAX_RELOC_CODE) + { + (*_bfd_error_handler) + (_("%s: unknown relocation type %d"), + bfd_get_filename (input_bfd), (int)r_type); + bfd_set_error (bfd_error_bad_value); + ret_val = false; + continue; + } + howto = lookup_howto (r_type); + r_symndx = ELFNN_R_SYM (rel->r_info); + + if (info->relocateable) + { + /* This is a relocateable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + sym_sec = local_sections[r_symndx]; + rel->r_addend += sym_sec->output_offset; + } + } + continue; + } + + /* This is a final link. */ + + h = NULL; + sym = NULL; + sym_sec = NULL; + undef_weak_ref = false; + + if (r_symndx < symtab_hdr->sh_info) + { + /* Reloc against local symbol. */ + sym = local_syms + r_symndx; + sym_sec = local_sections[r_symndx]; + value = (sym_sec->output_section->vma + + sym_sec->output_offset + + sym->st_value); + } + else + { + long indx; + + /* Reloc against global symbol. */ + indx = r_symndx - symtab_hdr->sh_info; + h = elf_sym_hashes (input_bfd)[indx]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + value = 0; + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + sym_sec = h->root.u.def.section; + + /* Detect the cases that sym_sec->output_section is + expected to be NULL -- all cases in which the symbol + is defined in another shared module. This includes + PLT relocs for which we've created a PLT entry and + other relocs for which we're prepared to create + dynamic relocations. */ + /* ??? Just accept it NULL and continue. */ + + if (sym_sec->output_section != NULL) + { + value = (h->root.u.def.value + + sym_sec->output_section->vma + + sym_sec->output_offset); + } + } + else if (h->root.type == bfd_link_hash_undefweak) + undef_weak_ref = true; + else if (info->shared && !info->symbolic + && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) + ; + else + { + if (! ((*info->callbacks->undefined_symbol) + (info, h->root.root.string, input_bfd, + input_section, rel->r_offset, + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) + return false; + ret_val = false; + continue; + } + } + + hit_addr = contents + rel->r_offset; + value += rel->r_addend; + dynamic_symbol_p = elfNN_ia64_dynamic_symbol_p (h, info); + + switch (r_type) + { + case R_IA64_NONE: + case R_IA64_LDXMOV: + continue; + + case R_IA64_IMM14: + case R_IA64_IMM22: + case R_IA64_IMM64: + case R_IA64_DIR32MSB: + case R_IA64_DIR32LSB: + case R_IA64_DIR64MSB: + case R_IA64_DIR64LSB: + /* Install a dynamic relocation for this reloc. */ + if ((dynamic_symbol_p || info->shared) + && (input_section->flags & SEC_ALLOC) != 0) + { + unsigned int dyn_r_type; + long dynindx; + bfd_vma addend; + + BFD_ASSERT (srel != NULL); + + /* If we don't need dynamic symbol lookup, find a + matching RELATIVE relocation. */ + dyn_r_type = r_type; + if (dynamic_symbol_p) + { + dynindx = h->dynindx; + addend = rel->r_addend; + value = 0; + } + else + { + switch (r_type) + { + case R_IA64_DIR32MSB: + dyn_r_type = R_IA64_REL32MSB; + break; + case R_IA64_DIR32LSB: + dyn_r_type = R_IA64_REL32LSB; + break; + case R_IA64_DIR64MSB: + dyn_r_type = R_IA64_REL64MSB; + break; + case R_IA64_DIR64LSB: + dyn_r_type = R_IA64_REL64LSB; + break; + + default: + /* We can't represent this without a dynamic symbol. + Adjust the relocation to be against an output + section symbol, which are always present in the + dynamic symbol table. */ + /* ??? People shouldn't be doing non-pic code in + shared libraries. Hork. */ + (*_bfd_error_handler) + (_("%s: linking non-pic code in a shared library"), + bfd_get_filename (input_bfd)); + ret_val = false; + continue; + } + dynindx = 0; + addend = value; + } + + elfNN_ia64_install_dyn_reloc (output_bfd, info, input_section, + srel, rel->r_offset, dyn_r_type, + dynindx, addend); + } + /* FALLTHRU */ + + case R_IA64_LTV32MSB: + case R_IA64_LTV32LSB: + case R_IA64_LTV64MSB: + case R_IA64_LTV64LSB: + r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type); + break; + + case R_IA64_GPREL22: + case R_IA64_GPREL64I: + case R_IA64_GPREL32MSB: + case R_IA64_GPREL32LSB: + case R_IA64_GPREL64MSB: + case R_IA64_GPREL64LSB: + if (dynamic_symbol_p) + { + (*_bfd_error_handler) + (_("%s: @gprel relocation against dynamic symbol %s"), + bfd_get_filename (input_bfd), h->root.root.string); + ret_val = false; + continue; + } + value -= gp_val; + r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type); + break; + + case R_IA64_LTOFF22: + case R_IA64_LTOFF22X: + case R_IA64_LTOFF64I: + dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, false); + value = set_got_entry (input_bfd, info, dyn_i, (h ? h->dynindx : -1), + rel->r_addend, value, R_IA64_DIR64LSB); + value -= gp_val; + r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type); + break; + + case R_IA64_PLTOFF22: + case R_IA64_PLTOFF64I: + case R_IA64_PLTOFF64MSB: + case R_IA64_PLTOFF64LSB: + dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, false); + value = set_pltoff_entry (output_bfd, info, dyn_i, value, false); + value -= gp_val; + r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type); + break; + + case R_IA64_FPTR64I: + case R_IA64_FPTR32MSB: + case R_IA64_FPTR32LSB: + case R_IA64_FPTR64MSB: + case R_IA64_FPTR64LSB: + dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, false); + if (dyn_i->want_fptr) + { + if (!undef_weak_ref) + value = set_fptr_entry (output_bfd, info, dyn_i, value); + } + else + { + long dynindx; + + /* Otherwise, we expect the dynamic linker to create + the entry. */ + + if (h) + { + if (h->dynindx != -1) + dynindx = h->dynindx; + else + dynindx = (_bfd_elf_link_lookup_local_dynindx + (info, h->root.u.def.section->owner, + global_sym_index (h))); + } + else + { + dynindx = (_bfd_elf_link_lookup_local_dynindx + (info, input_bfd, r_symndx)); + } + + elfNN_ia64_install_dyn_reloc (output_bfd, info, input_section, + srel, rel->r_offset, r_type, + dynindx, rel->r_addend); + value = 0; + } + + r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type); + break; + + case R_IA64_LTOFF_FPTR22: + case R_IA64_LTOFF_FPTR64I: + case R_IA64_LTOFF_FPTR64MSB: + case R_IA64_LTOFF_FPTR64LSB: + { + long dynindx; + + dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, false); + if (dyn_i->want_fptr) + { + BFD_ASSERT (h == NULL || h->dynindx == -1) + if (!undef_weak_ref) + value = set_fptr_entry (output_bfd, info, dyn_i, value); + dynindx = -1; + } + else + { + /* Otherwise, we expect the dynamic linker to create + the entry. */ + if (h) + { + if (h->dynindx != -1) + dynindx = h->dynindx; + else + dynindx = (_bfd_elf_link_lookup_local_dynindx + (info, h->root.u.def.section->owner, + global_sym_index (h))); + } + else + dynindx = (_bfd_elf_link_lookup_local_dynindx + (info, input_bfd, r_symndx)); + value = 0; + } + + value = set_got_entry (output_bfd, info, dyn_i, dynindx, + rel->r_addend, value, R_IA64_FPTR64LSB); + value -= gp_val; + r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type); + } + break; + + case R_IA64_PCREL32MSB: + case R_IA64_PCREL32LSB: + case R_IA64_PCREL64MSB: + case R_IA64_PCREL64LSB: + /* Install a dynamic relocation for this reloc. */ + if (dynamic_symbol_p) + { + BFD_ASSERT (srel != NULL); + + elfNN_ia64_install_dyn_reloc (output_bfd, info, input_section, + srel, rel->r_offset, r_type, + h->dynindx, rel->r_addend); + } + goto finish_pcrel; + + case R_IA64_PCREL21BI: + case R_IA64_PCREL21F: + case R_IA64_PCREL21M: + /* ??? These two are only used for speculation fixup code. + They should never be dynamic. */ + if (dynamic_symbol_p) + { + (*_bfd_error_handler) + (_("%s: dynamic relocation against speculation fixup"), + bfd_get_filename (input_bfd)); + ret_val = false; + continue; + } + if (undef_weak_ref) + { + (*_bfd_error_handler) + (_("%s: speculation fixup against undefined weak symbol"), + bfd_get_filename (input_bfd)); + ret_val = false; + continue; + } + goto finish_pcrel; + + case R_IA64_PCREL21B: + case R_IA64_PCREL60B: + /* We should have created a PLT entry for any dynamic symbol. */ + dyn_i = NULL; + if (h) + dyn_i = get_dyn_sym_info (ia64_info, h, NULL, NULL, false); + + if (dyn_i && dyn_i->want_plt2) + { + /* Should have caught this earlier. */ + BFD_ASSERT (rel->r_addend == 0); + + value = (ia64_info->plt_sec->output_section->vma + + ia64_info->plt_sec->output_offset + + dyn_i->plt2_offset); + } + else + { + /* Since there's no PLT entry, Validate that this is + locally defined. */ + BFD_ASSERT (undef_weak_ref || sym_sec->output_section != NULL); + + /* If the symbol is undef_weak, we shouldn't be trying + to call it. There's every chance that we'd wind up + with an out-of-range fixup here. Don't bother setting + any value at all. */ + if (undef_weak_ref) + continue; + } + goto finish_pcrel; + + case R_IA64_PCREL22: + case R_IA64_PCREL64I: + finish_pcrel: + /* Make pc-relative. */ + value -= (input_section->output_section->vma + + input_section->output_offset + + rel->r_offset) & ~ (bfd_vma) 0x3; + r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type); + break; + + case R_IA64_SEGREL32MSB: + case R_IA64_SEGREL32LSB: + case R_IA64_SEGREL64MSB: + case R_IA64_SEGREL64LSB: + { + struct elf_segment_map *m; + Elf_Internal_Phdr *p; + + /* Find the segment that contains the output_section. */ + for (m = elf_tdata (output_bfd)->segment_map, + p = elf_tdata (output_bfd)->phdr; + m != NULL; + m = m->next, p++) + { + int i; + for (i = m->count - 1; i >= 0; i--) + if (m->sections[i] == sym_sec->output_section) + break; + if (i >= 0) + break; + } + + if (m == NULL) + { + /* If the input section was discarded from the output, then + do nothing. */ + + if (bfd_is_abs_section (sym_sec->output_section)) + r = bfd_reloc_ok; + else + r = bfd_reloc_notsupported; + } + else + { + /* The VMA of the segment is the vaddr of the associated + program header. */ + if (value > p->p_vaddr) + value -= p->p_vaddr; + else + value = 0; + r = elfNN_ia64_install_value (output_bfd, hit_addr, value, + r_type); + } + break; + } + + case R_IA64_SECREL32MSB: + case R_IA64_SECREL32LSB: + case R_IA64_SECREL64MSB: + case R_IA64_SECREL64LSB: + /* Make output-section relative. */ + if (value > input_section->output_section->vma) + value -= input_section->output_section->vma; + else + value = 0; + r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type); + break; + + case R_IA64_IPLTMSB: + case R_IA64_IPLTLSB: + /* Install a dynamic relocation for this reloc. */ + if ((dynamic_symbol_p || info->shared) + && (input_section->flags & SEC_ALLOC) != 0) + { + BFD_ASSERT (srel != NULL); + + /* If we don't need dynamic symbol lookup, install two + RELATIVE relocations. */ + if (! dynamic_symbol_p) + { + unsigned int dyn_r_type; + + if (r_type == R_IA64_IPLTMSB) + dyn_r_type = R_IA64_REL64MSB; + else + dyn_r_type = R_IA64_REL64LSB; + + elfNN_ia64_install_dyn_reloc (output_bfd, info, + input_section, + srel, rel->r_offset, + dyn_r_type, 0, value); + elfNN_ia64_install_dyn_reloc (output_bfd, info, + input_section, + srel, rel->r_offset + 8, + dyn_r_type, 0, gp_val); + } + else + elfNN_ia64_install_dyn_reloc (output_bfd, info, input_section, + srel, rel->r_offset, r_type, + h->dynindx, rel->r_addend); + } + + if (r_type == R_IA64_IPLTMSB) + r_type = R_IA64_DIR64MSB; + else + r_type = R_IA64_DIR64LSB; + elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type); + r = elfNN_ia64_install_value (output_bfd, hit_addr + 8, gp_val, + r_type); + break; + + default: + r = bfd_reloc_notsupported; + break; + } + + switch (r) + { + case bfd_reloc_ok: + break; + + case bfd_reloc_undefined: + /* This can happen for global table relative relocs if + __gp is undefined. This is a panic situation so we + don't try to continue. */ + (*info->callbacks->undefined_symbol) + (info, "__gp", input_bfd, input_section, rel->r_offset, 1); + return false; + + case bfd_reloc_notsupported: + { + const char *name; + + if (h) + name = h->root.root.string; + else + { + name = bfd_elf_string_from_elf_section (input_bfd, + symtab_hdr->sh_link, + sym->st_name); + if (name == NULL) + return false; + if (*name == '\0') + name = bfd_section_name (input_bfd, input_section); + } + if (!(*info->callbacks->warning) (info, _("unsupported reloc"), + name, input_bfd, + input_section, rel->r_offset)) + return false; + ret_val = false; + } + break; + + case bfd_reloc_dangerous: + case bfd_reloc_outofrange: + case bfd_reloc_overflow: + default: + { + const char *name; + + if (h) + name = h->root.root.string; + else + { + name = bfd_elf_string_from_elf_section (input_bfd, + symtab_hdr->sh_link, + sym->st_name); + if (name == NULL) + return false; + if (*name == '\0') + name = bfd_section_name (input_bfd, input_section); + } + if (!(*info->callbacks->reloc_overflow) (info, name, + howto->name, 0, + input_bfd, + input_section, + rel->r_offset)) + return false; + ret_val = false; + } + break; + } + } + + return ret_val; +} + +static boolean +elfNN_ia64_finish_dynamic_symbol (output_bfd, info, h, sym) + bfd *output_bfd; + struct bfd_link_info *info; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; +{ + struct elfNN_ia64_link_hash_table *ia64_info; + struct elfNN_ia64_dyn_sym_info *dyn_i; + + ia64_info = elfNN_ia64_hash_table (info); + dyn_i = get_dyn_sym_info (ia64_info, h, NULL, NULL, false); + + /* Fill in the PLT data, if required. */ + if (dyn_i && dyn_i->want_plt) + { + Elf_Internal_Rela outrel; + bfd_byte *loc; + asection *plt_sec; + bfd_vma plt_addr, pltoff_addr, gp_val, index; + ElfNN_External_Rela *rel; + + gp_val = _bfd_get_gp_value (output_bfd); + + /* Initialize the minimal PLT entry. */ + + index = (dyn_i->plt_offset - PLT_HEADER_SIZE) / PLT_MIN_ENTRY_SIZE; + plt_sec = ia64_info->plt_sec; + loc = plt_sec->contents + dyn_i->plt_offset; + + memcpy (loc, plt_min_entry, PLT_MIN_ENTRY_SIZE); + elfNN_ia64_install_value (output_bfd, loc, index, R_IA64_IMM22); + elfNN_ia64_install_value (output_bfd, loc+2, -dyn_i->plt_offset, + R_IA64_PCREL21B); + + plt_addr = (plt_sec->output_section->vma + + plt_sec->output_offset + + dyn_i->plt_offset); + pltoff_addr = set_pltoff_entry (output_bfd, info, dyn_i, plt_addr, true); + + /* Initialize the FULL PLT entry, if needed. */ + if (dyn_i->want_plt2) + { + loc = plt_sec->contents + dyn_i->plt2_offset; + + memcpy (loc, plt_full_entry, PLT_FULL_ENTRY_SIZE); + elfNN_ia64_install_value (output_bfd, loc, pltoff_addr - gp_val, + R_IA64_IMM22); + + /* Mark the symbol as undefined, rather than as defined in the + plt section. Leave the value alone. */ + /* ??? We didn't redefine it in adjust_dynamic_symbol in the + first place. But perhaps elflink.h did some for us. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + sym->st_shndx = SHN_UNDEF; + } + + /* Create the dynamic relocation. */ + outrel.r_offset = pltoff_addr; + if (bfd_little_endian (output_bfd)) + outrel.r_info = ELFNN_R_INFO (h->dynindx, R_IA64_IPLTLSB); + else + outrel.r_info = ELFNN_R_INFO (h->dynindx, R_IA64_IPLTMSB); + outrel.r_addend = 0; + + /* This is fun. In the .IA_64.pltoff section, we've got entries + that correspond both to real PLT entries, and those that + happened to resolve to local symbols but need to be created + to satisfy @pltoff relocations. The .rela.IA_64.pltoff + relocations for the real PLT should come at the end of the + section, so that they can be indexed by plt entry at runtime. + + We emitted all of the relocations for the non-PLT @pltoff + entries during relocate_section. So we can consider the + existing sec->reloc_count to be the base of the array of + PLT relocations. */ + + rel = (ElfNN_External_Rela *)ia64_info->rel_pltoff_sec->contents; + rel += ia64_info->rel_pltoff_sec->reloc_count; + + bfd_elfNN_swap_reloca_out (output_bfd, &outrel, rel + index); + } + + /* Mark some specially defined symbols as absolute. */ + if (strcmp (h->root.root.string, "_DYNAMIC") == 0 + || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0 + || strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0) + sym->st_shndx = SHN_ABS; + + return true; +} + +static boolean +elfNN_ia64_finish_dynamic_sections (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + struct elfNN_ia64_link_hash_table *ia64_info; + bfd *dynobj; + + ia64_info = elfNN_ia64_hash_table (info); + dynobj = ia64_info->root.dynobj; + + if (elf_hash_table (info)->dynamic_sections_created) + { + ElfNN_External_Dyn *dyncon, *dynconend; + asection *sdyn, *sgotplt; + bfd_vma gp_val; + + sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); + sgotplt = bfd_get_section_by_name (dynobj, ".got.plt"); + BFD_ASSERT (sdyn != NULL); + dyncon = (ElfNN_External_Dyn *) sdyn->contents; + dynconend = (ElfNN_External_Dyn *) (sdyn->contents + sdyn->_raw_size); + + gp_val = _bfd_get_gp_value (abfd); + + for (; dyncon < dynconend; dyncon++) + { + Elf_Internal_Dyn dyn; + + bfd_elfNN_swap_dyn_in (dynobj, dyncon, &dyn); + + switch (dyn.d_tag) + { + case DT_PLTGOT: + dyn.d_un.d_ptr = gp_val; + break; + + case DT_PLTRELSZ: + dyn.d_un.d_val = (ia64_info->minplt_entries + * sizeof (ElfNN_External_Rela)); + break; + + case DT_JMPREL: + /* See the comment above in finish_dynamic_symbol. */ + dyn.d_un.d_ptr = (ia64_info->rel_pltoff_sec->output_section->vma + + ia64_info->rel_pltoff_sec->output_offset + + (ia64_info->rel_pltoff_sec->reloc_count + * sizeof (ElfNN_External_Rela))); + break; + + case DT_IA_64_PLT_RESERVE: + dyn.d_un.d_ptr = (sgotplt->output_section->vma + + sgotplt->output_offset); + break; + + case DT_RELASZ: + /* Do not have RELASZ include JMPREL. This makes things + easier on ld.so. This is not what the rest of BFD set up. */ + dyn.d_un.d_val -= (ia64_info->minplt_entries + * sizeof (ElfNN_External_Rela)); + break; + } + + bfd_elfNN_swap_dyn_out (abfd, &dyn, dyncon); + } + + /* Initialize the PLT0 entry */ + if (ia64_info->plt_sec) + { + bfd_byte *loc = ia64_info->plt_sec->contents; + bfd_vma pltres; + + memcpy (loc, plt_header, PLT_HEADER_SIZE); + + pltres = (sgotplt->output_section->vma + + sgotplt->output_offset + - gp_val); + + elfNN_ia64_install_value (abfd, loc+1, pltres, R_IA64_GPREL22); + } + } + + return true; +} + +/* ELF file flag handling: */ + +/* Function to keep IA-64 specific file flags. */ +static boolean +elfNN_ia64_set_private_flags (abfd, flags) + bfd *abfd; + flagword flags; +{ + BFD_ASSERT (!elf_flags_init (abfd) + || elf_elfheader (abfd)->e_flags == flags); + + elf_elfheader (abfd)->e_flags = flags; + elf_flags_init (abfd) = true; + return true; +} + +/* Copy backend specific data from one object module to another */ +static boolean +elfNN_ia64_copy_private_bfd_data (ibfd, obfd) + bfd *ibfd, *obfd; +{ + if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour + || bfd_get_flavour (obfd) != bfd_target_elf_flavour) + return true; + + BFD_ASSERT (!elf_flags_init (obfd) + || (elf_elfheader (obfd)->e_flags + == elf_elfheader (ibfd)->e_flags)); + + elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; + elf_flags_init (obfd) = true; + return true; +} + +/* Merge backend specific data from an object file to the output + object file when linking. */ +static boolean +elfNN_ia64_merge_private_bfd_data (ibfd, obfd) + bfd *ibfd, *obfd; +{ + flagword out_flags; + flagword in_flags; + boolean ok = true; + + /* Don't even pretend to support mixed-format linking. */ + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour + || bfd_get_flavour (obfd) != bfd_target_elf_flavour) + return false; + + in_flags = elf_elfheader (ibfd)->e_flags; + out_flags = elf_elfheader (obfd)->e_flags; + + if (! elf_flags_init (obfd)) + { + elf_flags_init (obfd) = true; + elf_elfheader (obfd)->e_flags = in_flags; + + if (bfd_get_arch (obfd) == bfd_get_arch (ibfd) + && bfd_get_arch_info (obfd)->the_default) + { + return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), + bfd_get_mach (ibfd)); + } + + return true; + } + + /* Check flag compatibility. */ + if (in_flags == out_flags) + return true; + + /* Output has EF_IA_64_REDUCEDFP set only if all inputs have it set. */ + if (!(in_flags & EF_IA_64_REDUCEDFP) && (out_flags & EF_IA_64_REDUCEDFP)) + elf_elfheader (obfd)->e_flags &= ~EF_IA_64_REDUCEDFP; + + if ((in_flags & EF_IA_64_TRAPNIL) != (out_flags & EF_IA_64_TRAPNIL)) + { + (*_bfd_error_handler) + (_("%s: linking trap-on-NULL-dereference with non-trapping files"), + bfd_get_filename (ibfd)); + + bfd_set_error (bfd_error_bad_value); + ok = false; + } + if ((in_flags & EF_IA_64_BE) != (out_flags & EF_IA_64_BE)) + { + (*_bfd_error_handler) + (_("%s: linking big-endian files with little-endian files"), + bfd_get_filename (ibfd)); + + bfd_set_error (bfd_error_bad_value); + ok = false; + } + if ((in_flags & EF_IA_64_ABI64) != (out_flags & EF_IA_64_ABI64)) + { + (*_bfd_error_handler) + (_("%s: linking 64-bit files with 32-bit files"), + bfd_get_filename (ibfd)); + + bfd_set_error (bfd_error_bad_value); + ok = false; + } + if ((in_flags & EF_IA_64_CONS_GP) != (out_flags & EF_IA_64_CONS_GP)) + { + (*_bfd_error_handler) + (_("%s: linking constant-gp files with non-constant-gp files"), + bfd_get_filename (ibfd)); + + bfd_set_error (bfd_error_bad_value); + ok = false; + } + if ((in_flags & EF_IA_64_NOFUNCDESC_CONS_GP) + != (out_flags & EF_IA_64_NOFUNCDESC_CONS_GP)) + { + (*_bfd_error_handler) + (_("%s: linking auto-pic files with non-auto-pic files"), + bfd_get_filename (ibfd)); + + bfd_set_error (bfd_error_bad_value); + ok = false; + } + + return ok; +} + +static boolean +elfNN_ia64_print_private_bfd_data (abfd, ptr) + bfd *abfd; + PTR ptr; +{ + FILE *file = (FILE *) ptr; + flagword flags = elf_elfheader (abfd)->e_flags; + + BFD_ASSERT (abfd != NULL && ptr != NULL); + + fprintf (file, "private flags = %s%s%s%s%s%s%s%s\n", + (flags & EF_IA_64_TRAPNIL) ? "TRAPNIL, " : "", + (flags & EF_IA_64_EXT) ? "EXT, " : "", + (flags & EF_IA_64_BE) ? "BE, " : "LE, ", + (flags & EF_IA_64_REDUCEDFP) ? "REDUCEDFP, " : "", + (flags & EF_IA_64_CONS_GP) ? "CONS_GP, " : "", + (flags & EF_IA_64_NOFUNCDESC_CONS_GP) ? "NOFUNCDESC_CONS_GP, " : "", + (flags & EF_IA_64_ABSOLUTE) ? "ABSOLUTE, " : "", + (flags & EF_IA_64_ABI64) ? "ABI64" : "ABI32"); + + _bfd_elf_print_private_bfd_data (abfd, ptr); + return true; +} + +#define TARGET_LITTLE_SYM bfd_elfNN_ia64_little_vec +#define TARGET_LITTLE_NAME "elfNN-ia64-little" +#define TARGET_BIG_SYM bfd_elfNN_ia64_big_vec +#define TARGET_BIG_NAME "elfNN-ia64-big" +#define ELF_ARCH bfd_arch_ia64 +#define ELF_MACHINE_CODE EM_IA_64 +#define ELF_MACHINE_ALT1 1999 /* EAS2.3 */ +#define ELF_MACHINE_ALT2 1998 /* EAS2.2 */ +#define ELF_MAXPAGESIZE 0x10000 /* 64KB */ + +#define elf_backend_section_from_shdr \ + elfNN_ia64_section_from_shdr +#define elf_backend_section_flags \ + elfNN_ia64_section_flags +#define elf_backend_fake_sections \ + elfNN_ia64_fake_sections +#define elf_backend_final_write_processing \ + elfNN_ia64_final_write_processing +#define elf_backend_add_symbol_hook \ + elfNN_ia64_add_symbol_hook +#define elf_backend_additional_program_headers \ + elfNN_ia64_additional_program_headers +#define elf_backend_modify_segment_map \ + elfNN_ia64_modify_segment_map +#define elf_info_to_howto \ + elfNN_ia64_info_to_howto + +#define bfd_elfNN_bfd_reloc_type_lookup \ + elfNN_ia64_reloc_type_lookup +#define bfd_elfNN_bfd_is_local_label_name \ + elfNN_ia64_is_local_label_name +#define bfd_elfNN_bfd_relax_section \ + elfNN_ia64_relax_section + +/* Stuff for the BFD linker: */ +#define bfd_elfNN_bfd_link_hash_table_create \ + elfNN_ia64_hash_table_create +#define elf_backend_create_dynamic_sections \ + elfNN_ia64_create_dynamic_sections +#define elf_backend_check_relocs \ + elfNN_ia64_check_relocs +#define elf_backend_adjust_dynamic_symbol \ + elfNN_ia64_adjust_dynamic_symbol +#define elf_backend_size_dynamic_sections \ + elfNN_ia64_size_dynamic_sections +#define elf_backend_relocate_section \ + elfNN_ia64_relocate_section +#define elf_backend_finish_dynamic_symbol \ + elfNN_ia64_finish_dynamic_symbol +#define elf_backend_finish_dynamic_sections \ + elfNN_ia64_finish_dynamic_sections +#define bfd_elfNN_bfd_final_link \ + elfNN_ia64_final_link + +#define bfd_elfNN_bfd_copy_private_bfd_data \ + elfNN_ia64_copy_private_bfd_data +#define bfd_elfNN_bfd_merge_private_bfd_data \ + elfNN_ia64_merge_private_bfd_data +#define bfd_elfNN_bfd_set_private_flags \ + elfNN_ia64_set_private_flags +#define bfd_elfNN_bfd_print_private_bfd_data \ + elfNN_ia64_print_private_bfd_data + +#define elf_backend_plt_readonly 1 +#define elf_backend_want_plt_sym 0 +#define elf_backend_plt_alignment 5 +#define elf_backend_got_header_size 0 +#define elf_backend_plt_header_size PLT_HEADER_SIZE +#define elf_backend_want_got_plt 1 +#define elf_backend_may_use_rel_p 1 +#define elf_backend_may_use_rela_p 1 +#define elf_backend_default_use_rela_p 1 +#define elf_backend_want_dynbss 0 +#define elf_backend_copy_indirect_symbol elfNN_ia64_hash_copy_indirect +#define elf_backend_hide_symbol elfNN_ia64_hash_hide_symbol + +#include "elfNN-target.h" diff --git a/contrib/binutils/bfd/libpei.h b/contrib/binutils/bfd/libpei.h new file mode 100644 index 0000000..5b9cc04 --- /dev/null +++ b/contrib/binutils/bfd/libpei.h @@ -0,0 +1,321 @@ +/* Support for the generic parts of PE/PEI; common header information. + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. + Written by Cygnus Solutions. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* +Most of this hacked by Steve Chamberlain, + sac@cygnus.com + +PE/PEI rearrangement (and code added): Donn Terry + Softway Systems, Inc. +*/ + +/* Hey look, some documentation [and in a place you expect to find it]! + + The main reference for the pei format is "Microsoft Portable Executable + and Common Object File Format Specification 4.1". Get it if you need to + do some serious hacking on this code. + + Another reference: + "Peering Inside the PE: A Tour of the Win32 Portable Executable + File Format", MSJ 1994, Volume 9. + + The *sole* difference between the pe format and the pei format is that the + latter has an MSDOS 2.0 .exe header on the front that prints the message + "This app must be run under Windows." (or some such). + (FIXME: Whether that statement is *really* true or not is unknown. + Are there more subtle differences between pe and pei formats? + For now assume there aren't. If you find one, then for God sakes + document it here!) + + The Microsoft docs use the word "image" instead of "executable" because + the former can also refer to a DLL (shared library). Confusion can arise + because the `i' in `pei' also refers to "image". The `pe' format can + also create images (i.e. executables), it's just that to run on a win32 + system you need to use the pei format. + + FIXME: Please add more docs here so the next poor fool that has to hack + on this code has a chance of getting something accomplished without + wasting too much time. +*/ + +#ifndef GET_FCN_LNNOPTR +#define GET_FCN_LNNOPTR(abfd, ext) \ + bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_lnnoptr) +#endif + +#ifndef GET_FCN_ENDNDX +#define GET_FCN_ENDNDX(abfd, ext) \ + bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx) +#endif + +#ifndef PUT_FCN_LNNOPTR +#define PUT_FCN_LNNOPTR(abfd, in, ext) bfd_h_put_32(abfd, in, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_lnnoptr) +#endif +#ifndef PUT_FCN_ENDNDX +#define PUT_FCN_ENDNDX(abfd, in, ext) bfd_h_put_32(abfd, in, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx) +#endif +#ifndef GET_LNSZ_LNNO +#define GET_LNSZ_LNNO(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_misc.x_lnsz.x_lnno) +#endif +#ifndef GET_LNSZ_SIZE +#define GET_LNSZ_SIZE(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_misc.x_lnsz.x_size) +#endif +#ifndef PUT_LNSZ_LNNO +#define PUT_LNSZ_LNNO(abfd, in, ext) bfd_h_put_16(abfd, in, (bfd_byte *)ext->x_sym.x_misc.x_lnsz.x_lnno) +#endif +#ifndef PUT_LNSZ_SIZE +#define PUT_LNSZ_SIZE(abfd, in, ext) bfd_h_put_16(abfd, in, (bfd_byte*) ext->x_sym.x_misc.x_lnsz.x_size) +#endif +#ifndef GET_SCN_SCNLEN +#define GET_SCN_SCNLEN(abfd, ext) bfd_h_get_32(abfd, (bfd_byte *) ext->x_scn.x_scnlen) +#endif +#ifndef GET_SCN_NRELOC +#define GET_SCN_NRELOC(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *)ext->x_scn.x_nreloc) +#endif +#ifndef GET_SCN_NLINNO +#define GET_SCN_NLINNO(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *)ext->x_scn.x_nlinno) +#endif +#ifndef PUT_SCN_SCNLEN +#define PUT_SCN_SCNLEN(abfd,in, ext) bfd_h_put_32(abfd, in, (bfd_byte *) ext->x_scn.x_scnlen) +#endif +#ifndef PUT_SCN_NRELOC +#define PUT_SCN_NRELOC(abfd,in, ext) bfd_h_put_16(abfd, in, (bfd_byte *)ext->x_scn.x_nreloc) +#endif +#ifndef PUT_SCN_NLINNO +#define PUT_SCN_NLINNO(abfd,in, ext) bfd_h_put_16(abfd,in, (bfd_byte *) ext->x_scn.x_nlinno) +#endif +#ifndef GET_LINENO_LNNO +#define GET_LINENO_LNNO(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) (ext->l_lnno)); +#endif +#ifndef PUT_LINENO_LNNO +#define PUT_LINENO_LNNO(abfd,val, ext) bfd_h_put_16(abfd,val, (bfd_byte *) (ext->l_lnno)); +#endif + +/* The f_symptr field in the filehdr is sometimes 64 bits. */ +#ifndef GET_FILEHDR_SYMPTR +#define GET_FILEHDR_SYMPTR bfd_h_get_32 +#endif +#ifndef PUT_FILEHDR_SYMPTR +#define PUT_FILEHDR_SYMPTR bfd_h_put_32 +#endif + +/* Some fields in the aouthdr are sometimes 64 bits. */ +#ifndef GET_AOUTHDR_TSIZE +#define GET_AOUTHDR_TSIZE bfd_h_get_32 +#endif +#ifndef PUT_AOUTHDR_TSIZE +#define PUT_AOUTHDR_TSIZE bfd_h_put_32 +#endif +#ifndef GET_AOUTHDR_DSIZE +#define GET_AOUTHDR_DSIZE bfd_h_get_32 +#endif +#ifndef PUT_AOUTHDR_DSIZE +#define PUT_AOUTHDR_DSIZE bfd_h_put_32 +#endif +#ifndef GET_AOUTHDR_BSIZE +#define GET_AOUTHDR_BSIZE bfd_h_get_32 +#endif +#ifndef PUT_AOUTHDR_BSIZE +#define PUT_AOUTHDR_BSIZE bfd_h_put_32 +#endif +#ifndef GET_AOUTHDR_ENTRY +#define GET_AOUTHDR_ENTRY bfd_h_get_32 +#endif +#ifndef PUT_AOUTHDR_ENTRY +#define PUT_AOUTHDR_ENTRY bfd_h_put_32 +#endif +#ifndef GET_AOUTHDR_TEXT_START +#define GET_AOUTHDR_TEXT_START bfd_h_get_32 +#endif +#ifndef PUT_AOUTHDR_TEXT_START +#define PUT_AOUTHDR_TEXT_START bfd_h_put_32 +#endif +#ifndef GET_AOUTHDR_DATA_START +#define GET_AOUTHDR_DATA_START bfd_h_get_32 +#endif +#ifndef PUT_AOUTHDR_DATA_START +#define PUT_AOUTHDR_DATA_START bfd_h_put_32 +#endif + +/* Some fields in the scnhdr are sometimes 64 bits. */ +#ifndef GET_SCNHDR_PADDR +#define GET_SCNHDR_PADDR bfd_h_get_32 +#endif +#ifndef PUT_SCNHDR_PADDR +#define PUT_SCNHDR_PADDR bfd_h_put_32 +#endif +#ifndef GET_SCNHDR_VADDR +#define GET_SCNHDR_VADDR bfd_h_get_32 +#endif +#ifndef PUT_SCNHDR_VADDR +#define PUT_SCNHDR_VADDR bfd_h_put_32 +#endif +#ifndef GET_SCNHDR_SIZE +#define GET_SCNHDR_SIZE bfd_h_get_32 +#endif +#ifndef PUT_SCNHDR_SIZE +#define PUT_SCNHDR_SIZE bfd_h_put_32 +#endif +#ifndef GET_SCNHDR_SCNPTR +#define GET_SCNHDR_SCNPTR bfd_h_get_32 +#endif +#ifndef PUT_SCNHDR_SCNPTR +#define PUT_SCNHDR_SCNPTR bfd_h_put_32 +#endif +#ifndef GET_SCNHDR_RELPTR +#define GET_SCNHDR_RELPTR bfd_h_get_32 +#endif +#ifndef PUT_SCNHDR_RELPTR +#define PUT_SCNHDR_RELPTR bfd_h_put_32 +#endif +#ifndef GET_SCNHDR_LNNOPTR +#define GET_SCNHDR_LNNOPTR bfd_h_get_32 +#endif +#ifndef PUT_SCNHDR_LNNOPTR +#define PUT_SCNHDR_LNNOPTR bfd_h_put_32 +#endif + +#ifdef COFF_WITH_pep + +#define GET_OPTHDR_IMAGE_BASE bfd_h_get_64 +#define PUT_OPTHDR_IMAGE_BASE bfd_h_put_64 +#define GET_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_get_64 +#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_put_64 +#define GET_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_get_64 +#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_put_64 +#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_get_64 +#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_put_64 +#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_get_64 +#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_put_64 +#define GET_PDATA_ENTRY bfd_get_64 + +#define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pep_bfd_copy_private_bfd_data_common +#define _bfd_XX_bfd_copy_private_section_data _bfd_pep_bfd_copy_private_section_data +#define _bfd_XX_get_symbol_info _bfd_pep_get_symbol_info +#define _bfd_XX_only_swap_filehdr_out _bfd_pep_only_swap_filehdr_out +#define _bfd_XX_print_private_bfd_data_common _bfd_pep_print_private_bfd_data_common +#define _bfd_XXi_final_link_postscript _bfd_pepi_final_link_postscript +#define _bfd_XXi_final_link_postscript _bfd_pepi_final_link_postscript +#define _bfd_XXi_only_swap_filehdr_out _bfd_pepi_only_swap_filehdr_out +#define _bfd_XXi_swap_aouthdr_in _bfd_pepi_swap_aouthdr_in +#define _bfd_XXi_swap_aouthdr_out _bfd_pepi_swap_aouthdr_out +#define _bfd_XXi_swap_aux_in _bfd_pepi_swap_aux_in +#define _bfd_XXi_swap_aux_out _bfd_pepi_swap_aux_out +#define _bfd_XXi_swap_lineno_in _bfd_pepi_swap_lineno_in +#define _bfd_XXi_swap_lineno_out _bfd_pepi_swap_lineno_out +#define _bfd_XXi_swap_scnhdr_out _bfd_pepi_swap_scnhdr_out +#define _bfd_XXi_swap_sym_in _bfd_pepi_swap_sym_in +#define _bfd_XXi_swap_sym_out _bfd_pepi_swap_sym_out + +#else /* !COFF_WITH_pep */ + +#define GET_OPTHDR_IMAGE_BASE bfd_h_get_32 +#define PUT_OPTHDR_IMAGE_BASE bfd_h_put_32 +#define GET_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_get_32 +#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_put_32 +#define GET_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_get_32 +#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_put_32 +#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_get_32 +#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_put_32 +#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_get_32 +#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_put_32 +#define GET_PDATA_ENTRY bfd_get_32 + +#define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pe_bfd_copy_private_bfd_data_common +#define _bfd_XX_bfd_copy_private_section_data _bfd_pe_bfd_copy_private_section_data +#define _bfd_XX_get_symbol_info _bfd_pe_get_symbol_info +#define _bfd_XX_only_swap_filehdr_out _bfd_pe_only_swap_filehdr_out +#define _bfd_XX_print_private_bfd_data_common _bfd_pe_print_private_bfd_data_common +#define _bfd_XXi_final_link_postscript _bfd_pei_final_link_postscript +#define _bfd_XXi_final_link_postscript _bfd_pei_final_link_postscript +#define _bfd_XXi_only_swap_filehdr_out _bfd_pei_only_swap_filehdr_out +#define _bfd_XXi_swap_aouthdr_in _bfd_pei_swap_aouthdr_in +#define _bfd_XXi_swap_aouthdr_out _bfd_pei_swap_aouthdr_out +#define _bfd_XXi_swap_aux_in _bfd_pei_swap_aux_in +#define _bfd_XXi_swap_aux_out _bfd_pei_swap_aux_out +#define _bfd_XXi_swap_lineno_in _bfd_pei_swap_lineno_in +#define _bfd_XXi_swap_lineno_out _bfd_pei_swap_lineno_out +#define _bfd_XXi_swap_scnhdr_out _bfd_pei_swap_scnhdr_out +#define _bfd_XXi_swap_sym_in _bfd_pei_swap_sym_in +#define _bfd_XXi_swap_sym_out _bfd_pei_swap_sym_out + +#endif /* !COFF_WITH_pep */ + +/* These functions are architecture dependent, and are in peicode.h: + coff_swap_reloc_in + int coff_swap_reloc_out + coff_swap_filehdr_in + coff_swap_scnhdr_in + pe_mkobject + pe_mkobject_hook */ + +/* The functions described below are common across all PE/PEI + implementations architecture types, and actually appear in + peigen.c. */ + +void _bfd_XXi_swap_sym_in PARAMS ((bfd*, PTR, PTR)); +#define coff_swap_sym_in _bfd_XXi_swap_sym_in + +unsigned int _bfd_XXi_swap_sym_out PARAMS ((bfd*, PTR, PTR)); +#define coff_swap_sym_out _bfd_XXi_swap_sym_out + +void _bfd_XXi_swap_aux_in PARAMS ((bfd *, PTR, int, int, int, int, PTR)); +#define coff_swap_aux_in _bfd_XXi_swap_aux_in + +unsigned int _bfd_XXi_swap_aux_out \ + PARAMS ((bfd *, PTR, int, int, int, int, PTR)); +#define coff_swap_aux_out _bfd_XXi_swap_aux_out + +void _bfd_XXi_swap_lineno_in PARAMS ((bfd*, PTR, PTR)); +#define coff_swap_lineno_in _bfd_XXi_swap_lineno_in + +unsigned int _bfd_XXi_swap_lineno_out PARAMS ((bfd*, PTR, PTR)); +#define coff_swap_lineno_out _bfd_XXi_swap_lineno_out + +void _bfd_XXi_swap_aouthdr_in PARAMS ((bfd*, PTR, PTR)); +#define coff_swap_aouthdr_in _bfd_XXi_swap_aouthdr_in + +unsigned int _bfd_XXi_swap_aouthdr_out PARAMS ((bfd *, PTR, PTR)); +#define coff_swap_aouthdr_out _bfd_XXi_swap_aouthdr_out + +unsigned int _bfd_XXi_swap_scnhdr_out PARAMS ((bfd *, PTR, PTR)); +#define coff_swap_scnhdr_out _bfd_XXi_swap_scnhdr_out + +boolean _bfd_XX_print_private_bfd_data_common PARAMS ((bfd *, PTR)); + +boolean _bfd_XX_bfd_copy_private_bfd_data_common PARAMS ((bfd *, bfd *)); + +void _bfd_XX_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); + +boolean _bfd_XXi_final_link_postscript + PARAMS ((bfd *, struct coff_final_link_info *)); + +#ifndef coff_final_link_postscript +#define coff_final_link_postscript _bfd_XXi_final_link_postscript +#endif +/* The following are needed only for ONE of pe or pei, but don't + otherwise vary; peicode.h fixes up ifdefs but we provide the + prototype. */ + +unsigned int _bfd_XX_only_swap_filehdr_out PARAMS ((bfd*, PTR, PTR)); +unsigned int _bfd_XXi_only_swap_filehdr_out PARAMS ((bfd*, PTR, PTR)); +boolean _bfd_XX_bfd_copy_private_section_data + PARAMS ((bfd *, asection *, bfd *, asection *)); diff --git a/contrib/binutils/bfd/peicode.h b/contrib/binutils/bfd/peicode.h new file mode 100644 index 0000000..20fe01c --- /dev/null +++ b/contrib/binutils/bfd/peicode.h @@ -0,0 +1,1324 @@ +/* Support for the generic parts of PE/PEI, for BFD. + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. + Written by Cygnus Solutions. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* +Most of this hacked by Steve Chamberlain, + sac@cygnus.com + +PE/PEI rearrangement (and code added): Donn Terry + Softway Systems, Inc. +*/ + +/* Hey look, some documentation [and in a place you expect to find it]! + + The main reference for the pei format is "Microsoft Portable Executable + and Common Object File Format Specification 4.1". Get it if you need to + do some serious hacking on this code. + + Another reference: + "Peering Inside the PE: A Tour of the Win32 Portable Executable + File Format", MSJ 1994, Volume 9. + + The *sole* difference between the pe format and the pei format is that the + latter has an MSDOS 2.0 .exe header on the front that prints the message + "This app must be run under Windows." (or some such). + (FIXME: Whether that statement is *really* true or not is unknown. + Are there more subtle differences between pe and pei formats? + For now assume there aren't. If you find one, then for God sakes + document it here!) + + The Microsoft docs use the word "image" instead of "executable" because + the former can also refer to a DLL (shared library). Confusion can arise + because the `i' in `pei' also refers to "image". The `pe' format can + also create images (i.e. executables), it's just that to run on a win32 + system you need to use the pei format. + + FIXME: Please add more docs here so the next poor fool that has to hack + on this code has a chance of getting something accomplished without + wasting too much time. +*/ + +#include "libpei.h" + +static boolean (*pe_saved_coff_bfd_print_private_bfd_data) + PARAMS ((bfd *, PTR)) = +#ifndef coff_bfd_print_private_bfd_data + NULL; +#else + coff_bfd_print_private_bfd_data; +#undef coff_bfd_print_private_bfd_data +#endif + +static boolean pe_print_private_bfd_data PARAMS ((bfd *, PTR)); +#define coff_bfd_print_private_bfd_data pe_print_private_bfd_data + +static boolean (*pe_saved_coff_bfd_copy_private_bfd_data) + PARAMS ((bfd *, bfd *)) = +#ifndef coff_bfd_copy_private_bfd_data + NULL; +#else + coff_bfd_copy_private_bfd_data; +#undef coff_bfd_copy_private_bfd_data +#endif + +static boolean pe_bfd_copy_private_bfd_data PARAMS ((bfd *, bfd *)); +#define coff_bfd_copy_private_bfd_data pe_bfd_copy_private_bfd_data + +#define coff_mkobject pe_mkobject +#define coff_mkobject_hook pe_mkobject_hook + +#ifndef NO_COFF_RELOCS +static void coff_swap_reloc_in PARAMS ((bfd *, PTR, PTR)); +static unsigned int coff_swap_reloc_out PARAMS ((bfd *, PTR, PTR)); +#endif +static void coff_swap_filehdr_in PARAMS ((bfd *, PTR, PTR)); +static void coff_swap_scnhdr_in PARAMS ((bfd *, PTR, PTR)); +static boolean pe_mkobject PARAMS ((bfd *)); +static PTR pe_mkobject_hook PARAMS ((bfd *, PTR, PTR)); + +#ifdef COFF_IMAGE_WITH_PE +/* This structure contains static variables used by the ILF code. */ +typedef asection * asection_ptr; + +typedef struct +{ + bfd * abfd; + bfd_byte * data; + struct bfd_in_memory * bim; + unsigned short magic; + + arelent * reltab; + unsigned int relcount; + + coff_symbol_type * sym_cache; + coff_symbol_type * sym_ptr; + unsigned int sym_index; + + unsigned int * sym_table; + unsigned int * table_ptr; + + combined_entry_type * native_syms; + combined_entry_type * native_ptr; + + coff_symbol_type ** sym_ptr_table; + coff_symbol_type ** sym_ptr_ptr; + + unsigned int sec_index; + + char * string_table; + char * string_ptr; + char * end_string_ptr; + + SYMENT * esym_table; + SYMENT * esym_ptr; + + struct internal_reloc * int_reltab; +} +pe_ILF_vars; + +static asection_ptr pe_ILF_make_a_section PARAMS ((pe_ILF_vars *, const char *, unsigned int, flagword)); +static void pe_ILF_make_a_reloc PARAMS ((pe_ILF_vars *, bfd_vma, bfd_reloc_code_real_type, asection_ptr)); +static void pe_ILF_make_a_symbol PARAMS ((pe_ILF_vars *, const char *, const char *, asection_ptr, flagword)); +static void pe_ILF_save_relocs PARAMS ((pe_ILF_vars *, asection_ptr)); +static void pe_ILF_make_a_symbol_reloc PARAMS ((pe_ILF_vars *, bfd_vma, bfd_reloc_code_real_type, struct symbol_cache_entry **, unsigned int)); +static boolean pe_ILF_build_a_bfd PARAMS ((bfd *, unsigned short, bfd_byte *, bfd_byte *, unsigned int, unsigned int)); +static const bfd_target * pe_ILF_object_p PARAMS ((bfd *)); +static const bfd_target * pe_bfd_object_p PARAMS ((bfd *)); +#endif /* COFF_IMAGE_WITH_PE */ + +/**********************************************************************/ + +#ifndef NO_COFF_RELOCS +static void +coff_swap_reloc_in (abfd, src, dst) + bfd *abfd; + PTR src; + PTR dst; +{ + RELOC *reloc_src = (RELOC *) src; + struct internal_reloc *reloc_dst = (struct internal_reloc *) dst; + + reloc_dst->r_vaddr = bfd_h_get_32(abfd, (bfd_byte *)reloc_src->r_vaddr); + reloc_dst->r_symndx = bfd_h_get_signed_32(abfd, (bfd_byte *) reloc_src->r_symndx); + + reloc_dst->r_type = bfd_h_get_16(abfd, (bfd_byte *) reloc_src->r_type); + +#ifdef SWAP_IN_RELOC_OFFSET + reloc_dst->r_offset = SWAP_IN_RELOC_OFFSET(abfd, + (bfd_byte *) reloc_src->r_offset); +#endif +} + +static unsigned int +coff_swap_reloc_out (abfd, src, dst) + bfd *abfd; + PTR src; + PTR dst; +{ + struct internal_reloc *reloc_src = (struct internal_reloc *)src; + struct external_reloc *reloc_dst = (struct external_reloc *)dst; + bfd_h_put_32(abfd, reloc_src->r_vaddr, (bfd_byte *) reloc_dst->r_vaddr); + bfd_h_put_32(abfd, reloc_src->r_symndx, (bfd_byte *) reloc_dst->r_symndx); + + bfd_h_put_16(abfd, reloc_src->r_type, (bfd_byte *) + reloc_dst->r_type); + +#ifdef SWAP_OUT_RELOC_OFFSET + SWAP_OUT_RELOC_OFFSET(abfd, + reloc_src->r_offset, + (bfd_byte *) reloc_dst->r_offset); +#endif +#ifdef SWAP_OUT_RELOC_EXTRA + SWAP_OUT_RELOC_EXTRA(abfd,reloc_src, reloc_dst); +#endif + return RELSZ; +} +#endif /* not NO_COFF_RELOCS */ + +static void +coff_swap_filehdr_in (abfd, src, dst) + bfd *abfd; + PTR src; + PTR dst; +{ + FILHDR *filehdr_src = (FILHDR *) src; + struct internal_filehdr *filehdr_dst = (struct internal_filehdr *) dst; + filehdr_dst->f_magic = bfd_h_get_16(abfd, (bfd_byte *) filehdr_src->f_magic); + filehdr_dst->f_nscns = bfd_h_get_16(abfd, (bfd_byte *)filehdr_src-> f_nscns); + filehdr_dst->f_timdat = bfd_h_get_32(abfd, (bfd_byte *)filehdr_src-> f_timdat); + + filehdr_dst->f_nsyms = bfd_h_get_32(abfd, (bfd_byte *)filehdr_src-> f_nsyms); + filehdr_dst->f_flags = bfd_h_get_16(abfd, (bfd_byte *)filehdr_src-> f_flags); + filehdr_dst->f_symptr = bfd_h_get_32 (abfd, (bfd_byte *) filehdr_src->f_symptr); + + /* Other people's tools sometimes generate headers with an nsyms but + a zero symptr. */ + if (filehdr_dst->f_nsyms != 0 && filehdr_dst->f_symptr == 0) + { + filehdr_dst->f_nsyms = 0; + filehdr_dst->f_flags |= F_LSYMS; + } + + filehdr_dst->f_opthdr = bfd_h_get_16(abfd, + (bfd_byte *)filehdr_src-> f_opthdr); +} + +#ifdef COFF_IMAGE_WITH_PE +# define coff_swap_filehdr_out _bfd_XXi_only_swap_filehdr_out +#else +# define coff_swap_filehdr_out _bfd_pe_only_swap_filehdr_out +#endif + +static void +coff_swap_scnhdr_in (abfd, ext, in) + bfd *abfd; + PTR ext; + PTR in; +{ + SCNHDR *scnhdr_ext = (SCNHDR *) ext; + struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *) in; + + memcpy(scnhdr_int->s_name, scnhdr_ext->s_name, sizeof (scnhdr_int->s_name)); + scnhdr_int->s_vaddr = + GET_SCNHDR_VADDR (abfd, (bfd_byte *) scnhdr_ext->s_vaddr); + scnhdr_int->s_paddr = + GET_SCNHDR_PADDR (abfd, (bfd_byte *) scnhdr_ext->s_paddr); + scnhdr_int->s_size = + GET_SCNHDR_SIZE (abfd, (bfd_byte *) scnhdr_ext->s_size); + scnhdr_int->s_scnptr = + GET_SCNHDR_SCNPTR (abfd, (bfd_byte *) scnhdr_ext->s_scnptr); + scnhdr_int->s_relptr = + GET_SCNHDR_RELPTR (abfd, (bfd_byte *) scnhdr_ext->s_relptr); + scnhdr_int->s_lnnoptr = + GET_SCNHDR_LNNOPTR (abfd, (bfd_byte *) scnhdr_ext->s_lnnoptr); + scnhdr_int->s_flags = bfd_h_get_32(abfd, (bfd_byte *) scnhdr_ext->s_flags); + + /* MS handles overflow of line numbers by carrying into the reloc + field (it appears). Since it's supposed to be zero for PE + *IMAGE* format, that's safe. This is still a bit iffy. */ +#ifdef COFF_IMAGE_WITH_PE + scnhdr_int->s_nlnno = + (bfd_h_get_16 (abfd, (bfd_byte *) scnhdr_ext->s_nlnno) + + (bfd_h_get_16 (abfd, (bfd_byte *) scnhdr_ext->s_nreloc) << 16)); + scnhdr_int->s_nreloc = 0; +#else + scnhdr_int->s_nreloc = bfd_h_get_16 (abfd, + (bfd_byte *) scnhdr_ext->s_nreloc); + scnhdr_int->s_nlnno = bfd_h_get_16 (abfd, + (bfd_byte *) scnhdr_ext->s_nlnno); +#endif + + if (scnhdr_int->s_vaddr != 0) + { + scnhdr_int->s_vaddr += pe_data (abfd)->pe_opthdr.ImageBase; + scnhdr_int->s_vaddr &= 0xffffffff; + } + +#ifndef COFF_NO_HACK_SCNHDR_SIZE + /* If this section holds uninitialized data, use the virtual size + (stored in s_paddr) instead of the physical size. */ + if ((scnhdr_int->s_flags & IMAGE_SCN_CNT_UNINITIALIZED_DATA) != 0 + && (scnhdr_int->s_paddr > 0)) + { + scnhdr_int->s_size = scnhdr_int->s_paddr; + /* This code used to set scnhdr_int->s_paddr to 0. However, + coff_set_alignment_hook stores s_paddr in virt_size, which + only works if it correctly holds the virtual size of the + section. */ + } +#endif +} + +static boolean +pe_mkobject (abfd) + bfd * abfd; +{ + pe_data_type *pe; + abfd->tdata.pe_obj_data = + (struct pe_tdata *) bfd_zalloc (abfd, sizeof (pe_data_type)); + + if (abfd->tdata.pe_obj_data == 0) + return false; + + pe = pe_data (abfd); + + pe->coff.pe = 1; + + /* in_reloc_p is architecture dependent. */ + pe->in_reloc_p = in_reloc_p; + +#ifdef PEI_FORCE_MINIMUM_ALIGNMENT + pe->force_minimum_alignment = 1; +#endif +#ifdef PEI_TARGET_SUBSYSTEM + pe->target_subsystem = PEI_TARGET_SUBSYSTEM; +#endif + + return true; +} + +/* Create the COFF backend specific information. */ +static PTR +pe_mkobject_hook (abfd, filehdr, aouthdr) + bfd * abfd; + PTR filehdr; + PTR aouthdr ATTRIBUTE_UNUSED; +{ + struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; + pe_data_type *pe; + + if (pe_mkobject (abfd) == false) + return NULL; + + pe = pe_data (abfd); + pe->coff.sym_filepos = internal_f->f_symptr; + /* These members communicate important constants about the symbol + table to GDB's symbol-reading code. These `constants' + unfortunately vary among coff implementations... */ + pe->coff.local_n_btmask = N_BTMASK; + pe->coff.local_n_btshft = N_BTSHFT; + pe->coff.local_n_tmask = N_TMASK; + pe->coff.local_n_tshift = N_TSHIFT; + pe->coff.local_symesz = SYMESZ; + pe->coff.local_auxesz = AUXESZ; + pe->coff.local_linesz = LINESZ; + + pe->coff.timestamp = internal_f->f_timdat; + + obj_raw_syment_count (abfd) = + obj_conv_table_size (abfd) = + internal_f->f_nsyms; + + pe->real_flags = internal_f->f_flags; + + if ((internal_f->f_flags & F_DLL) != 0) + pe->dll = 1; + + if ((internal_f->f_flags & IMAGE_FILE_DEBUG_STRIPPED) == 0) + abfd->flags |= HAS_DEBUG; + +#ifdef COFF_IMAGE_WITH_PE + if (aouthdr) + pe->pe_opthdr = ((struct internal_aouthdr *)aouthdr)->pe; +#endif + +#ifdef ARM + if (! _bfd_coff_arm_set_private_flags (abfd, internal_f->f_flags)) + coff_data (abfd) ->flags = 0; +#endif + + return (PTR) pe; +} + +static boolean +pe_print_private_bfd_data (abfd, vfile) + bfd *abfd; + PTR vfile; +{ + FILE *file = (FILE *) vfile; + + if (!_bfd_XX_print_private_bfd_data_common (abfd, vfile)) + return false; + + if (pe_saved_coff_bfd_print_private_bfd_data != NULL) + { + fputc ('\n', file); + + return pe_saved_coff_bfd_print_private_bfd_data (abfd, vfile); + } + + return true; +} + +/* Copy any private info we understand from the input bfd + to the output bfd. */ + +static boolean +pe_bfd_copy_private_bfd_data (ibfd, obfd) + bfd *ibfd, *obfd; +{ + if (!_bfd_XX_bfd_copy_private_bfd_data_common (ibfd, obfd)) + return false; + + if (pe_saved_coff_bfd_copy_private_bfd_data) + return pe_saved_coff_bfd_copy_private_bfd_data (ibfd, obfd); + + return true; +} + +#define coff_bfd_copy_private_section_data \ + _bfd_XX_bfd_copy_private_section_data + +#define coff_get_symbol_info _bfd_XX_get_symbol_info + +#ifdef COFF_IMAGE_WITH_PE + +/* Code to handle Microsoft's Image Library Format. + Also known as LINK6 format. + Documentation about this format can be found at: + + http://msdn.microsoft.com/library/specs/pecoff_section8.htm */ + +/* The following constants specify the sizes of the various data + structures that we have to create in order to build a bfd describing + an ILF object file. The final "+ 1" in the definitions of SIZEOF_IDATA6 + and SIZEOF_IDATA7 below is to allow for the possibility that we might + need a padding byte in order to ensure 16 bit alignment for the section's + contents. + + The value for SIZEOF_ILF_STRINGS is computed as follows: + + There will be NUM_ILF_SECTIONS section symbols. Allow 9 characters + per symbol for their names (longest section name is .idata$x). + + There will be two symbols for the imported value, one the symbol name + and one with _imp__ prefixed. Allowing for the terminating nul's this + is strlen (symbol_name) * 2 + 8 + 21 + strlen (source_dll). + + The strings in the string table must start STRING__SIZE_SIZE bytes into + the table in order to for the string lookup code in coffgen/coffcode to + work. */ +#define NUM_ILF_RELOCS 8 +#define NUM_ILF_SECTIONS 6 +#define NUM_ILF_SYMS (2 + NUM_ILF_SECTIONS) + +#define SIZEOF_ILF_SYMS (NUM_ILF_SYMS * sizeof (* vars.sym_cache)) +#define SIZEOF_ILF_SYM_TABLE (NUM_ILF_SYMS * sizeof (* vars.sym_table)) +#define SIZEOF_ILF_NATIVE_SYMS (NUM_ILF_SYMS * sizeof (* vars.native_syms)) +#define SIZEOF_ILF_SYM_PTR_TABLE (NUM_ILF_SYMS * sizeof (* vars.sym_ptr_table)) +#define SIZEOF_ILF_EXT_SYMS (NUM_ILF_SYMS * sizeof (* vars.esym_table)) +#define SIZEOF_ILF_RELOCS (NUM_ILF_RELOCS * sizeof (* vars.reltab)) +#define SIZEOF_ILF_INT_RELOCS (NUM_ILF_RELOCS * sizeof (* vars.int_reltab)) +#define SIZEOF_ILF_STRINGS (strlen (symbol_name) * 2 + 8 \ + + 21 + strlen (source_dll) \ + + NUM_ILF_SECTIONS * 9 \ + + STRING_SIZE_SIZE) +#define SIZEOF_IDATA2 (5 * 4) +#define SIZEOF_IDATA4 (1 * 4) +#define SIZEOF_IDATA5 (1 * 4) +#define SIZEOF_IDATA6 (2 + strlen (symbol_name) + 1 + 1) +#define SIZEOF_IDATA7 (strlen (source_dll) + 1 + 1) +#define SIZEOF_ILF_SECTIONS (NUM_ILF_SECTIONS * sizeof (struct coff_section_tdata)) + +#define ILF_DATA_SIZE \ + sizeof (* vars.bim) \ + + SIZEOF_ILF_SYMS \ + + SIZEOF_ILF_SYM_TABLE \ + + SIZEOF_ILF_NATIVE_SYMS \ + + SIZEOF_ILF_SYM_PTR_TABLE \ + + SIZEOF_ILF_EXT_SYMS \ + + SIZEOF_ILF_RELOCS \ + + SIZEOF_ILF_INT_RELOCS \ + + SIZEOF_ILF_STRINGS \ + + SIZEOF_IDATA2 \ + + SIZEOF_IDATA4 \ + + SIZEOF_IDATA5 \ + + SIZEOF_IDATA6 \ + + SIZEOF_IDATA7 \ + + SIZEOF_ILF_SECTIONS \ + + MAX_TEXT_SECTION_SIZE + +/* Create an empty relocation against the given symbol. */ +static void +pe_ILF_make_a_symbol_reloc (pe_ILF_vars * vars, + bfd_vma address, + bfd_reloc_code_real_type reloc, + struct symbol_cache_entry ** sym, + unsigned int sym_index) +{ + arelent * entry; + struct internal_reloc * internal; + + entry = vars->reltab + vars->relcount; + internal = vars->int_reltab + vars->relcount; + + entry->address = address; + entry->addend = 0; + entry->howto = bfd_reloc_type_lookup (vars->abfd, reloc); + entry->sym_ptr_ptr = sym; + + internal->r_vaddr = address; + internal->r_symndx = sym_index; + internal->r_type = entry->howto->type; +#if 0 /* These fields do not need to be initialised. */ + internal->r_size = 0; + internal->r_extern = 0; + internal->r_offset = 0; +#endif + + vars->relcount ++; + + BFD_ASSERT (vars->relcount <= NUM_ILF_RELOCS); +} + +/* Create an empty relocation against the given section. */ +static void +pe_ILF_make_a_reloc (pe_ILF_vars * vars, + bfd_vma address, + bfd_reloc_code_real_type reloc, + asection_ptr sec) +{ + pe_ILF_make_a_symbol_reloc (vars, address, reloc, sec->symbol_ptr_ptr, + coff_section_data (vars->abfd, sec)->i); +} + +/* Move the queued relocs into the given section. */ +static void +pe_ILF_save_relocs (pe_ILF_vars * vars, + asection_ptr sec) +{ + /* Make sure that there is somewhere to store the internal relocs. */ + if (coff_section_data (vars->abfd, sec) == NULL) + /* We should probably return an error indication here. */ + abort (); + + coff_section_data (vars->abfd, sec)->relocs = vars->int_reltab; + coff_section_data (vars->abfd, sec)->keep_relocs = true; + + sec->relocation = vars->reltab; + sec->reloc_count = vars->relcount; + sec->flags |= SEC_RELOC; + + vars->reltab += vars->relcount; + vars->int_reltab += vars->relcount; + vars->relcount = 0; + + BFD_ASSERT ((bfd_byte *)vars->int_reltab < (bfd_byte *)vars->string_table); +} + +/* Create a global symbol and add it to the relevant tables. */ +static void +pe_ILF_make_a_symbol (pe_ILF_vars * vars, + const char * prefix, + const char * symbol_name, + asection_ptr section, + flagword extra_flags) +{ + coff_symbol_type * sym; + combined_entry_type * ent; + SYMENT * esym; + unsigned short sclass; + + if (extra_flags & BSF_LOCAL) + sclass = C_STAT; + else + sclass = C_EXT; + +#ifdef THUMBPEMAGIC + if (vars->magic == THUMBPEMAGIC) + { + if (extra_flags & BSF_FUNCTION) + sclass = C_THUMBEXTFUNC; + else if (extra_flags & BSF_LOCAL) + sclass = C_THUMBSTAT; + else + sclass = C_THUMBEXT; + } +#endif + + BFD_ASSERT (vars->sym_index < NUM_ILF_SYMS); + + sym = vars->sym_ptr; + ent = vars->native_ptr; + esym = vars->esym_ptr; + + /* Copy the symbol's name into the string table. */ + sprintf (vars->string_ptr, "%s%s", prefix, symbol_name); + + if (section == NULL) + section = (asection_ptr) & bfd_und_section; + + /* Initialise the external symbol. */ + bfd_h_put_32 (vars->abfd, vars->string_ptr - vars->string_table, (bfd_byte *) esym->e.e.e_offset); + bfd_h_put_16 (vars->abfd, section->target_index, (bfd_byte *) esym->e_scnum); + esym->e_sclass[0] = sclass; + + /* The following initialisations are unnecessary - the memory is + zero initialised. They are just kept here as reminders. */ +#if 0 + esym->e.e.e_zeroes = 0; + esym->e_value = 0; + esym->e_type = T_NULL; + esym->e_numaux = 0; +#endif + + /* Initialise the internal symbol structure. */ + ent->u.syment.n_sclass = sclass; + ent->u.syment.n_scnum = section->target_index; + ent->u.syment._n._n_n._n_offset = (long) sym; + +#if 0 /* See comment above. */ + ent->u.syment.n_value = 0; + ent->u.syment.n_flags = 0; + ent->u.syment.n_type = T_NULL; + ent->u.syment.n_numaux = 0; + ent->fix_value = 0; +#endif + + sym->symbol.the_bfd = vars->abfd; + sym->symbol.name = vars->string_ptr; + sym->symbol.flags = BSF_EXPORT | BSF_GLOBAL | extra_flags; + sym->symbol.section = section; + sym->native = ent; + +#if 0 /* See comment above. */ + sym->symbol.value = 0; + sym->symbol.udata.i = 0; + sym->done_lineno = false; + sym->lineno = NULL; +#endif + + * vars->table_ptr = vars->sym_index; + * vars->sym_ptr_ptr = sym; + + /* Adjust pointers for the next symbol. */ + vars->sym_index ++; + vars->sym_ptr ++; + vars->sym_ptr_ptr ++; + vars->table_ptr ++; + vars->native_ptr ++; + vars->esym_ptr ++; + vars->string_ptr += strlen (symbol_name) + strlen (prefix) + 1; + + BFD_ASSERT (vars->string_ptr < vars->end_string_ptr); +} + +/* Create a section. */ +static asection_ptr +pe_ILF_make_a_section (pe_ILF_vars * vars, + const char * name, + unsigned int size, + flagword extra_flags) +{ + asection_ptr sec; + flagword flags; + + sec = bfd_make_section_old_way (vars->abfd, name); + if (sec == NULL) + return NULL; + + flags = SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_KEEP | SEC_IN_MEMORY; + + bfd_set_section_flags (vars->abfd, sec, flags | extra_flags); + + bfd_set_section_alignment (vars->abfd, sec, 2); + + /* Check that we will not run out of space. */ + BFD_ASSERT (vars->data + size < vars->bim->buffer + vars->bim->size); + + /* Set the section size and contents. The actual + contents are filled in by our parent. */ + bfd_set_section_size (vars->abfd, sec, size); + sec->contents = vars->data; + sec->target_index = vars->sec_index ++; + + /* Advance data pointer in the vars structure. */ + vars->data += size; + + /* Skip the padding byte if it was not needed. + The logic here is that if the string length is odd, + then the entire string length, including the null byte, + is even and so the extra, padding byte, is not needed. */ + if (size & 1) + vars->data --; + + /* Create a coff_section_tdata structure for our use. */ + sec->used_by_bfd = (struct coff_section_tdata *) vars->data; + vars->data += sizeof (struct coff_section_tdata); + + BFD_ASSERT (vars->data <= vars->bim->buffer + vars->bim->size); + + /* Create a symbol to refer to this section. */ + pe_ILF_make_a_symbol (vars, "", name, sec, BSF_LOCAL); + + /* Cache the index to the symbol in the coff_section_data structure. */ + coff_section_data (vars->abfd, sec)->i = vars->sym_index - 1; + + return sec; +} + +/* This structure contains the code that goes into the .text section + in order to perform a jump into the DLL lookup table. The entries + in the table are index by the magic number used to represent the + machine type in the PE file. The contents of the data[] arrays in + these entries are stolen from the jtab[] arrays in ld/pe-dll.c. + The SIZE field says how many bytes in the DATA array are actually + used. The OFFSET field says where in the data array the address + of the .idata$5 section should be placed. */ +#define MAX_TEXT_SECTION_SIZE 32 + +typedef struct +{ + unsigned short magic; + unsigned char data[MAX_TEXT_SECTION_SIZE]; + unsigned int size; + unsigned int offset; +} +jump_table; + +static jump_table jtab[] = +{ +#ifdef I386MAGIC + { I386MAGIC, + { 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x90, 0x90 }, + 8, 2 + }, +#endif + +#ifdef MC68MAGIC + { MC68MAGIC, { /* XXX fill me in */ }, 0, 0 }, +#endif +#ifdef MIPS_ARCH_MAGIC_WINCE + { MIPS_ARCH_MAGIC_WINCE, + { 0x00, 0x00, 0x08, 0x3c, 0x00, 0x00, 0x08, 0x8d, + 0x08, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 }, + 16, 0 + }, +#endif + +#ifdef SH_ARCH_MAGIC_WINCE + { SH_ARCH_MAGIC_WINCE, + { 0x01, 0xd0, 0x02, 0x60, 0x2b, 0x40, + 0x09, 0x00, 0x00, 0x00, 0x00, 0x00 }, + 12, 8 + }, +#endif + +#ifdef ARMPEMAGIC + { ARMPEMAGIC, + { 0x00, 0xc0, 0x9f, 0xe5, 0x00, 0xf0, + 0x9c, 0xe5, 0x00, 0x00, 0x00, 0x00}, + 12, 8 + }, +#endif + +#ifdef THUMBPEMAGIC + { THUMBPEMAGIC, + { 0x40, 0xb4, 0x02, 0x4e, 0x36, 0x68, 0xb4, 0x46, + 0x40, 0xbc, 0x60, 0x47, 0x00, 0x00, 0x00, 0x00 }, + 16, 12 + }, +#endif + { 0, { 0 }, 0, 0 } +}; + +#ifndef NUM_ENTRIES +#define NUM_ENTRIES(a) (sizeof (a) / sizeof (a)[0]) +#endif + +/* Build a full BFD from the information supplied in a ILF object. */ +static boolean +pe_ILF_build_a_bfd (bfd * abfd, + unsigned short magic, + bfd_byte * symbol_name, + bfd_byte * source_dll, + unsigned int ordinal, + unsigned int types) +{ + bfd_byte * ptr; + pe_ILF_vars vars; + struct internal_filehdr internal_f; + unsigned int import_type; + unsigned int import_name_type; + asection_ptr id4, id5, id6 = NULL, text = NULL; + coff_symbol_type ** imp_sym; + unsigned int imp_index; + + /* Decode and verify the types field of the ILF structure. */ + import_type = types & 0x3; + import_name_type = (types & 0x1c) >> 2; + + switch (import_type) + { + case IMPORT_CODE: + case IMPORT_DATA: + break; + + case IMPORT_CONST: + /* XXX code yet to be written. */ + _bfd_error_handler (_("%s: Unhandled import type; %x"), + bfd_get_filename (abfd), import_type); + return false; + + default: + _bfd_error_handler (_("%s: Unrecognised import type; %x"), + bfd_get_filename (abfd), import_type); + return false; + } + + switch (import_name_type) + { + case IMPORT_ORDINAL: + case IMPORT_NAME: + case IMPORT_NAME_NOPREFIX: + case IMPORT_NAME_UNDECORATE: + break; + + default: + _bfd_error_handler (_("%s: Unrecognised import name type; %x"), + bfd_get_filename (abfd), import_name_type); + return false; + } + + /* Initialise local variables. + + Note these are kept in a structure rather than being + declared as statics since bfd frowns on global variables. + + We are going to construct the contents of the BFD in memory, + so allocate all the space that we will need right now. */ + ptr = bfd_zalloc (abfd, ILF_DATA_SIZE); + if (ptr == NULL) + return false; + + /* Create a bfd_in_memory structure. */ + vars.bim = (struct bfd_in_memory *) ptr; + vars.bim->buffer = ptr; + vars.bim->size = ILF_DATA_SIZE; + ptr += sizeof (* vars.bim); + + /* Initialise the pointers to regions of the memory and the + other contents of the pe_ILF_vars structure as well. */ + vars.sym_cache = (coff_symbol_type *) ptr; + vars.sym_ptr = (coff_symbol_type *) ptr; + vars.sym_index = 0; + ptr += SIZEOF_ILF_SYMS; + + vars.sym_table = (unsigned int *) ptr; + vars.table_ptr = (unsigned int *) ptr; + ptr += SIZEOF_ILF_SYM_TABLE; + + vars.native_syms = (combined_entry_type *) ptr; + vars.native_ptr = (combined_entry_type *) ptr; + ptr += SIZEOF_ILF_NATIVE_SYMS; + + vars.sym_ptr_table = (coff_symbol_type **) ptr; + vars.sym_ptr_ptr = (coff_symbol_type **) ptr; + ptr += SIZEOF_ILF_SYM_PTR_TABLE; + + vars.esym_table = (SYMENT *) ptr; + vars.esym_ptr = (SYMENT *) ptr; + ptr += SIZEOF_ILF_EXT_SYMS; + + vars.reltab = (arelent *) ptr; + vars.relcount = 0; + ptr += SIZEOF_ILF_RELOCS; + + vars.int_reltab = (struct internal_reloc *) ptr; + ptr += SIZEOF_ILF_INT_RELOCS; + + vars.string_table = ptr; + vars.string_ptr = ptr + STRING_SIZE_SIZE; + ptr += SIZEOF_ILF_STRINGS; + vars.end_string_ptr = ptr; + + /* The remaining space in bim->buffer is used + by the pe_ILF_make_a_section() function. */ + vars.data = ptr; + vars.abfd = abfd; + vars.sec_index = 0; + vars.magic = magic; + + /* Create the initial .idata$<n> sections: + [.idata$2: Import Directory Table -- not needed] + .idata$4: Import Lookup Table + .idata$5: Import Address Table + + Note we do not create a .idata$3 section as this is + created for us by the linker script. */ + id4 = pe_ILF_make_a_section (& vars, ".idata$4", SIZEOF_IDATA4, 0); + id5 = pe_ILF_make_a_section (& vars, ".idata$5", SIZEOF_IDATA5, 0); + if (id4 == NULL || id5 == NULL) + return false; + + /* Fill in the contents of these sections. */ + if (import_name_type == IMPORT_ORDINAL) + { + if (ordinal == 0) + /* XXX - treat as IMPORT_NAME ??? */ + abort (); + + * (unsigned int *) id4->contents = ordinal | 0x80000000; + * (unsigned int *) id5->contents = ordinal | 0x80000000; + } + else + { + char * symbol; + + /* Create .idata$6 - the Hint Name Table. */ + id6 = pe_ILF_make_a_section (& vars, ".idata$6", SIZEOF_IDATA6, 0); + if (id6 == NULL) + return false; + + /* If necessary, trim the import symbol name. */ + symbol = symbol_name; + + if (import_name_type != IMPORT_NAME) + /* Skip any prefix in symbol_name. */ + while (*symbol == '@' || * symbol == '?' || * symbol == '_') + ++ symbol; + + if (import_name_type == IMPORT_NAME_UNDECORATE) + { + /* Truncate at the first '@' */ + while (* symbol != 0 && * symbol != '@') + symbol ++; + + * symbol = 0; + } + + id6->contents[0] = ordinal & 0xff; + id6->contents[1] = ordinal >> 8; + + strcpy (id6->contents + 2, symbol); + } + + if (import_name_type != IMPORT_ORDINAL) + { + pe_ILF_make_a_reloc (& vars, 0, BFD_RELOC_RVA, id6); + pe_ILF_save_relocs (& vars, id4); + + pe_ILF_make_a_reloc (& vars, 0, BFD_RELOC_RVA, id6); + pe_ILF_save_relocs (& vars, id5); + } + + /* Create extra sections depending upon the type of import we are dealing with. */ + switch (import_type) + { + int i; + + case IMPORT_CODE: + /* Create a .text section. + First we need to look up its contents in the jump table. */ + for (i = NUM_ENTRIES (jtab); i--;) + { + if (jtab[i].size == 0) + continue; + if (jtab[i].magic == magic) + break; + } + /* If we did not find a matching entry something is wrong. */ + if (i < 0) + abort (); + + /* Create the .text section. */ + text = pe_ILF_make_a_section (& vars, ".text", jtab[i].size, SEC_CODE); + if (text == NULL) + return false; + + /* Copy in the jump code. */ + memcpy (text->contents, jtab[i].data, jtab[i].size); + + /* Create an import symbol. */ + pe_ILF_make_a_symbol (& vars, "__imp_", symbol_name, id5, 0); + imp_sym = vars.sym_ptr_ptr - 1; + imp_index = vars.sym_index - 1; + + /* Create a reloc for the data in the text section. */ +#ifdef MIPS_ARCH_MAGIC_WINCE + if (magic == MIPS_ARCH_MAGIC_WINCE) + { + pe_ILF_make_a_symbol_reloc (& vars, 0, BFD_RELOC_HI16_S, + (struct symbol_cache_entry **) imp_sym, imp_index); + pe_ILF_make_a_reloc (& vars, 0, BFD_RELOC_LO16, text); + pe_ILF_make_a_symbol_reloc (& vars, 4, BFD_RELOC_LO16, + (struct symbol_cache_entry **) imp_sym, imp_index); + } + else +#endif + pe_ILF_make_a_symbol_reloc (& vars, jtab[i].offset, BFD_RELOC_32, + (asymbol **) imp_sym, imp_index); + + pe_ILF_save_relocs (& vars, text); + break; + + case IMPORT_DATA: + break; + + default: + /* XXX code not yet written. */ + abort (); + } + + /* Initialise the bfd. */ + memset (& internal_f, 0, sizeof (internal_f)); + + internal_f.f_magic = magic; + internal_f.f_symptr = 0; + internal_f.f_nsyms = 0; + internal_f.f_flags = F_AR32WR | F_LNNO; /* XXX is this correct ? */ + + if ( ! bfd_set_start_address (abfd, 0) + || ! bfd_coff_set_arch_mach_hook (abfd, & internal_f)) + return false; + + if (bfd_coff_mkobject_hook (abfd, (PTR) & internal_f, NULL) == NULL) + return false; + + coff_data (abfd)->pe = 1; +#ifdef THUMBPEMAGIC + if (vars.magic == THUMBPEMAGIC) + /* Stop some linker warnings about thumb code not supporting interworking. */ + coff_data (abfd)->flags |= F_INTERWORK | F_INTERWORK_SET; +#endif + + /* Switch from file contents to memory contents. */ + bfd_cache_close (abfd); + + abfd->iostream = (PTR) vars.bim; + abfd->flags |= BFD_IN_MEMORY /* | HAS_LOCALS */; + abfd->where = 0; + obj_sym_filepos (abfd) = 0; + + /* Now create a symbol describing the imported value. */ + switch (import_type) + { + bfd_byte * ptr; + + case IMPORT_CODE: + pe_ILF_make_a_symbol (& vars, "", symbol_name, text, + BSF_NOT_AT_END | BSF_FUNCTION); + + /* Create an import symbol for the DLL, without the + .dll suffix. */ + ptr = strrchr (source_dll, '.'); + if (ptr) + * ptr = 0; + pe_ILF_make_a_symbol (& vars, "__IMPORT_DESCRIPTOR_", source_dll, NULL, 0); + if (ptr) + * ptr = '.'; + break; + + case IMPORT_DATA: + /* Nothing to do here. */ + break; + + default: + /* XXX code not yet written. */ + abort (); + } + + /* Point the bfd at the symbol table. */ + obj_symbols (abfd) = vars.sym_cache; + bfd_get_symcount (abfd) = vars.sym_index; + + obj_raw_syments (abfd) = vars.native_syms; + obj_raw_syment_count (abfd) = vars.sym_index; + + obj_coff_external_syms (abfd) = (PTR) vars.esym_table; + obj_coff_keep_syms (abfd) = true; + + obj_convert (abfd) = vars.sym_table; + obj_conv_table_size (abfd) = vars.sym_index; + + obj_coff_strings (abfd) = vars.string_table; + obj_coff_keep_strings (abfd) = true; + + abfd->flags |= HAS_SYMS; + + return true; +} + +/* We have detected a Image Library Format archive element. + Decode the element and return the appropriate target. */ +static const bfd_target * +pe_ILF_object_p (bfd * abfd) +{ + bfd_byte buffer[16]; + bfd_byte * ptr; + bfd_byte * symbol_name; + bfd_byte * source_dll; + unsigned int machine; + unsigned long size; + unsigned int ordinal; + unsigned int types; + unsigned short magic; + + /* Upon entry the first four buyes of the ILF header have + already been read. Now read the rest of the header. */ + if (bfd_read (buffer, 1, 16, abfd) != 16) + return NULL; + + ptr = buffer; + + /* We do not bother to check the version number. + version = bfd_h_get_16 (abfd, ptr); */ + ptr += 2; + + machine = bfd_h_get_16 (abfd, ptr); + ptr += 2; + + /* Check that the machine type is recognised. */ + magic = 0; + + switch (machine) + { + case IMAGE_FILE_MACHINE_UNKNOWN: + case IMAGE_FILE_MACHINE_ALPHA: + case IMAGE_FILE_MACHINE_ALPHA64: + case IMAGE_FILE_MACHINE_IA64: + break; + + case IMAGE_FILE_MACHINE_I386: +#ifdef I386MAGIC + magic = I386MAGIC; +#endif + break; + + case IMAGE_FILE_MACHINE_M68K: +#ifdef MC68AGIC + magic = MC68MAGIC; +#endif + break; + + case IMAGE_FILE_MACHINE_R3000: + case IMAGE_FILE_MACHINE_R4000: + case IMAGE_FILE_MACHINE_R10000: + + case IMAGE_FILE_MACHINE_MIPS16: + case IMAGE_FILE_MACHINE_MIPSFPU: + case IMAGE_FILE_MACHINE_MIPSFPU16: +#ifdef MIPS_ARCH_MAGIC_WINCE + magic = MIPS_ARCH_MAGIC_WINCE; +#endif + break; + + case IMAGE_FILE_MACHINE_SH3: + case IMAGE_FILE_MACHINE_SH4: +#ifdef SH_ARCH_MAGIC_WINCE + magic = SH_ARCH_MAGIC_WINCE; +#endif + break; + + case IMAGE_FILE_MACHINE_ARM: +#ifdef ARMPEMAGIC + magic = ARMPEMAGIC; +#endif + break; + + case IMAGE_FILE_MACHINE_THUMB: +#ifdef THUMBPEMAGIC + { + extern const bfd_target TARGET_LITTLE_SYM; + + if (abfd->xvec == & TARGET_LITTLE_SYM) + magic = THUMBPEMAGIC; + } +#endif + break; + + case IMAGE_FILE_MACHINE_POWERPC: + /* We no longer support PowerPC. */ + default: + _bfd_error_handler + ( +_("%s: Unrecognised machine type (0x%x) in Import Library Format archive"), + bfd_get_filename (abfd), machine); + bfd_set_error (bfd_error_malformed_archive); + + return NULL; + break; + } + + if (magic == 0) + { + _bfd_error_handler + ( +_("%s: Recognised but unhandled machine type (0x%x) in Import Library Format archive"), + bfd_get_filename (abfd), machine); + bfd_set_error (bfd_error_wrong_format); + + return NULL; + } + + /* We do not bother to check the date. + date = bfd_h_get_32 (abfd, ptr); */ + ptr += 4; + + size = bfd_h_get_32 (abfd, ptr); + ptr += 4; + + if (size == 0) + { + _bfd_error_handler + (_("%s: size field is zero in Import Library Format header"), + bfd_get_filename (abfd)); + bfd_set_error (bfd_error_malformed_archive); + + return NULL; + } + + ordinal = bfd_h_get_16 (abfd, ptr); + ptr += 2; + + types = bfd_h_get_16 (abfd, ptr); + /* ptr += 2; */ + + /* Now read in the two strings that follow. */ + ptr = bfd_alloc (abfd, size); + if (ptr == NULL) + return NULL; + + if (bfd_read (ptr, 1, size, abfd) != size) + return NULL; + + symbol_name = ptr; + source_dll = ptr + strlen (ptr) + 1; + + /* Verify that the strings are null terminated. */ + if (ptr[size - 1] != 0 || ((unsigned long) (source_dll - ptr) >= size)) + { + _bfd_error_handler + (_("%s: string not null terminated in ILF object file."), + bfd_get_filename (abfd)); + bfd_set_error (bfd_error_malformed_archive); + + return NULL; + } + + /* Now construct the bfd. */ + if (! pe_ILF_build_a_bfd (abfd, magic, symbol_name, + source_dll, ordinal, types)) + return NULL; + + return abfd->xvec; +} + +static const bfd_target * +pe_bfd_object_p (bfd * abfd) +{ + bfd_byte buffer[4]; + struct external_PEI_DOS_hdr dos_hdr; + struct external_PEI_IMAGE_hdr image_hdr; + file_ptr offset; + + /* Detect if this a Microsoft Import Library Format element. */ + if (bfd_seek (abfd, 0x00, SEEK_SET) != 0 + || bfd_read (buffer, 1, 4, abfd) != 4) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + if (bfd_h_get_32 (abfd, buffer) == 0xffff0000) + return pe_ILF_object_p (abfd); + + if (bfd_seek (abfd, 0x00, SEEK_SET) != 0 + || bfd_read (&dos_hdr, 1, sizeof (dos_hdr), abfd) + != sizeof (dos_hdr)) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + /* There are really two magic numbers involved; the magic number + that says this is a NT executable (PEI) and the magic number that + determines the architecture. The former is DOSMAGIC, stored in + the e_magic field. The latter is stored in the f_magic field. + If the NT magic number isn't valid, the architecture magic number + could be mimicked by some other field (specifically, the number + of relocs in section 3). Since this routine can only be called + correctly for a PEI file, check the e_magic number here, and, if + it doesn't match, clobber the f_magic number so that we don't get + a false match. */ + if (bfd_h_get_16 (abfd, (bfd_byte *) dos_hdr.e_magic) != DOSMAGIC) + { + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + offset = bfd_h_get_32 (abfd, (bfd_byte *) dos_hdr.e_lfanew); + if (bfd_seek (abfd, (file_ptr) offset, SEEK_SET) != 0 + || bfd_read (&image_hdr, 1, sizeof (image_hdr), abfd) + != sizeof (image_hdr)) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + if (bfd_h_get_32 (abfd, (bfd_byte *) image_hdr.nt_signature) + != 0x4550) + { + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + /* Here is the hack. coff_object_p wants to read filhsz bytes to + pick up the COFF header for PE, see "struct external_PEI_filehdr" + in include/coff/pe.h. We adjust so that that will work. */ + if (bfd_seek (abfd, + (file_ptr) (offset - sizeof (dos_hdr)), + SEEK_SET) + != 0) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + return coff_object_p (abfd); +} + +#define coff_object_p pe_bfd_object_p +#endif /* COFF_IMAGE_WITH_PE */ diff --git a/contrib/binutils/bfd/sunos.c b/contrib/binutils/bfd/sunos.c index 45e0cba..f4ada70 100644 --- a/contrib/binutils/bfd/sunos.c +++ b/contrib/binutils/bfd/sunos.c @@ -1,5 +1,5 @@ /* BFD backend for SunOS binaries. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998 + Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc. Written by Cygnus Support. @@ -84,12 +84,17 @@ static boolean sunos_finish_dynamic_link (((mtype) == M_SPARC && bfd_lookup_arch (bfd_arch_sparc, 0) != NULL) \ || ((mtype) == M_SPARCLET \ && bfd_lookup_arch (bfd_arch_sparc, bfd_mach_sparc_sparclet) != NULL) \ + || ((mtype) == M_SPARCLITE_LE \ + && bfd_lookup_arch (bfd_arch_sparc, bfd_mach_sparc_sparclet) != NULL) \ || (((mtype) == M_UNKNOWN || (mtype) == M_68010 || (mtype) == M_68020) \ && bfd_lookup_arch (bfd_arch_m68k, 0) != NULL)) /* Include the usual a.out support. */ #include "aoutf1.h" +/* The SunOS 4.1.4 /usr/include/locale.h defines valid as a macro. */ +#undef valid + /* SunOS shared library support. We store a pointer to this structure in obj_aout_dynamic_info (abfd). */ @@ -503,7 +508,7 @@ sunos_canonicalize_dynamic_reloc (abfd, storage, syms) * sizeof (arelent)))); if (info->canonical_dynrel == NULL && info->dynrel_count != 0) return -1; - + to = info->canonical_dynrel; if (obj_reloc_entry_size (abfd) == RELOC_EXT_SIZE) @@ -1252,7 +1257,7 @@ sunos_add_one_symbol (info, abfd, name, flags, section, value, string, /*ARGSUSED*/ struct bfd_link_needed_list * bfd_sunos_get_needed_list (abfd, info) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { if (info->hash->creator != &MY(vec)) @@ -1416,7 +1421,7 @@ bfd_sunos_size_dynamic_sections (output_bfd, info, sdynptr, sneedptr, s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size); if (s->contents == NULL && s->_raw_size != 0) return false; - + /* The number of buckets is just the number of symbols divided by four. To compute the final size of the hash table, we must actually compute the hash table. Normally we need @@ -1602,7 +1607,7 @@ static boolean sunos_scan_std_relocs (info, abfd, sec, relocs, rel_size) struct bfd_link_info *info; bfd *abfd; - asection *sec; + asection *sec ATTRIBUTE_UNUSED; const struct reloc_std_external *relocs; bfd_size_type rel_size; { @@ -1762,7 +1767,7 @@ static boolean sunos_scan_ext_relocs (info, abfd, sec, relocs, rel_size) struct bfd_link_info *info; bfd *abfd; - asection *sec; + asection *sec ATTRIBUTE_UNUSED; const struct reloc_ext_external *relocs; bfd_size_type rel_size; { @@ -2168,8 +2173,8 @@ sunos_scan_dynamic_symbol (h, data) /*ARGSUSED*/ static boolean sunos_link_dynamic_object (info, abfd) - struct bfd_link_info *info; - bfd *abfd; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + bfd *abfd ATTRIBUTE_UNUSED; { return true; } @@ -2269,16 +2274,16 @@ sunos_write_dynamic_symbol (output_bfd, info, harg) PUT_WORD (output_bfd, r_address, srel->r_address); if (bfd_header_big_endian (output_bfd)) { - srel->r_index[0] = (bfd_byte)(h->dynindx >> 16); - srel->r_index[1] = (bfd_byte)(h->dynindx >> 8); - srel->r_index[2] = (bfd_byte)(h->dynindx); + srel->r_index[0] = (bfd_byte) (h->dynindx >> 16); + srel->r_index[1] = (bfd_byte) (h->dynindx >> 8); + srel->r_index[2] = (bfd_byte) (h->dynindx); srel->r_type[0] = (RELOC_STD_BITS_EXTERN_BIG | RELOC_STD_BITS_JMPTABLE_BIG); } else { - srel->r_index[2] = (bfd_byte)(h->dynindx >> 16); - srel->r_index[1] = (bfd_byte)(h->dynindx >> 8); + srel->r_index[2] = (bfd_byte) (h->dynindx >> 16); + srel->r_index[1] = (bfd_byte) (h->dynindx >> 8); srel->r_index[0] = (bfd_byte)h->dynindx; srel->r_type[0] = (RELOC_STD_BITS_EXTERN_LITTLE | RELOC_STD_BITS_JMPTABLE_LITTLE); @@ -2292,8 +2297,8 @@ sunos_write_dynamic_symbol (output_bfd, info, harg) PUT_WORD (output_bfd, r_address, erel->r_address); if (bfd_header_big_endian (output_bfd)) { - erel->r_index[0] = (bfd_byte)(h->dynindx >> 16); - erel->r_index[1] = (bfd_byte)(h->dynindx >> 8); + erel->r_index[0] = (bfd_byte) (h->dynindx >> 16); + erel->r_index[1] = (bfd_byte) (h->dynindx >> 8); erel->r_index[2] = (bfd_byte)h->dynindx; erel->r_type[0] = (RELOC_EXT_BITS_EXTERN_BIG @@ -2301,8 +2306,8 @@ sunos_write_dynamic_symbol (output_bfd, info, harg) } else { - erel->r_index[2] = (bfd_byte)(h->dynindx >> 16); - erel->r_index[1] = (bfd_byte)(h->dynindx >> 8); + erel->r_index[2] = (bfd_byte) (h->dynindx >> 16); + erel->r_index[1] = (bfd_byte) (h->dynindx >> 8); erel->r_index[0] = (bfd_byte)h->dynindx; erel->r_type[0] = (RELOC_EXT_BITS_EXTERN_LITTLE @@ -2422,7 +2427,7 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, asection *input_section; struct aout_link_hash_entry *harg; PTR reloc; - bfd_byte *contents; + bfd_byte *contents ATTRIBUTE_UNUSED; boolean *skip; bfd_vma *relocationp; { @@ -2430,6 +2435,7 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, bfd *dynobj; boolean baserel; boolean jmptbl; + boolean pcrel; asection *s; bfd_byte *p; long indx; @@ -2438,7 +2444,10 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, dynobj = sunos_hash_table (info)->dynobj; - if (h != NULL && h->plt_offset != 0) + if (h != NULL + && h->plt_offset != 0 + && (info->shared + || (h->flags & SUNOS_DEF_REGULAR) == 0)) { asection *splt; @@ -2458,11 +2467,13 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, { baserel = (0 != (srel->r_type[0] & RELOC_STD_BITS_BASEREL_BIG)); jmptbl = (0 != (srel->r_type[0] & RELOC_STD_BITS_JMPTABLE_BIG)); + pcrel = (0 != (srel->r_type[0] & RELOC_STD_BITS_PCREL_BIG)); } else { baserel = (0 != (srel->r_type[0] & RELOC_STD_BITS_BASEREL_LITTLE)); jmptbl = (0 != (srel->r_type[0] & RELOC_STD_BITS_JMPTABLE_LITTLE)); + pcrel = (0 != (srel->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE)); } } else @@ -2481,6 +2492,13 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, || r_type == RELOC_BASE13 || r_type == RELOC_BASE22); jmptbl = r_type == RELOC_JMP_TBL; + pcrel = (r_type == RELOC_DISP8 + || r_type == RELOC_DISP16 + || r_type == RELOC_DISP32 + || r_type == RELOC_WDISP30 + || r_type == RELOC_WDISP22); + /* We don't consider the PC10 and PC22 types to be PC relative, + because they are pcrel_offset. */ } if (baserel) @@ -2576,8 +2594,8 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, srel->r_address); if (bfd_header_big_endian (dynobj)) { - srel->r_index[0] = (bfd_byte)(indx >> 16); - srel->r_index[1] = (bfd_byte)(indx >> 8); + srel->r_index[0] = (bfd_byte) (indx >> 16); + srel->r_index[1] = (bfd_byte) (indx >> 8); srel->r_index[2] = (bfd_byte)indx; if (h == NULL) srel->r_type[0] = 2 << RELOC_STD_BITS_LENGTH_SH_BIG; @@ -2590,8 +2608,8 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, } else { - srel->r_index[2] = (bfd_byte)(indx >> 16); - srel->r_index[1] = (bfd_byte)(indx >> 8); + srel->r_index[2] = (bfd_byte) (indx >> 16); + srel->r_index[1] = (bfd_byte) (indx >> 8); srel->r_index[0] = (bfd_byte)indx; if (h == NULL) srel->r_type[0] = 2 << RELOC_STD_BITS_LENGTH_SH_LITTLE; @@ -2615,8 +2633,8 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, erel->r_address); if (bfd_header_big_endian (dynobj)) { - erel->r_index[0] = (bfd_byte)(indx >> 16); - erel->r_index[1] = (bfd_byte)(indx >> 8); + erel->r_index[0] = (bfd_byte) (indx >> 16); + erel->r_index[1] = (bfd_byte) (indx >> 8); erel->r_index[2] = (bfd_byte)indx; if (h == NULL) erel->r_type[0] = @@ -2628,8 +2646,8 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, } else { - erel->r_index[2] = (bfd_byte)(indx >> 16); - erel->r_index[1] = (bfd_byte)(indx >> 8); + erel->r_index[2] = (bfd_byte) (indx >> 16); + erel->r_index[1] = (bfd_byte) (indx >> 8); erel->r_index[0] = (bfd_byte)indx; if (h == NULL) erel->r_type[0] = @@ -2708,16 +2726,18 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, srel->r_address); if (bfd_header_big_endian (dynobj)) { - srel->r_index[0] = (bfd_byte)(indx >> 16); - srel->r_index[1] = (bfd_byte)(indx >> 8); + srel->r_index[0] = (bfd_byte) (indx >> 16); + srel->r_index[1] = (bfd_byte) (indx >> 8); srel->r_index[2] = (bfd_byte)indx; } else { - srel->r_index[2] = (bfd_byte)(indx >> 16); - srel->r_index[1] = (bfd_byte)(indx >> 8); + srel->r_index[2] = (bfd_byte) (indx >> 16); + srel->r_index[1] = (bfd_byte) (indx >> 8); srel->r_index[0] = (bfd_byte)indx; } + /* FIXME: We may have to change the addend for a PC relative + reloc. */ } else { @@ -2731,16 +2751,26 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, erel->r_address); if (bfd_header_big_endian (dynobj)) { - erel->r_index[0] = (bfd_byte)(indx >> 16); - erel->r_index[1] = (bfd_byte)(indx >> 8); + erel->r_index[0] = (bfd_byte) (indx >> 16); + erel->r_index[1] = (bfd_byte) (indx >> 8); erel->r_index[2] = (bfd_byte)indx; } else { - erel->r_index[2] = (bfd_byte)(indx >> 16); - erel->r_index[1] = (bfd_byte)(indx >> 8); + erel->r_index[2] = (bfd_byte) (indx >> 16); + erel->r_index[1] = (bfd_byte) (indx >> 8); erel->r_index[0] = (bfd_byte)indx; } + if (pcrel && h != NULL) + { + /* Adjust the addend for the change in address. */ + PUT_WORD (dynobj, + (GET_WORD (dynobj, erel->r_addend) + - (input_section->output_section->vma + + input_section->output_offset + - input_section->vma)), + erel->r_addend); + } } ++s->reloc_count; @@ -2903,7 +2933,7 @@ sunos_finish_dynamic_link (abfd, info) PUT_WORD (dynobj, BFD_ALIGN (obj_textsec (abfd)->_raw_size, 0x2000), esdl.ld_text); - + if (! bfd_set_section_contents (abfd, sdyn->output_section, &esdl, (sdyn->output_offset + sizeof esd diff --git a/contrib/binutils/bfd/xcoff-target.h b/contrib/binutils/bfd/xcoff-target.h new file mode 100644 index 0000000..a3cc0c0 --- /dev/null +++ b/contrib/binutils/bfd/xcoff-target.h @@ -0,0 +1,194 @@ +/* Common definitions for backends based on IBM RS/6000 "XCOFF64" files. + Copyright 2000, 2001 + Free Software Foundation, Inc. + Contributed by Cygnus Support. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Internalcoff.h and coffcode.h modify themselves based on this flag. */ +#define RS6000COFF_C 1 + +#define SELECT_RELOC(internal, howto) \ + { \ + internal.r_type = howto->type; \ + internal.r_size = \ + ((howto->complain_on_overflow == complain_overflow_signed \ + ? 0x80 \ + : 0) \ + | (howto->bitsize - 1)); \ + } + +#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3) + +#define COFF_LONG_FILENAMES + +#define NO_COFF_SYMBOLS + +#define RTYPE2HOWTO(cache_ptr, dst) _bfd_xcoff_rtype2howto (cache_ptr, dst) + +#define coff_mkobject _bfd_xcoff_mkobject +#define coff_bfd_copy_private_bfd_data _bfd_xcoff_copy_private_bfd_data +#define coff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name +#define coff_bfd_reloc_type_lookup _bfd_xcoff_reloc_type_lookup +#define coff_relocate_section _bfd_ppc_xcoff_relocate_section + +#define CORE_FILE_P _bfd_dummy_target + +#define coff_core_file_failing_command _bfd_nocore_core_file_failing_command +#define coff_core_file_failing_signal _bfd_nocore_core_file_failing_signal +#define coff_core_file_matches_executable_p \ + _bfd_nocore_core_file_matches_executable_p + +#ifdef AIX_CORE +#undef CORE_FILE_P +#define CORE_FILE_P rs6000coff_core_p +extern const bfd_target * rs6000coff_core_p (); +extern boolean rs6000coff_core_file_matches_executable_p (); + +#undef coff_core_file_matches_executable_p +#define coff_core_file_matches_executable_p \ + rs6000coff_core_file_matches_executable_p + +extern char *rs6000coff_core_file_failing_command PARAMS ((bfd *abfd)); +#undef coff_core_file_failing_command +#define coff_core_file_failing_command rs6000coff_core_file_failing_command + +extern int rs6000coff_core_file_failing_signal PARAMS ((bfd *abfd)); +#undef coff_core_file_failing_signal +#define coff_core_file_failing_signal rs6000coff_core_file_failing_signal +#endif /* AIX_CORE */ + +#ifdef LYNX_CORE + +#undef CORE_FILE_P +#define CORE_FILE_P lynx_core_file_p +extern const bfd_target *lynx_core_file_p PARAMS ((bfd *abfd)); + +extern boolean lynx_core_file_matches_executable_p PARAMS ((bfd *core_bfd, + bfd *exec_bfd)); +#undef coff_core_file_matches_executable_p +#define coff_core_file_matches_executable_p lynx_core_file_matches_executable_p + +extern char *lynx_core_file_failing_command PARAMS ((bfd *abfd)); +#undef coff_core_file_failing_command +#define coff_core_file_failing_command lynx_core_file_failing_command + +extern int lynx_core_file_failing_signal PARAMS ((bfd *abfd)); +#undef coff_core_file_failing_signal +#define coff_core_file_failing_signal lynx_core_file_failing_signal + +#endif /* LYNX_CORE */ + +#define _bfd_xcoff_bfd_get_relocated_section_contents \ + coff_bfd_get_relocated_section_contents +#define _bfd_xcoff_bfd_relax_section coff_bfd_relax_section +#define _bfd_xcoff_bfd_gc_sections coff_bfd_gc_sections +#define _bfd_xcoff_bfd_link_split_section coff_bfd_link_split_section + +/* XCOFF archives do not have anything which corresponds to an + extended name table. */ + +#define _bfd_xcoff_slurp_extended_name_table bfd_false +#define _bfd_xcoff_construct_extended_name_table \ + ((boolean (*) PARAMS ((bfd *, char **, bfd_size_type *, const char **))) \ + bfd_false) +#define _bfd_xcoff_truncate_arname bfd_dont_truncate_arname + +/* We can use the standard get_elt_at_index routine. */ + +#define _bfd_xcoff_get_elt_at_index _bfd_generic_get_elt_at_index + +/* XCOFF archives do not have a timestamp. */ + +#define _bfd_xcoff_update_armap_timestamp bfd_true + +extern boolean _bfd_xcoff_mkobject PARAMS ((bfd *)); +extern boolean _bfd_xcoff_copy_private_bfd_data PARAMS ((bfd *, bfd *)); +extern boolean _bfd_xcoff_is_local_label_name PARAMS ((bfd *, const char *)); +extern void _bfd_xcoff_rtype2howto + PARAMS ((arelent *, struct internal_reloc *)); +extern reloc_howto_type *_bfd_xcoff_reloc_type_lookup + PARAMS ((bfd *, bfd_reloc_code_real_type)); +extern boolean _bfd_xcoff_slurp_armap PARAMS ((bfd *)); +extern const bfd_target *_bfd_xcoff_archive_p PARAMS ((bfd *)); +extern PTR _bfd_xcoff_read_ar_hdr PARAMS ((bfd *)); +extern bfd *_bfd_xcoff_openr_next_archived_file PARAMS ((bfd *, bfd *)); +extern int _bfd_xcoff_generic_stat_arch_elt PARAMS ((bfd *, struct stat *)); +extern boolean _bfd_xcoff_write_armap + PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); +extern boolean _bfd_xcoff_write_archive_contents PARAMS ((bfd *)); +extern int _bfd_xcoff_sizeof_headers PARAMS ((bfd *, boolean)); +extern void _bfd_xcoff_swap_sym_in PARAMS ((bfd *, PTR, PTR)); +extern unsigned int _bfd_xcoff_swap_sym_out PARAMS ((bfd *, PTR, PTR)); +extern void _bfd_xcoff_swap_aux_in PARAMS ((bfd *, PTR, int, int, int, int, PTR)); +extern unsigned int _bfd_xcoff_swap_aux_out PARAMS ((bfd *, PTR, int, int, int, int, PTR)); + +#ifndef coff_SWAP_sym_in +#define coff_SWAP_sym_in _bfd_xcoff_swap_sym_in +#define coff_SWAP_sym_out _bfd_xcoff_swap_sym_out +#define coff_SWAP_aux_in _bfd_xcoff_swap_aux_in +#define coff_SWAP_aux_out _bfd_xcoff_swap_aux_out +#endif + +#include "coffcode.h" + +/* The transfer vector that leads the outside world to all of the above. */ + +const bfd_target TARGET_SYM = +{ + TARGET_NAME, + bfd_target_xcoff_flavour, + BFD_ENDIAN_BIG, /* data byte order is big */ + BFD_ENDIAN_BIG, /* header byte order is big */ + + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | DYNAMIC | + HAS_SYMS | HAS_LOCALS | WP_TEXT), + + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ + 0, /* leading char */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen??? FIXMEmgo */ + + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ + + {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ + _bfd_xcoff_archive_p, CORE_FILE_P}, + {bfd_false, coff_mkobject, /* bfd_set_format */ + _bfd_generic_mkarchive, bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_xcoff_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (coff), + BFD_JUMP_TABLE_ARCHIVE (_bfd_xcoff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (_bfd_xcoff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_xcoff), + + NULL, + + COFF_SWAP_TABLE +}; diff --git a/contrib/binutils/bfd/xcofflink.c b/contrib/binutils/bfd/xcofflink.c new file mode 100644 index 0000000..5580e9b --- /dev/null +++ b/contrib/binutils/bfd/xcofflink.c @@ -0,0 +1,6631 @@ +/* POWER/PowerPC XCOFF linker support. + Copyright 1995, 1996, 1997, 1998, 1999, 2000 + Free Software Foundation, Inc. + Written by Ian Lance Taylor <ian@cygnus.com>, Cygnus Support. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "bfdlink.h" +#include "libbfd.h" +#include "coff/internal.h" +#include "libcoff.h" + +/* This file holds the XCOFF linker code. */ + +#define STRING_SIZE_SIZE (4) + +/* Get the XCOFF hash table entries for a BFD. */ +#define obj_xcoff_sym_hashes(bfd) \ + ((struct xcoff_link_hash_entry **) obj_coff_sym_hashes (bfd)) + +/* XCOFF relocation types. These probably belong in a header file + somewhere. The relocations are described in the function + _bfd_ppc_xcoff_relocate_section in this file. */ + +#define R_POS (0x00) +#define R_NEG (0x01) +#define R_REL (0x02) +#define R_TOC (0x03) +#define R_RTB (0x04) +#define R_GL (0x05) +#define R_TCL (0x06) +#define R_BA (0x08) +#define R_BR (0x0a) +#define R_RL (0x0c) +#define R_RLA (0x0d) +#define R_REF (0x0f) +#define R_TRL (0x12) +#define R_TRLA (0x13) +#define R_RRTBI (0x14) +#define R_RRTBA (0x15) +#define R_CAI (0x16) +#define R_CREL (0x17) +#define R_RBA (0x18) +#define R_RBAC (0x19) +#define R_RBR (0x1a) +#define R_RBRC (0x1b) + +/* The first word of global linkage code. This must be modified by + filling in the correct TOC offset. */ + +#define XCOFF_GLINK_FIRST (0x81820000) /* lwz r12,0(r2) */ + +/* The remaining words of global linkage code. */ + +static unsigned long xcoff_glink_code[] = { + 0x90410014, /* stw r2,20(r1) */ + 0x800c0000, /* lwz r0,0(r12) */ + 0x804c0004, /* lwz r2,4(r12) */ + 0x7c0903a6, /* mtctr r0 */ + 0x4e800420, /* bctr */ + 0x0, /* start of traceback table */ + 0x000c8000, /* traceback table */ + 0x0 /* traceback table */ +}; + +#define XCOFF_GLINK_SIZE \ + (((sizeof xcoff_glink_code / sizeof xcoff_glink_code[0]) * 4) + 4) + +/* We reuse the SEC_ROM flag as a mark flag for garbage collection. + This flag will only be used on input sections. */ + +#define SEC_MARK (SEC_ROM) + +/* The ldhdr structure. This appears at the start of the .loader + section. */ + +struct internal_ldhdr { + /* The version number: currently always 1. */ + unsigned long l_version; + /* The number of symbol table entries. */ + bfd_size_type l_nsyms; + /* The number of relocation table entries. */ + bfd_size_type l_nreloc; + /* The length of the import file string table. */ + bfd_size_type l_istlen; + /* The number of import files. */ + bfd_size_type l_nimpid; + /* The offset from the start of the .loader section to the first + entry in the import file table. */ + bfd_size_type l_impoff; + /* The length of the string table. */ + bfd_size_type l_stlen; + /* The offset from the start of the .loader section to the first + entry in the string table. */ + bfd_size_type l_stoff; +}; + +struct external_ldhdr { + bfd_byte l_version[4]; + bfd_byte l_nsyms[4]; + bfd_byte l_nreloc[4]; + bfd_byte l_istlen[4]; + bfd_byte l_nimpid[4]; + bfd_byte l_impoff[4]; + bfd_byte l_stlen[4]; + bfd_byte l_stoff[4]; +}; + +#define LDHDRSZ (8 * 4) + +/* The ldsym structure. This is used to represent a symbol in the + .loader section. */ + +struct internal_ldsym { + union { + /* The symbol name if <= SYMNMLEN characters. */ + char _l_name[SYMNMLEN]; + struct { + /* Zero if the symbol name is more than SYMNMLEN characters. */ + long _l_zeroes; + /* The offset in the string table if the symbol name is more + than SYMNMLEN characters. */ + long _l_offset; + } _l_l; + } _l; + /* The symbol value. */ + bfd_vma l_value; + /* The symbol section number. */ + short l_scnum; + /* The symbol type and flags. */ + char l_smtype; + /* The symbol storage class. */ + char l_smclas; + /* The import file ID. */ + bfd_size_type l_ifile; + /* Offset to the parameter type check string. */ + bfd_size_type l_parm; +}; + +struct external_ldsym { + union { + bfd_byte _l_name[SYMNMLEN]; + struct { + bfd_byte _l_zeroes[4]; + bfd_byte _l_offset[4]; + } _l_l; + } _l; + bfd_byte l_value[4]; + bfd_byte l_scnum[2]; + bfd_byte l_smtype[1]; + bfd_byte l_smclas[1]; + bfd_byte l_ifile[4]; + bfd_byte l_parm[4]; +}; + +#define LDSYMSZ (8 + 3 * 4 + 2 + 2) + +/* These flags are for the l_smtype field (the lower three bits are an + XTY_* value). */ + +/* Imported symbol. */ +#define L_IMPORT (0x40) +/* Entry point. */ +#define L_ENTRY (0x20) +/* Exported symbol. */ +#define L_EXPORT (0x10) + +/* The ldrel structure. This is used to represent a reloc in the + .loader section. */ + +struct internal_ldrel { + /* The reloc address. */ + bfd_vma l_vaddr; + /* The symbol table index in the .loader section symbol table. */ + bfd_size_type l_symndx; + /* The relocation type and size. */ + short l_rtype; + /* The section number this relocation applies to. */ + short l_rsecnm; +}; + +struct external_ldrel { + bfd_byte l_vaddr[4]; + bfd_byte l_symndx[4]; + bfd_byte l_rtype[2]; + bfd_byte l_rsecnm[2]; +}; + +#define LDRELSZ (2 * 4 + 2 * 2) + +/* The list of import files. */ + +struct xcoff_import_file { + /* The next entry in the list. */ + struct xcoff_import_file *next; + /* The path. */ + const char *path; + /* The file name. */ + const char *file; + /* The member name. */ + const char *member; +}; + +/* An entry in the XCOFF linker hash table. */ + +struct xcoff_link_hash_entry { + struct bfd_link_hash_entry root; + + /* Symbol index in output file. Set to -1 initially. Set to -2 if + there is a reloc against this symbol. */ + long indx; + + /* If we have created a TOC entry for this symbol, this is the .tc + section which holds it. */ + asection *toc_section; + + union { + /* If we have created a TOC entry (the XCOFF_SET_TOC flag is set), + this is the offset in toc_section. */ + bfd_vma toc_offset; + /* If the TOC entry comes from an input file, this is set to the + symbol index of the C_HIDEXT XMC_TC or XMC_TD symbol. */ + long toc_indx; + } u; + + /* If this symbol is a function entry point which is called, this + field holds a pointer to the function descriptor. If this symbol + is a function descriptor, this field holds a pointer to the + function entry point. */ + struct xcoff_link_hash_entry *descriptor; + + /* The .loader symbol table entry, if there is one. */ + struct internal_ldsym *ldsym; + + /* If XCOFF_BUILT_LDSYM is set, this is the .loader symbol table + index. If XCOFF_BUILD_LDSYM is clear, and XCOFF_IMPORT is set, + this is the l_ifile value. */ + long ldindx; + + /* Some linker flags. */ + unsigned short flags; + /* Symbol is referenced by a regular object. */ +#define XCOFF_REF_REGULAR (01) + /* Symbol is defined by a regular object. */ +#define XCOFF_DEF_REGULAR (02) + /* Symbol is defined by a dynamic object. */ +#define XCOFF_DEF_DYNAMIC (04) + /* Symbol is used in a reloc being copied into the .loader section. */ +#define XCOFF_LDREL (010) + /* Symbol is the entry point. */ +#define XCOFF_ENTRY (020) + /* Symbol is called; this is, it appears in a R_BR reloc. */ +#define XCOFF_CALLED (040) + /* Symbol needs the TOC entry filled in. */ +#define XCOFF_SET_TOC (0100) + /* Symbol is explicitly imported. */ +#define XCOFF_IMPORT (0200) + /* Symbol is explicitly exported. */ +#define XCOFF_EXPORT (0400) + /* Symbol has been processed by xcoff_build_ldsyms. */ +#define XCOFF_BUILT_LDSYM (01000) + /* Symbol is mentioned by a section which was not garbage collected. */ +#define XCOFF_MARK (02000) + /* Symbol size is recorded in size_list list from hash table. */ +#define XCOFF_HAS_SIZE (04000) + /* Symbol is a function descriptor. */ +#define XCOFF_DESCRIPTOR (010000) + /* Multiple definitions have been for the symbol. */ +#define XCOFF_MULTIPLY_DEFINED (020000) + + /* The storage mapping class. */ + unsigned char smclas; +}; + +/* The XCOFF linker hash table. */ + +struct xcoff_link_hash_table { + struct bfd_link_hash_table root; + + /* The .debug string hash table. We need to compute this while + reading the input files, so that we know how large the .debug + section will be before we assign section positions. */ + struct bfd_strtab_hash *debug_strtab; + + /* The .debug section we will use for the final output. */ + asection *debug_section; + + /* The .loader section we will use for the final output. */ + asection *loader_section; + + /* A count of non TOC relative relocs which will need to be + allocated in the .loader section. */ + size_t ldrel_count; + + /* The .loader section header. */ + struct internal_ldhdr ldhdr; + + /* The .gl section we use to hold global linkage code. */ + asection *linkage_section; + + /* The .tc section we use to hold toc entries we build for global + linkage code. */ + asection *toc_section; + + /* The .ds section we use to hold function descriptors which we + create for exported symbols. */ + asection *descriptor_section; + + /* The list of import files. */ + struct xcoff_import_file *imports; + + /* Required alignment of sections within the output file. */ + unsigned long file_align; + + /* Whether the .text section must be read-only. */ + boolean textro; + + /* Whether garbage collection was done. */ + boolean gc; + + /* A linked list of symbols for which we have size information. */ + struct xcoff_link_size_list { + struct xcoff_link_size_list *next; + struct xcoff_link_hash_entry *h; + bfd_size_type size; + } *size_list; + + /* Magic sections: _text, _etext, _data, _edata, _end, end. */ + asection *special_sections[6]; +}; + +/* Information we keep for each section in the output file during the + final link phase. */ + +struct xcoff_link_section_info { + /* The relocs to be output. */ + struct internal_reloc *relocs; + /* For each reloc against a global symbol whose index was not known + when the reloc was handled, the global hash table entry. */ + struct xcoff_link_hash_entry **rel_hashes; + /* If there is a TOC relative reloc against a global symbol, and the + index of the TOC symbol is not known when the reloc was handled, + an entry is added to this linked list. This is not an array, + like rel_hashes, because this case is quite uncommon. */ + struct xcoff_toc_rel_hash { + struct xcoff_toc_rel_hash *next; + struct xcoff_link_hash_entry *h; + struct internal_reloc *rel; + } *toc_rel_hashes; +}; + +/* Information that we pass around while doing the final link step. */ + +struct xcoff_final_link_info { + /* General link information. */ + struct bfd_link_info *info; + /* Output BFD. */ + bfd *output_bfd; + /* Hash table for long symbol names. */ + struct bfd_strtab_hash *strtab; + /* Array of information kept for each output section, indexed by the + target_index field. */ + struct xcoff_link_section_info *section_info; + /* Symbol index of last C_FILE symbol (-1 if none). */ + long last_file_index; + /* Contents of last C_FILE symbol. */ + struct internal_syment last_file; + /* Symbol index of TOC symbol. */ + long toc_symindx; + /* Start of .loader symbols. */ + struct external_ldsym *ldsym; + /* Next .loader reloc to swap out. */ + struct external_ldrel *ldrel; + /* File position of start of line numbers. */ + file_ptr line_filepos; + /* Buffer large enough to hold swapped symbols of any input file. */ + struct internal_syment *internal_syms; + /* Buffer large enough to hold output indices of symbols of any + input file. */ + long *sym_indices; + /* Buffer large enough to hold output symbols for any input file. */ + bfd_byte *outsyms; + /* Buffer large enough to hold external line numbers for any input + section. */ + bfd_byte *linenos; + /* Buffer large enough to hold any input section. */ + bfd_byte *contents; + /* Buffer large enough to hold external relocs of any input section. */ + bfd_byte *external_relocs; +}; + +static void xcoff_swap_ldhdr_in + PARAMS ((bfd *, const struct external_ldhdr *, struct internal_ldhdr *)); +static void xcoff_swap_ldhdr_out + PARAMS ((bfd *, const struct internal_ldhdr *, struct external_ldhdr *)); +static void xcoff_swap_ldsym_in + PARAMS ((bfd *, const struct external_ldsym *, struct internal_ldsym *)); +static void xcoff_swap_ldsym_out + PARAMS ((bfd *, const struct internal_ldsym *, struct external_ldsym *)); +static void xcoff_swap_ldrel_in + PARAMS ((bfd *, const struct external_ldrel *, struct internal_ldrel *)); +static void xcoff_swap_ldrel_out + PARAMS ((bfd *, const struct internal_ldrel *, struct external_ldrel *)); +static struct bfd_hash_entry *xcoff_link_hash_newfunc + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); +static boolean xcoff_get_section_contents PARAMS ((bfd *, asection *)); +static struct internal_reloc *xcoff_read_internal_relocs + PARAMS ((bfd *, asection *, boolean, bfd_byte *, boolean, + struct internal_reloc *)); +static boolean xcoff_link_add_object_symbols + PARAMS ((bfd *, struct bfd_link_info *)); +static boolean xcoff_link_check_archive_element + PARAMS ((bfd *, struct bfd_link_info *, boolean *)); +static boolean xcoff_link_check_ar_symbols + PARAMS ((bfd *, struct bfd_link_info *, boolean *)); +static boolean xcoff_link_check_dynamic_ar_symbols + PARAMS ((bfd *, struct bfd_link_info *, boolean *)); +static bfd_size_type xcoff_find_reloc + PARAMS ((struct internal_reloc *, bfd_size_type, bfd_vma)); +static boolean xcoff_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *)); +static boolean xcoff_link_add_dynamic_symbols + PARAMS ((bfd *, struct bfd_link_info *)); +static boolean xcoff_mark_symbol + PARAMS ((struct bfd_link_info *, struct xcoff_link_hash_entry *)); +static boolean xcoff_mark PARAMS ((struct bfd_link_info *, asection *)); +static void xcoff_sweep PARAMS ((struct bfd_link_info *)); +static boolean xcoff_build_ldsyms + PARAMS ((struct xcoff_link_hash_entry *, PTR)); +static boolean xcoff_link_input_bfd + PARAMS ((struct xcoff_final_link_info *, bfd *)); +static boolean xcoff_write_global_symbol + PARAMS ((struct xcoff_link_hash_entry *, PTR)); +static boolean xcoff_reloc_link_order + PARAMS ((bfd *, struct xcoff_final_link_info *, asection *, + struct bfd_link_order *)); +static int xcoff_sort_relocs PARAMS ((const PTR, const PTR)); + +/* Routines to swap information in the XCOFF .loader section. If we + ever need to write an XCOFF loader, this stuff will need to be + moved to another file shared by the linker (which XCOFF calls the + ``binder'') and the loader. */ + +/* Swap in the ldhdr structure. */ + +static void +xcoff_swap_ldhdr_in (abfd, src, dst) + bfd *abfd; + const struct external_ldhdr *src; + struct internal_ldhdr *dst; +{ + dst->l_version = bfd_get_32 (abfd, src->l_version); + dst->l_nsyms = bfd_get_32 (abfd, src->l_nsyms); + dst->l_nreloc = bfd_get_32 (abfd, src->l_nreloc); + dst->l_istlen = bfd_get_32 (abfd, src->l_istlen); + dst->l_nimpid = bfd_get_32 (abfd, src->l_nimpid); + dst->l_impoff = bfd_get_32 (abfd, src->l_impoff); + dst->l_stlen = bfd_get_32 (abfd, src->l_stlen); + dst->l_stoff = bfd_get_32 (abfd, src->l_stoff); +} + +/* Swap out the ldhdr structure. */ + +static void +xcoff_swap_ldhdr_out (abfd, src, dst) + bfd *abfd; + const struct internal_ldhdr *src; + struct external_ldhdr *dst; +{ + bfd_put_32 (abfd, src->l_version, dst->l_version); + bfd_put_32 (abfd, src->l_nsyms, dst->l_nsyms); + bfd_put_32 (abfd, src->l_nreloc, dst->l_nreloc); + bfd_put_32 (abfd, src->l_istlen, dst->l_istlen); + bfd_put_32 (abfd, src->l_nimpid, dst->l_nimpid); + bfd_put_32 (abfd, src->l_impoff, dst->l_impoff); + bfd_put_32 (abfd, src->l_stlen, dst->l_stlen); + bfd_put_32 (abfd, src->l_stoff, dst->l_stoff); +} + +/* Swap in the ldsym structure. */ + +static void +xcoff_swap_ldsym_in (abfd, src, dst) + bfd *abfd; + const struct external_ldsym *src; + struct internal_ldsym *dst; +{ + if (bfd_get_32 (abfd, src->_l._l_l._l_zeroes) != 0) + memcpy (dst->_l._l_name, src->_l._l_name, SYMNMLEN); + else + { + dst->_l._l_l._l_zeroes = 0; + dst->_l._l_l._l_offset = bfd_get_32 (abfd, src->_l._l_l._l_offset); + } + dst->l_value = bfd_get_32 (abfd, src->l_value); + dst->l_scnum = bfd_get_16 (abfd, src->l_scnum); + dst->l_smtype = bfd_get_8 (abfd, src->l_smtype); + dst->l_smclas = bfd_get_8 (abfd, src->l_smclas); + dst->l_ifile = bfd_get_32 (abfd, src->l_ifile); + dst->l_parm = bfd_get_32 (abfd, src->l_parm); +} + +/* Swap out the ldsym structure. */ + +static void +xcoff_swap_ldsym_out (abfd, src, dst) + bfd *abfd; + const struct internal_ldsym *src; + struct external_ldsym *dst; +{ + if (src->_l._l_l._l_zeroes != 0) + memcpy (dst->_l._l_name, src->_l._l_name, SYMNMLEN); + else + { + bfd_put_32 (abfd, 0, dst->_l._l_l._l_zeroes); + bfd_put_32 (abfd, src->_l._l_l._l_offset, dst->_l._l_l._l_offset); + } + bfd_put_32 (abfd, src->l_value, dst->l_value); + bfd_put_16 (abfd, src->l_scnum, dst->l_scnum); + bfd_put_8 (abfd, src->l_smtype, dst->l_smtype); + bfd_put_8 (abfd, src->l_smclas, dst->l_smclas); + bfd_put_32 (abfd, src->l_ifile, dst->l_ifile); + bfd_put_32 (abfd, src->l_parm, dst->l_parm); +} + +/* Swap in the ldrel structure. */ + +static void +xcoff_swap_ldrel_in (abfd, src, dst) + bfd *abfd; + const struct external_ldrel *src; + struct internal_ldrel *dst; +{ + dst->l_vaddr = bfd_get_32 (abfd, src->l_vaddr); + dst->l_symndx = bfd_get_32 (abfd, src->l_symndx); + dst->l_rtype = bfd_get_16 (abfd, src->l_rtype); + dst->l_rsecnm = bfd_get_16 (abfd, src->l_rsecnm); +} + +/* Swap out the ldrel structure. */ + +static void +xcoff_swap_ldrel_out (abfd, src, dst) + bfd *abfd; + const struct internal_ldrel *src; + struct external_ldrel *dst; +{ + bfd_put_32 (abfd, src->l_vaddr, dst->l_vaddr); + bfd_put_32 (abfd, src->l_symndx, dst->l_symndx); + bfd_put_16 (abfd, src->l_rtype, dst->l_rtype); + bfd_put_16 (abfd, src->l_rsecnm, dst->l_rsecnm); +} + +/* Routines to read XCOFF dynamic information. This don't really + belong here, but we already have the ldsym manipulation routines + here. */ + +/* Read the contents of a section. */ + +static boolean +xcoff_get_section_contents (abfd, sec) + bfd *abfd; + asection *sec; +{ + if (coff_section_data (abfd, sec) == NULL) + { + sec->used_by_bfd = bfd_zalloc (abfd, + sizeof (struct coff_section_tdata)); + if (sec->used_by_bfd == NULL) + return false; + } + + if (coff_section_data (abfd, sec)->contents == NULL) + { + coff_section_data (abfd, sec)->contents = + (bfd_byte *) bfd_malloc (sec->_raw_size); + if (coff_section_data (abfd, sec)->contents == NULL) + return false; + + if (! bfd_get_section_contents (abfd, sec, + coff_section_data (abfd, sec)->contents, + (file_ptr) 0, sec->_raw_size)) + return false; + } + + return true; +} + +/* Get the size required to hold the dynamic symbols. */ + +long +_bfd_xcoff_get_dynamic_symtab_upper_bound (abfd) + bfd *abfd; +{ + asection *lsec; + bfd_byte *contents; + struct internal_ldhdr ldhdr; + + if ((abfd->flags & DYNAMIC) == 0) + { + bfd_set_error (bfd_error_invalid_operation); + return -1; + } + + lsec = bfd_get_section_by_name (abfd, ".loader"); + if (lsec == NULL) + { + bfd_set_error (bfd_error_no_symbols); + return -1; + } + + if (! xcoff_get_section_contents (abfd, lsec)) + return -1; + contents = coff_section_data (abfd, lsec)->contents; + + xcoff_swap_ldhdr_in (abfd, (struct external_ldhdr *) contents, &ldhdr); + + return (ldhdr.l_nsyms + 1) * sizeof (asymbol *); +} + +/* Get the dynamic symbols. */ + +long +_bfd_xcoff_canonicalize_dynamic_symtab (abfd, psyms) + bfd *abfd; + asymbol **psyms; +{ + asection *lsec; + bfd_byte *contents; + struct internal_ldhdr ldhdr; + const char *strings; + struct external_ldsym *elsym, *elsymend; + coff_symbol_type *symbuf; + + if ((abfd->flags & DYNAMIC) == 0) + { + bfd_set_error (bfd_error_invalid_operation); + return -1; + } + + lsec = bfd_get_section_by_name (abfd, ".loader"); + if (lsec == NULL) + { + bfd_set_error (bfd_error_no_symbols); + return -1; + } + + if (! xcoff_get_section_contents (abfd, lsec)) + return -1; + contents = coff_section_data (abfd, lsec)->contents; + + coff_section_data (abfd, lsec)->keep_contents = true; + + xcoff_swap_ldhdr_in (abfd, (struct external_ldhdr *) contents, &ldhdr); + + strings = (char *) contents + ldhdr.l_stoff; + + symbuf = ((coff_symbol_type *) + bfd_zalloc (abfd, ldhdr.l_nsyms * sizeof (coff_symbol_type))); + if (symbuf == NULL) + return -1; + + elsym = (struct external_ldsym *) (contents + LDHDRSZ); + elsymend = elsym + ldhdr.l_nsyms; + for (; elsym < elsymend; elsym++, symbuf++, psyms++) + { + struct internal_ldsym ldsym; + + xcoff_swap_ldsym_in (abfd, elsym, &ldsym); + + symbuf->symbol.the_bfd = abfd; + + if (ldsym._l._l_l._l_zeroes == 0) + symbuf->symbol.name = strings + ldsym._l._l_l._l_offset; + else + { + int i; + + for (i = 0; i < SYMNMLEN; i++) + if (ldsym._l._l_name[i] == '\0') + break; + if (i < SYMNMLEN) + symbuf->symbol.name = (char *) elsym->_l._l_name; + else + { + char *c; + + c = bfd_alloc (abfd, SYMNMLEN + 1); + if (c == NULL) + return -1; + memcpy (c, ldsym._l._l_name, SYMNMLEN); + c[SYMNMLEN] = '\0'; + symbuf->symbol.name = c; + } + } + + if (ldsym.l_smclas == XMC_XO) + symbuf->symbol.section = bfd_abs_section_ptr; + else + symbuf->symbol.section = coff_section_from_bfd_index (abfd, + ldsym.l_scnum); + symbuf->symbol.value = ldsym.l_value - symbuf->symbol.section->vma; + + symbuf->symbol.flags = BSF_NO_FLAGS; + if ((ldsym.l_smtype & L_EXPORT) != 0) + symbuf->symbol.flags |= BSF_GLOBAL; + + /* FIXME: We have no way to record the other information stored + with the loader symbol. */ + + *psyms = (asymbol *) symbuf; + } + + *psyms = NULL; + + return ldhdr.l_nsyms; +} + +/* Get the size required to hold the dynamic relocs. */ + +long +_bfd_xcoff_get_dynamic_reloc_upper_bound (abfd) + bfd *abfd; +{ + asection *lsec; + bfd_byte *contents; + struct internal_ldhdr ldhdr; + + if ((abfd->flags & DYNAMIC) == 0) + { + bfd_set_error (bfd_error_invalid_operation); + return -1; + } + + lsec = bfd_get_section_by_name (abfd, ".loader"); + if (lsec == NULL) + { + bfd_set_error (bfd_error_no_symbols); + return -1; + } + + if (! xcoff_get_section_contents (abfd, lsec)) + return -1; + contents = coff_section_data (abfd, lsec)->contents; + + xcoff_swap_ldhdr_in (abfd, (struct external_ldhdr *) contents, &ldhdr); + + return (ldhdr.l_nreloc + 1) * sizeof (arelent *); +} + +/* The typical dynamic reloc. */ + +static reloc_howto_type xcoff_dynamic_reloc = + HOWTO (0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_POS", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false); /* pcrel_offset */ + +/* Get the dynamic relocs. */ + +long +_bfd_xcoff_canonicalize_dynamic_reloc (abfd, prelocs, syms) + bfd *abfd; + arelent **prelocs; + asymbol **syms; +{ + asection *lsec; + bfd_byte *contents; + struct internal_ldhdr ldhdr; + arelent *relbuf; + struct external_ldrel *elrel, *elrelend; + + if ((abfd->flags & DYNAMIC) == 0) + { + bfd_set_error (bfd_error_invalid_operation); + return -1; + } + + lsec = bfd_get_section_by_name (abfd, ".loader"); + if (lsec == NULL) + { + bfd_set_error (bfd_error_no_symbols); + return -1; + } + + if (! xcoff_get_section_contents (abfd, lsec)) + return -1; + contents = coff_section_data (abfd, lsec)->contents; + + xcoff_swap_ldhdr_in (abfd, (struct external_ldhdr *) contents, &ldhdr); + + relbuf = (arelent *) bfd_alloc (abfd, ldhdr.l_nreloc * sizeof (arelent)); + if (relbuf == NULL) + return -1; + + elrel = ((struct external_ldrel *) + (contents + LDHDRSZ + ldhdr.l_nsyms * LDSYMSZ)); + elrelend = elrel + ldhdr.l_nreloc; + for (; elrel < elrelend; elrel++, relbuf++, prelocs++) + { + struct internal_ldrel ldrel; + + xcoff_swap_ldrel_in (abfd, elrel, &ldrel); + + if (ldrel.l_symndx >= 3) + relbuf->sym_ptr_ptr = syms + (ldrel.l_symndx - 3); + else + { + const char *name; + asection *sec; + + switch (ldrel.l_symndx) + { + case 0: + name = ".text"; + break; + case 1: + name = ".data"; + break; + case 2: + name = ".bss"; + break; + default: + abort (); + break; + } + + sec = bfd_get_section_by_name (abfd, name); + if (sec == NULL) + { + bfd_set_error (bfd_error_bad_value); + return -1; + } + + relbuf->sym_ptr_ptr = sec->symbol_ptr_ptr; + } + + relbuf->address = ldrel.l_vaddr; + relbuf->addend = 0; + + /* Most dynamic relocs have the same type. FIXME: This is only + correct if ldrel.l_rtype == 0. In other cases, we should use + a different howto. */ + relbuf->howto = &xcoff_dynamic_reloc; + + /* FIXME: We have no way to record the l_rsecnm field. */ + + *prelocs = relbuf; + } + + *prelocs = NULL; + + return ldhdr.l_nreloc; +} + +/* Routine to create an entry in an XCOFF link hash table. */ + +static struct bfd_hash_entry * +xcoff_link_hash_newfunc (entry, table, string) + struct bfd_hash_entry *entry; + struct bfd_hash_table *table; + const char *string; +{ + struct xcoff_link_hash_entry *ret = (struct xcoff_link_hash_entry *) entry; + + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (ret == (struct xcoff_link_hash_entry *) NULL) + ret = ((struct xcoff_link_hash_entry *) + bfd_hash_allocate (table, sizeof (struct xcoff_link_hash_entry))); + if (ret == (struct xcoff_link_hash_entry *) NULL) + return (struct bfd_hash_entry *) ret; + + /* Call the allocation method of the superclass. */ + ret = ((struct xcoff_link_hash_entry *) + _bfd_link_hash_newfunc ((struct bfd_hash_entry *) ret, + table, string)); + if (ret != NULL) + { + /* Set local fields. */ + ret->indx = -1; + ret->toc_section = NULL; + ret->u.toc_indx = -1; + ret->descriptor = NULL; + ret->ldsym = NULL; + ret->ldindx = -1; + ret->flags = 0; + ret->smclas = XMC_UA; + } + + return (struct bfd_hash_entry *) ret; +} + +/* Create a XCOFF link hash table. */ + +struct bfd_link_hash_table * +_bfd_xcoff_bfd_link_hash_table_create (abfd) + bfd *abfd; +{ + struct xcoff_link_hash_table *ret; + + ret = ((struct xcoff_link_hash_table *) + bfd_alloc (abfd, sizeof (struct xcoff_link_hash_table))); + if (ret == (struct xcoff_link_hash_table *) NULL) + return (struct bfd_link_hash_table *) NULL; + if (! _bfd_link_hash_table_init (&ret->root, abfd, xcoff_link_hash_newfunc)) + { + bfd_release (abfd, ret); + return (struct bfd_link_hash_table *) NULL; + } + + ret->debug_strtab = _bfd_xcoff_stringtab_init (); + ret->debug_section = NULL; + ret->loader_section = NULL; + ret->ldrel_count = 0; + memset (&ret->ldhdr, 0, sizeof (struct internal_ldhdr)); + ret->linkage_section = NULL; + ret->toc_section = NULL; + ret->descriptor_section = NULL; + ret->imports = NULL; + ret->file_align = 0; + ret->textro = false; + ret->gc = false; + memset (ret->special_sections, 0, sizeof ret->special_sections); + + /* The linker will always generate a full a.out header. We need to + record that fact now, before the sizeof_headers routine could be + called. */ + xcoff_data (abfd)->full_aouthdr = true; + + return &ret->root; +} + +/* Look up an entry in an XCOFF link hash table. */ + +#define xcoff_link_hash_lookup(table, string, create, copy, follow) \ + ((struct xcoff_link_hash_entry *) \ + bfd_link_hash_lookup (&(table)->root, (string), (create), (copy),\ + (follow))) + +/* Traverse an XCOFF link hash table. */ + +#define xcoff_link_hash_traverse(table, func, info) \ + (bfd_link_hash_traverse \ + (&(table)->root, \ + (boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func), \ + (info))) + +/* Get the XCOFF link hash table from the info structure. This is + just a cast. */ + +#define xcoff_hash_table(p) ((struct xcoff_link_hash_table *) ((p)->hash)) + +/* Read internal relocs for an XCOFF csect. This is a wrapper around + _bfd_coff_read_internal_relocs which tries to take advantage of any + relocs which may have been cached for the enclosing section. */ + +static struct internal_reloc * +xcoff_read_internal_relocs (abfd, sec, cache, external_relocs, + require_internal, internal_relocs) + bfd *abfd; + asection *sec; + boolean cache; + bfd_byte *external_relocs; + boolean require_internal; + struct internal_reloc *internal_relocs; +{ + if (coff_section_data (abfd, sec) != NULL + && coff_section_data (abfd, sec)->relocs == NULL + && xcoff_section_data (abfd, sec) != NULL) + { + asection *enclosing; + + enclosing = xcoff_section_data (abfd, sec)->enclosing; + + if (enclosing != NULL + && (coff_section_data (abfd, enclosing) == NULL + || coff_section_data (abfd, enclosing)->relocs == NULL) + && cache + && enclosing->reloc_count > 0) + { + if (_bfd_coff_read_internal_relocs (abfd, enclosing, true, + external_relocs, false, + (struct internal_reloc *) NULL) + == NULL) + return NULL; + } + + if (enclosing != NULL + && coff_section_data (abfd, enclosing) != NULL + && coff_section_data (abfd, enclosing)->relocs != NULL) + { + size_t off; + + off = ((sec->rel_filepos - enclosing->rel_filepos) + / bfd_coff_relsz (abfd)); + if (! require_internal) + return coff_section_data (abfd, enclosing)->relocs + off; + memcpy (internal_relocs, + coff_section_data (abfd, enclosing)->relocs + off, + sec->reloc_count * sizeof (struct internal_reloc)); + return internal_relocs; + } + } + + return _bfd_coff_read_internal_relocs (abfd, sec, cache, external_relocs, + require_internal, internal_relocs); +} + +/* Given an XCOFF BFD, add symbols to the global hash table as + appropriate. */ + +boolean +_bfd_xcoff_bfd_link_add_symbols (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + switch (bfd_get_format (abfd)) + { + case bfd_object: + return xcoff_link_add_object_symbols (abfd, info); + + case bfd_archive: + /* If the archive has a map, do the usual search. We then need + to check the archive for stripped dynamic objects, because + they will not appear in the archive map even though they + should, perhaps, be included. If the archive has no map, we + just consider each object file in turn, since that apparently + is what the AIX native linker does. */ + if (bfd_has_map (abfd)) + { + if (! (_bfd_generic_link_add_archive_symbols + (abfd, info, xcoff_link_check_archive_element))) + return false; + } + + { + bfd *member; + + member = bfd_openr_next_archived_file (abfd, (bfd *) NULL); + while (member != NULL) + { + if (bfd_check_format (member, bfd_object) + && (! bfd_has_map (abfd) + || ((member->flags & DYNAMIC) != 0 + && (member->flags & HAS_SYMS) == 0))) + { + boolean needed; + + if (! xcoff_link_check_archive_element (member, info, &needed)) + return false; + if (needed) + member->archive_pass = -1; + } + member = bfd_openr_next_archived_file (abfd, member); + } + } + + return true; + + default: + bfd_set_error (bfd_error_wrong_format); + return false; + } +} + +/* Add symbols from an XCOFF object file. */ + +static boolean +xcoff_link_add_object_symbols (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + if (! _bfd_coff_get_external_symbols (abfd)) + return false; + if (! xcoff_link_add_symbols (abfd, info)) + return false; + if (! info->keep_memory) + { + if (! _bfd_coff_free_symbols (abfd)) + return false; + } + return true; +} + +/* Check a single archive element to see if we need to include it in + the link. *PNEEDED is set according to whether this element is + needed in the link or not. This is called via + _bfd_generic_link_add_archive_symbols. */ + +static boolean +xcoff_link_check_archive_element (abfd, info, pneeded) + bfd *abfd; + struct bfd_link_info *info; + boolean *pneeded; +{ + if (! _bfd_coff_get_external_symbols (abfd)) + return false; + + if (! xcoff_link_check_ar_symbols (abfd, info, pneeded)) + return false; + + if (*pneeded) + { + if (! xcoff_link_add_symbols (abfd, info)) + return false; + } + + if (! info->keep_memory || ! *pneeded) + { + if (! _bfd_coff_free_symbols (abfd)) + return false; + } + + return true; +} + +/* Look through the symbols to see if this object file should be + included in the link. */ + +static boolean +xcoff_link_check_ar_symbols (abfd, info, pneeded) + bfd *abfd; + struct bfd_link_info *info; + boolean *pneeded; +{ + bfd_size_type symesz; + bfd_byte *esym; + bfd_byte *esym_end; + + *pneeded = false; + + if ((abfd->flags & DYNAMIC) != 0 + && ! info->static_link + && info->hash->creator == abfd->xvec) + return xcoff_link_check_dynamic_ar_symbols (abfd, info, pneeded); + + symesz = bfd_coff_symesz (abfd); + esym = (bfd_byte *) obj_coff_external_syms (abfd); + esym_end = esym + obj_raw_syment_count (abfd) * symesz; + while (esym < esym_end) + { + struct internal_syment sym; + + bfd_coff_swap_sym_in (abfd, (PTR) esym, (PTR) &sym); + + if (sym.n_sclass == C_EXT && sym.n_scnum != N_UNDEF) + { + const char *name; + char buf[SYMNMLEN + 1]; + struct bfd_link_hash_entry *h; + + /* This symbol is externally visible, and is defined by this + object file. */ + + name = _bfd_coff_internal_syment_name (abfd, &sym, buf); + if (name == NULL) + return false; + h = bfd_link_hash_lookup (info->hash, name, false, false, true); + + /* We are only interested in symbols that are currently + undefined. If a symbol is currently known to be common, + XCOFF linkers do not bring in an object file which + defines it. We also don't bring in symbols to satisfy + undefined references in shared objects. */ + if (h != (struct bfd_link_hash_entry *) NULL + && h->type == bfd_link_hash_undefined + && (info->hash->creator != abfd->xvec + || (((struct xcoff_link_hash_entry *) h)->flags + & XCOFF_DEF_DYNAMIC) == 0)) + { + if (! (*info->callbacks->add_archive_element) (info, abfd, name)) + return false; + *pneeded = true; + return true; + } + } + + esym += (sym.n_numaux + 1) * symesz; + } + + /* We do not need this object file. */ + return true; +} + +/* Look through the loader symbols to see if this dynamic object + should be included in the link. The native linker uses the loader + symbols, not the normal symbol table, so we do too. */ + +static boolean +xcoff_link_check_dynamic_ar_symbols (abfd, info, pneeded) + bfd *abfd; + struct bfd_link_info *info; + boolean *pneeded; +{ + asection *lsec; + bfd_byte *buf; + struct internal_ldhdr ldhdr; + const char *strings; + struct external_ldsym *elsym, *elsymend; + + *pneeded = false; + + lsec = bfd_get_section_by_name (abfd, ".loader"); + if (lsec == NULL) + { + /* There are no symbols, so don't try to include it. */ + return true; + } + + if (! xcoff_get_section_contents (abfd, lsec)) + return false; + buf = coff_section_data (abfd, lsec)->contents; + + xcoff_swap_ldhdr_in (abfd, (struct external_ldhdr *) buf, &ldhdr); + + strings = (char *) buf + ldhdr.l_stoff; + + elsym = (struct external_ldsym *) (buf + LDHDRSZ); + elsymend = elsym + ldhdr.l_nsyms; + for (; elsym < elsymend; elsym++) + { + struct internal_ldsym ldsym; + char nambuf[SYMNMLEN + 1]; + const char *name; + struct bfd_link_hash_entry *h; + + xcoff_swap_ldsym_in (abfd, elsym, &ldsym); + + /* We are only interested in exported symbols. */ + if ((ldsym.l_smtype & L_EXPORT) == 0) + continue; + + if (ldsym._l._l_l._l_zeroes == 0) + name = strings + ldsym._l._l_l._l_offset; + else + { + memcpy (nambuf, ldsym._l._l_name, SYMNMLEN); + nambuf[SYMNMLEN] = '\0'; + name = nambuf; + } + + h = bfd_link_hash_lookup (info->hash, name, false, false, true); + + /* We are only interested in symbols that are currently + undefined. At this point we know that we are using an XCOFF + hash table. */ + if (h != NULL + && h->type == bfd_link_hash_undefined + && (((struct xcoff_link_hash_entry *) h)->flags + & XCOFF_DEF_DYNAMIC) == 0) + { + if (! (*info->callbacks->add_archive_element) (info, abfd, name)) + return false; + *pneeded = true; + return true; + } + } + + /* We do not need this shared object. */ + + if (buf != NULL && ! coff_section_data (abfd, lsec)->keep_contents) + { + free (coff_section_data (abfd, lsec)->contents); + coff_section_data (abfd, lsec)->contents = NULL; + } + + return true; +} + +/* Returns the index of reloc in RELOCS with the least address greater + than or equal to ADDRESS. The relocs are sorted by address. */ + +static bfd_size_type +xcoff_find_reloc (relocs, count, address) + struct internal_reloc *relocs; + bfd_size_type count; + bfd_vma address; +{ + bfd_size_type min, max, this; + + if (count < 2) + { + if (count == 1 && relocs[0].r_vaddr < address) + return 1; + else + return 0; + } + + min = 0; + max = count; + + /* Do a binary search over (min,max]. */ + while (min + 1 < max) + { + bfd_vma raddr; + + this = (max + min) / 2; + raddr = relocs[this].r_vaddr; + if (raddr > address) + max = this; + else if (raddr < address) + min = this; + else + { + min = this; + break; + } + } + + if (relocs[min].r_vaddr < address) + return min + 1; + + while (min > 0 + && relocs[min - 1].r_vaddr == address) + --min; + + return min; +} + +/* Add all the symbols from an object file to the hash table. + + XCOFF is a weird format. A normal XCOFF .o files will have three + COFF sections--.text, .data, and .bss--but each COFF section will + contain many csects. These csects are described in the symbol + table. From the linker's point of view, each csect must be + considered a section in its own right. For example, a TOC entry is + handled as a small XMC_TC csect. The linker must be able to merge + different TOC entries together, which means that it must be able to + extract the XMC_TC csects from the .data section of the input .o + file. + + From the point of view of our linker, this is, of course, a hideous + nightmare. We cope by actually creating sections for each csect, + and discarding the original sections. We then have to handle the + relocation entries carefully, since the only way to tell which + csect they belong to is to examine the address. */ + +static boolean +xcoff_link_add_symbols (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + unsigned int n_tmask; + unsigned int n_btshft; + boolean default_copy; + bfd_size_type symcount; + struct xcoff_link_hash_entry **sym_hash; + asection **csect_cache; + bfd_size_type linesz; + asection *o; + asection *last_real; + boolean keep_syms; + asection *csect; + unsigned int csect_index; + asection *first_csect; + bfd_size_type symesz; + bfd_byte *esym; + bfd_byte *esym_end; + struct reloc_info_struct + { + struct internal_reloc *relocs; + asection **csects; + bfd_byte *linenos; + } *reloc_info = NULL; + + keep_syms = obj_coff_keep_syms (abfd); + + if ((abfd->flags & DYNAMIC) != 0 + && ! info->static_link) + { + if (! xcoff_link_add_dynamic_symbols (abfd, info)) + return false; + } + + if (info->hash->creator == abfd->xvec) + { + /* We need to build a .loader section, so we do it here. This + won't work if we're producing an XCOFF output file with no + XCOFF input files. FIXME. */ + if (xcoff_hash_table (info)->loader_section == NULL) + { + asection *lsec; + + lsec = bfd_make_section_anyway (abfd, ".loader"); + if (lsec == NULL) + goto error_return; + xcoff_hash_table (info)->loader_section = lsec; + lsec->flags |= SEC_HAS_CONTENTS | SEC_IN_MEMORY; + } + /* Likewise for the linkage section. */ + if (xcoff_hash_table (info)->linkage_section == NULL) + { + asection *lsec; + + lsec = bfd_make_section_anyway (abfd, ".gl"); + if (lsec == NULL) + goto error_return; + xcoff_hash_table (info)->linkage_section = lsec; + lsec->flags |= (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY); + lsec->alignment_power = 2; + } + /* Likewise for the TOC section. */ + if (xcoff_hash_table (info)->toc_section == NULL) + { + asection *tsec; + + tsec = bfd_make_section_anyway (abfd, ".tc"); + if (tsec == NULL) + goto error_return; + xcoff_hash_table (info)->toc_section = tsec; + tsec->flags |= (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY); + tsec->alignment_power = 2; + } + /* Likewise for the descriptor section. */ + if (xcoff_hash_table (info)->descriptor_section == NULL) + { + asection *dsec; + + dsec = bfd_make_section_anyway (abfd, ".ds"); + if (dsec == NULL) + goto error_return; + xcoff_hash_table (info)->descriptor_section = dsec; + dsec->flags |= (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY); + dsec->alignment_power = 2; + } + /* Likewise for the .debug section. */ + if (xcoff_hash_table (info)->debug_section == NULL + && info->strip != strip_all) + { + asection *dsec; + + dsec = bfd_make_section_anyway (abfd, ".debug"); + if (dsec == NULL) + goto error_return; + xcoff_hash_table (info)->debug_section = dsec; + dsec->flags |= SEC_HAS_CONTENTS | SEC_IN_MEMORY; + } + } + + if ((abfd->flags & DYNAMIC) != 0 + && ! info->static_link) + return true; + + n_tmask = coff_data (abfd)->local_n_tmask; + n_btshft = coff_data (abfd)->local_n_btshft; + + /* Define macros so that ISFCN, et. al., macros work correctly. */ +#define N_TMASK n_tmask +#define N_BTSHFT n_btshft + + if (info->keep_memory) + default_copy = false; + else + default_copy = true; + + symcount = obj_raw_syment_count (abfd); + + /* We keep a list of the linker hash table entries that correspond + to each external symbol. */ + sym_hash = ((struct xcoff_link_hash_entry **) + bfd_alloc (abfd, + (symcount + * sizeof (struct xcoff_link_hash_entry *)))); + if (sym_hash == NULL && symcount != 0) + goto error_return; + coff_data (abfd)->sym_hashes = (struct coff_link_hash_entry **) sym_hash; + memset (sym_hash, 0, + (size_t) symcount * sizeof (struct xcoff_link_hash_entry *)); + + /* Because of the weird stuff we are doing with XCOFF csects, we can + not easily determine which section a symbol is in, so we store + the information in the tdata for the input file. */ + csect_cache = ((asection **) + bfd_alloc (abfd, symcount * sizeof (asection *))); + if (csect_cache == NULL && symcount != 0) + goto error_return; + xcoff_data (abfd)->csects = csect_cache; + memset (csect_cache, 0, (size_t) symcount * sizeof (asection *)); + + /* While splitting sections into csects, we need to assign the + relocs correctly. The relocs and the csects must both be in + order by VMA within a given section, so we handle this by + scanning along the relocs as we process the csects. We index + into reloc_info using the section target_index. */ + reloc_info = ((struct reloc_info_struct *) + bfd_malloc ((abfd->section_count + 1) + * sizeof (struct reloc_info_struct))); + if (reloc_info == NULL) + goto error_return; + memset ((PTR) reloc_info, 0, + (abfd->section_count + 1) * sizeof (struct reloc_info_struct)); + + /* Read in the relocs and line numbers for each section. */ + linesz = bfd_coff_linesz (abfd); + last_real = NULL; + for (o = abfd->sections; o != NULL; o = o->next) + { + last_real = o; + if ((o->flags & SEC_RELOC) != 0) + { + reloc_info[o->target_index].relocs = + xcoff_read_internal_relocs (abfd, o, true, (bfd_byte *) NULL, + false, (struct internal_reloc *) NULL); + reloc_info[o->target_index].csects = + (asection **) bfd_malloc (o->reloc_count * sizeof (asection *)); + if (reloc_info[o->target_index].csects == NULL) + goto error_return; + memset (reloc_info[o->target_index].csects, 0, + o->reloc_count * sizeof (asection *)); + } + + if ((info->strip == strip_none || info->strip == strip_some) + && o->lineno_count > 0) + { + bfd_byte *linenos; + + linenos = (bfd_byte *) bfd_malloc (o->lineno_count * linesz); + if (linenos == NULL) + goto error_return; + reloc_info[o->target_index].linenos = linenos; + if (bfd_seek (abfd, o->line_filepos, SEEK_SET) != 0 + || (bfd_read (linenos, linesz, o->lineno_count, abfd) + != linesz * o->lineno_count)) + goto error_return; + } + } + + /* Don't let the linker relocation routines discard the symbols. */ + obj_coff_keep_syms (abfd) = true; + + csect = NULL; + csect_index = 0; + first_csect = NULL; + + symesz = bfd_coff_symesz (abfd); + BFD_ASSERT (symesz == bfd_coff_auxesz (abfd)); + esym = (bfd_byte *) obj_coff_external_syms (abfd); + esym_end = esym + symcount * symesz; + while (esym < esym_end) + { + struct internal_syment sym; + union internal_auxent aux; + const char *name; + char buf[SYMNMLEN + 1]; + int smtyp; + flagword flags; + asection *section; + bfd_vma value; + struct xcoff_link_hash_entry *set_toc; + + bfd_coff_swap_sym_in (abfd, (PTR) esym, (PTR) &sym); + + /* In this pass we are only interested in symbols with csect + information. */ + if (sym.n_sclass != C_EXT && sym.n_sclass != C_HIDEXT) + { + if (sym.n_sclass == C_FILE && csect != NULL) + { + xcoff_section_data (abfd, csect)->last_symndx = + ((esym + - (bfd_byte *) obj_coff_external_syms (abfd)) + / symesz); + csect = NULL; + } + + if (csect != NULL) + *csect_cache = csect; + else if (first_csect == NULL || sym.n_sclass == C_FILE) + *csect_cache = coff_section_from_bfd_index (abfd, sym.n_scnum); + else + *csect_cache = NULL; + esym += (sym.n_numaux + 1) * symesz; + sym_hash += sym.n_numaux + 1; + csect_cache += sym.n_numaux + 1; + continue; + } + + name = _bfd_coff_internal_syment_name (abfd, &sym, buf); + if (name == NULL) + goto error_return; + + /* If this symbol has line number information attached to it, + and we're not stripping it, count the number of entries and + add them to the count for this csect. In the final link pass + we are going to attach line number information by symbol, + rather than by section, in order to more easily handle + garbage collection. */ + if ((info->strip == strip_none || info->strip == strip_some) + && sym.n_numaux > 1 + && csect != NULL + && ISFCN (sym.n_type)) + { + union internal_auxent auxlin; + + bfd_coff_swap_aux_in (abfd, (PTR) (esym + symesz), + sym.n_type, sym.n_sclass, + 0, sym.n_numaux, (PTR) &auxlin); + if (auxlin.x_sym.x_fcnary.x_fcn.x_lnnoptr != 0) + { + asection *enclosing; + bfd_size_type linoff; + + enclosing = xcoff_section_data (abfd, csect)->enclosing; + if (enclosing == NULL) + { + (*_bfd_error_handler) + (_("%s: `%s' has line numbers but no enclosing section"), + bfd_get_filename (abfd), name); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + linoff = (auxlin.x_sym.x_fcnary.x_fcn.x_lnnoptr + - enclosing->line_filepos); + if (linoff < enclosing->lineno_count * linesz) + { + struct internal_lineno lin; + bfd_byte *linpstart; + + linpstart = (reloc_info[enclosing->target_index].linenos + + linoff); + bfd_coff_swap_lineno_in (abfd, (PTR) linpstart, (PTR) &lin); + if (lin.l_lnno == 0 + && ((bfd_size_type) lin.l_addr.l_symndx + == ((esym + - (bfd_byte *) obj_coff_external_syms (abfd)) + / symesz))) + { + bfd_byte *linpend, *linp; + + linpend = (reloc_info[enclosing->target_index].linenos + + enclosing->lineno_count * linesz); + for (linp = linpstart + linesz; + linp < linpend; + linp += linesz) + { + bfd_coff_swap_lineno_in (abfd, (PTR) linp, + (PTR) &lin); + if (lin.l_lnno == 0) + break; + } + csect->lineno_count += (linp - linpstart) / linesz; + /* The setting of line_filepos will only be + useful if all the line number entries for a + csect are contiguous; this only matters for + error reporting. */ + if (csect->line_filepos == 0) + csect->line_filepos = + auxlin.x_sym.x_fcnary.x_fcn.x_lnnoptr; + } + } + } + } + + /* Pick up the csect auxiliary information. */ + + if (sym.n_numaux == 0) + { + (*_bfd_error_handler) + (_("%s: class %d symbol `%s' has no aux entries"), + bfd_get_filename (abfd), sym.n_sclass, name); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + + bfd_coff_swap_aux_in (abfd, + (PTR) (esym + symesz * sym.n_numaux), + sym.n_type, sym.n_sclass, + sym.n_numaux - 1, sym.n_numaux, + (PTR) &aux); + + smtyp = SMTYP_SMTYP (aux.x_csect.x_smtyp); + + flags = BSF_GLOBAL; + section = NULL; + value = 0; + set_toc = NULL; + + switch (smtyp) + { + default: + (*_bfd_error_handler) + (_("%s: symbol `%s' has unrecognized csect type %d"), + bfd_get_filename (abfd), name, smtyp); + bfd_set_error (bfd_error_bad_value); + goto error_return; + + case XTY_ER: + /* This is an external reference. */ + if (sym.n_sclass == C_HIDEXT + || sym.n_scnum != N_UNDEF + || aux.x_csect.x_scnlen.l != 0) + { + (*_bfd_error_handler) + (_("%s: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d"), + bfd_get_filename (abfd), name, sym.n_sclass, sym.n_scnum, + aux.x_csect.x_scnlen.l); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + + /* An XMC_XO external reference is actually a reference to + an absolute location. */ + if (aux.x_csect.x_smclas != XMC_XO) + section = bfd_und_section_ptr; + else + { + section = bfd_abs_section_ptr; + value = sym.n_value; + } + break; + + case XTY_SD: + /* This is a csect definition. */ + + if (csect != NULL) + { + xcoff_section_data (abfd, csect)->last_symndx = + ((esym + - (bfd_byte *) obj_coff_external_syms (abfd)) + / symesz); + } + + csect = NULL; + csect_index = -1; + + /* When we see a TOC anchor, we record the TOC value. */ + if (aux.x_csect.x_smclas == XMC_TC0) + { + if (sym.n_sclass != C_HIDEXT + || aux.x_csect.x_scnlen.l != 0) + { + (*_bfd_error_handler) + (_("%s: XMC_TC0 symbol `%s' is class %d scnlen %d"), + bfd_get_filename (abfd), name, sym.n_sclass, + aux.x_csect.x_scnlen.l); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + xcoff_data (abfd)->toc = sym.n_value; + } + + /* We must merge TOC entries for the same symbol. We can + merge two TOC entries if they are both C_HIDEXT, they + both have the same name, they are both 4 bytes long, and + they both have a relocation table entry for an external + symbol with the same name. Unfortunately, this means + that we must look through the relocations. Ick. */ + if (aux.x_csect.x_smclas == XMC_TC + && sym.n_sclass == C_HIDEXT + && aux.x_csect.x_scnlen.l == 4 + && info->hash->creator == abfd->xvec) + { + asection *enclosing; + struct internal_reloc *relocs; + bfd_size_type relindx; + struct internal_reloc *rel; + + enclosing = coff_section_from_bfd_index (abfd, sym.n_scnum); + if (enclosing == NULL) + goto error_return; + + relocs = reloc_info[enclosing->target_index].relocs; + relindx = xcoff_find_reloc (relocs, enclosing->reloc_count, + sym.n_value); + rel = relocs + relindx; + if (relindx < enclosing->reloc_count + && rel->r_vaddr == (bfd_vma) sym.n_value + && rel->r_size == 31 + && rel->r_type == R_POS) + { + bfd_byte *erelsym; + struct internal_syment relsym; + + erelsym = ((bfd_byte *) obj_coff_external_syms (abfd) + + rel->r_symndx * symesz); + bfd_coff_swap_sym_in (abfd, (PTR) erelsym, (PTR) &relsym); + if (relsym.n_sclass == C_EXT) + { + const char *relname; + char relbuf[SYMNMLEN + 1]; + boolean copy; + struct xcoff_link_hash_entry *h; + + /* At this point we know that the TOC entry is + for an externally visible symbol. */ + relname = _bfd_coff_internal_syment_name (abfd, &relsym, + relbuf); + if (relname == NULL) + goto error_return; + + /* We only merge TOC entries if the TC name is + the same as the symbol name. This handles + the normal case, but not common cases like + SYM.P4 which gcc generates to store SYM + 4 + in the TOC. FIXME. */ + if (strcmp (name, relname) == 0) + { + copy = (! info->keep_memory + || relsym._n._n_n._n_zeroes != 0 + || relsym._n._n_n._n_offset == 0); + h = xcoff_link_hash_lookup (xcoff_hash_table (info), + relname, true, copy, + false); + if (h == NULL) + goto error_return; + + /* At this point h->root.type could be + bfd_link_hash_new. That should be OK, + since we know for sure that we will come + across this symbol as we step through the + file. */ + + /* We store h in *sym_hash for the + convenience of the relocate_section + function. */ + *sym_hash = h; + + if (h->toc_section != NULL) + { + asection **rel_csects; + + /* We already have a TOC entry for this + symbol, so we can just ignore this + one. */ + rel_csects = + reloc_info[enclosing->target_index].csects; + rel_csects[relindx] = bfd_und_section_ptr; + break; + } + + /* We are about to create a TOC entry for + this symbol. */ + set_toc = h; + } + } + } + } + + /* We need to create a new section. We get the name from + the csect storage mapping class, so that the linker can + accumulate similar csects together. */ + { + static const char *csect_name_by_class[] = { + ".pr", ".ro", ".db", ".tc", ".ua", ".rw", ".gl", ".xo", + ".sv", ".bs", ".ds", ".uc", ".ti", ".tb", NULL, ".tc0", + ".td" + }; + const char *csect_name; + asection *enclosing; + + if ((aux.x_csect.x_smclas >= + sizeof csect_name_by_class / sizeof csect_name_by_class[0]) + || csect_name_by_class[aux.x_csect.x_smclas] == NULL) + { + (*_bfd_error_handler) + (_("%s: symbol `%s' has unrecognized smclas %d"), + bfd_get_filename (abfd), name, aux.x_csect.x_smclas); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + + csect_name = csect_name_by_class[aux.x_csect.x_smclas]; + csect = bfd_make_section_anyway (abfd, csect_name); + if (csect == NULL) + goto error_return; + enclosing = coff_section_from_bfd_index (abfd, sym.n_scnum); + if (enclosing == NULL) + goto error_return; + if (! bfd_is_abs_section (enclosing) + && ((bfd_vma) sym.n_value < enclosing->vma + || ((bfd_vma) sym.n_value + aux.x_csect.x_scnlen.l + > enclosing->vma + enclosing->_raw_size))) + { + (*_bfd_error_handler) + (_("%s: csect `%s' not in enclosing section"), + bfd_get_filename (abfd), name); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + csect->vma = sym.n_value; + csect->filepos = (enclosing->filepos + + sym.n_value + - enclosing->vma); + csect->_raw_size = aux.x_csect.x_scnlen.l; + csect->flags |= SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS; + csect->alignment_power = SMTYP_ALIGN (aux.x_csect.x_smtyp); + + /* Record the enclosing section in the tdata for this new + section. */ + csect->used_by_bfd = + (PTR) bfd_zalloc (abfd, sizeof (struct coff_section_tdata)); + if (csect->used_by_bfd == NULL) + goto error_return; + coff_section_data (abfd, csect)->tdata = + bfd_zalloc (abfd, sizeof (struct xcoff_section_tdata)); + if (coff_section_data (abfd, csect)->tdata == NULL) + goto error_return; + xcoff_section_data (abfd, csect)->enclosing = enclosing; + xcoff_section_data (abfd, csect)->lineno_count = + enclosing->lineno_count; + + if (enclosing->owner == abfd) + { + struct internal_reloc *relocs; + bfd_size_type relindx; + struct internal_reloc *rel; + asection **rel_csect; + + relocs = reloc_info[enclosing->target_index].relocs; + relindx = xcoff_find_reloc (relocs, enclosing->reloc_count, + csect->vma); + rel = relocs + relindx; + rel_csect = (reloc_info[enclosing->target_index].csects + + relindx); + csect->rel_filepos = (enclosing->rel_filepos + + relindx * bfd_coff_relsz (abfd)); + while (relindx < enclosing->reloc_count + && *rel_csect == NULL + && rel->r_vaddr < csect->vma + csect->_raw_size) + { + *rel_csect = csect; + csect->flags |= SEC_RELOC; + ++csect->reloc_count; + ++relindx; + ++rel; + ++rel_csect; + } + } + + /* There are a number of other fields and section flags + which we do not bother to set. */ + + csect_index = ((esym + - (bfd_byte *) obj_coff_external_syms (abfd)) + / symesz); + + xcoff_section_data (abfd, csect)->first_symndx = csect_index; + + if (first_csect == NULL) + first_csect = csect; + + /* If this symbol is C_EXT, we treat it as starting at the + beginning of the newly created section. */ + if (sym.n_sclass == C_EXT) + { + section = csect; + value = 0; + } + + /* If this is a TOC section for a symbol, record it. */ + if (set_toc != NULL) + set_toc->toc_section = csect; + } + break; + + case XTY_LD: + /* This is a label definition. The x_scnlen field is the + symbol index of the csect. I believe that this must + always follow the appropriate XTY_SD symbol, so I will + insist on it. */ + { + boolean bad; + + bad = false; + if (aux.x_csect.x_scnlen.l < 0 + || (aux.x_csect.x_scnlen.l + >= esym - (bfd_byte *) obj_coff_external_syms (abfd))) + bad = true; + if (! bad) + { + section = xcoff_data (abfd)->csects[aux.x_csect.x_scnlen.l]; + if (section == NULL + || (section->flags & SEC_HAS_CONTENTS) == 0) + bad = true; + } + if (bad) + { + (*_bfd_error_handler) + (_("%s: misplaced XTY_LD `%s'"), + bfd_get_filename (abfd), name); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + + value = sym.n_value - csect->vma; + } + break; + + case XTY_CM: + /* This is an unitialized csect. We could base the name on + the storage mapping class, but we don't bother except for + an XMC_TD symbol. If this csect is externally visible, + it is a common symbol. We put XMC_TD symbols in sections + named .tocbss, and rely on the linker script to put that + in the TOC area. */ + + if (csect != NULL) + { + xcoff_section_data (abfd, csect)->last_symndx = + ((esym + - (bfd_byte *) obj_coff_external_syms (abfd)) + / symesz); + } + + if (aux.x_csect.x_smclas == XMC_TD) + csect = bfd_make_section_anyway (abfd, ".tocbss"); + else + csect = bfd_make_section_anyway (abfd, ".bss"); + if (csect == NULL) + goto error_return; + csect->vma = sym.n_value; + csect->_raw_size = aux.x_csect.x_scnlen.l; + csect->flags |= SEC_ALLOC; + csect->alignment_power = SMTYP_ALIGN (aux.x_csect.x_smtyp); + /* There are a number of other fields and section flags + which we do not bother to set. */ + + csect_index = ((esym + - (bfd_byte *) obj_coff_external_syms (abfd)) + / symesz); + + csect->used_by_bfd = + (PTR) bfd_zalloc (abfd, sizeof (struct coff_section_tdata)); + if (csect->used_by_bfd == NULL) + goto error_return; + coff_section_data (abfd, csect)->tdata = + bfd_zalloc (abfd, sizeof (struct xcoff_section_tdata)); + if (coff_section_data (abfd, csect)->tdata == NULL) + goto error_return; + xcoff_section_data (abfd, csect)->first_symndx = csect_index; + + if (first_csect == NULL) + first_csect = csect; + + if (sym.n_sclass == C_EXT) + { + csect->flags |= SEC_IS_COMMON; + csect->_raw_size = 0; + section = csect; + value = aux.x_csect.x_scnlen.l; + } + + break; + } + + /* Check for magic symbol names. */ + if ((smtyp == XTY_SD || smtyp == XTY_CM) + && aux.x_csect.x_smclas != XMC_TC + && aux.x_csect.x_smclas != XMC_TD) + { + int i; + + i = -1; + if (name[0] == '_') + { + if (strcmp (name, "_text") == 0) + i = 0; + else if (strcmp (name, "_etext") == 0) + i = 1; + else if (strcmp (name, "_data") == 0) + i = 2; + else if (strcmp (name, "_edata") == 0) + i = 3; + else if (strcmp (name, "_end") == 0) + i = 4; + } + else if (name[0] == 'e' && strcmp (name, "end") == 0) + i = 5; + + if (i != -1) + xcoff_hash_table (info)->special_sections[i] = csect; + } + + /* Now we have enough information to add the symbol to the + linker hash table. */ + + if (sym.n_sclass == C_EXT) + { + boolean copy; + + BFD_ASSERT (section != NULL); + + /* We must copy the name into memory if we got it from the + syment itself, rather than the string table. */ + copy = default_copy; + if (sym._n._n_n._n_zeroes != 0 + || sym._n._n_n._n_offset == 0) + copy = true; + + /* The AIX linker appears to only detect multiple symbol + definitions when there is a reference to the symbol. If + a symbol is defined multiple times, and the only + references are from the same object file, the AIX linker + appears to permit it. It does not merge the different + definitions, but handles them independently. On the + other hand, if there is a reference, the linker reports + an error. + + This matters because the AIX <net/net_globals.h> header + file actually defines an initialized array, so we have to + actually permit that to work. + + Just to make matters even more confusing, the AIX linker + appears to permit multiple symbol definitions whenever + the second definition is in an archive rather than an + object file. This may be a consequence of the manner in + which it handles archives: I think it may load the entire + archive in as separate csects, and then let garbage + collection discard symbols. + + We also have to handle the case of statically linking a + shared object, which will cause symbol redefinitions, + although this is an easier case to detect. */ + + if (info->hash->creator == abfd->xvec) + { + if (! bfd_is_und_section (section)) + *sym_hash = xcoff_link_hash_lookup (xcoff_hash_table (info), + name, true, copy, false); + else + *sym_hash = ((struct xcoff_link_hash_entry *) + bfd_wrapped_link_hash_lookup (abfd, info, name, + true, copy, false)); + if (*sym_hash == NULL) + goto error_return; + if (((*sym_hash)->root.type == bfd_link_hash_defined + || (*sym_hash)->root.type == bfd_link_hash_defweak) + && ! bfd_is_und_section (section) + && ! bfd_is_com_section (section)) + { + /* This is a second definition of a defined symbol. */ + if ((abfd->flags & DYNAMIC) != 0 + && ((*sym_hash)->smclas != XMC_GL + || aux.x_csect.x_smclas == XMC_GL + || ((*sym_hash)->root.u.def.section->owner->flags + & DYNAMIC) == 0)) + { + /* The new symbol is from a shared library, and + either the existing symbol is not global + linkage code or this symbol is global linkage + code. If the existing symbol is global + linkage code and the new symbol is not, then + we want to use the new symbol. */ + section = bfd_und_section_ptr; + value = 0; + } + else if (((*sym_hash)->root.u.def.section->owner->flags + & DYNAMIC) != 0) + { + /* The existing symbol is from a shared library. + Replace it. */ + (*sym_hash)->root.type = bfd_link_hash_undefined; + (*sym_hash)->root.u.undef.abfd = + (*sym_hash)->root.u.def.section->owner; + } + else if (abfd->my_archive != NULL) + { + /* This is a redefinition in an object contained + in an archive. Just ignore it. See the + comment above. */ + section = bfd_und_section_ptr; + value = 0; + } + else if ((*sym_hash)->root.next != NULL + || info->hash->undefs_tail == &(*sym_hash)->root) + { + /* This symbol has been referenced. In this + case, we just continue and permit the + multiple definition error. See the comment + above about the behaviour of the AIX linker. */ + } + else if ((*sym_hash)->smclas == aux.x_csect.x_smclas) + { + /* The symbols are both csects of the same + class. There is at least a chance that this + is a semi-legitimate redefinition. */ + section = bfd_und_section_ptr; + value = 0; + (*sym_hash)->flags |= XCOFF_MULTIPLY_DEFINED; + } + } + else if (((*sym_hash)->flags & XCOFF_MULTIPLY_DEFINED) != 0 + && ((*sym_hash)->root.type == bfd_link_hash_defined + || (*sym_hash)->root.type == bfd_link_hash_defweak) + && (bfd_is_und_section (section) + || bfd_is_com_section (section))) + { + /* This is a reference to a multiply defined symbol. + Report the error now. See the comment above + about the behaviour of the AIX linker. We could + also do this with warning symbols, but I'm not + sure the XCOFF linker is wholly prepared to + handle them, and that would only be a warning, + not an error. */ + if (! ((*info->callbacks->multiple_definition) + (info, (*sym_hash)->root.root.string, + (bfd *) NULL, (asection *) NULL, 0, + (*sym_hash)->root.u.def.section->owner, + (*sym_hash)->root.u.def.section, + (*sym_hash)->root.u.def.value))) + goto error_return; + /* Try not to give this error too many times. */ + (*sym_hash)->flags &= ~XCOFF_MULTIPLY_DEFINED; + } + } + + /* _bfd_generic_link_add_one_symbol may call the linker to + generate an error message, and the linker may try to read + the symbol table to give a good error. Right now, the + line numbers are in an inconsistent state, since they are + counted both in the real sections and in the new csects. + We need to leave the count in the real sections so that + the linker can report the line number of the error + correctly, so temporarily clobber the link to the csects + so that the linker will not try to read the line numbers + a second time from the csects. */ + BFD_ASSERT (last_real->next == first_csect); + last_real->next = NULL; + if (! (_bfd_generic_link_add_one_symbol + (info, abfd, name, flags, section, value, + (const char *) NULL, copy, true, + (struct bfd_link_hash_entry **) sym_hash))) + goto error_return; + last_real->next = first_csect; + + if (smtyp == XTY_CM) + { + if ((*sym_hash)->root.type != bfd_link_hash_common + || (*sym_hash)->root.u.c.p->section != csect) + { + /* We don't need the common csect we just created. */ + csect->_raw_size = 0; + } + else + { + (*sym_hash)->root.u.c.p->alignment_power + = csect->alignment_power; + } + } + + if (info->hash->creator == abfd->xvec) + { + int flag; + + if (smtyp == XTY_ER || smtyp == XTY_CM) + flag = XCOFF_REF_REGULAR; + else + flag = XCOFF_DEF_REGULAR; + (*sym_hash)->flags |= flag; + + if ((*sym_hash)->smclas == XMC_UA + || flag == XCOFF_DEF_REGULAR) + (*sym_hash)->smclas = aux.x_csect.x_smclas; + } + } + + *csect_cache = csect; + + esym += (sym.n_numaux + 1) * symesz; + sym_hash += sym.n_numaux + 1; + csect_cache += sym.n_numaux + 1; + } + + BFD_ASSERT (last_real == NULL || last_real->next == first_csect); + + /* Make sure that we have seen all the relocs. */ + for (o = abfd->sections; o != first_csect; o = o->next) + { + /* Reset the section size and the line number count, since the + data is now attached to the csects. Don't reset the size of + the .debug section, since we need to read it below in + bfd_xcoff_size_dynamic_sections. */ + if (strcmp (bfd_get_section_name (abfd, o), ".debug") != 0) + o->_raw_size = 0; + o->lineno_count = 0; + + if ((o->flags & SEC_RELOC) != 0) + { + bfd_size_type i; + struct internal_reloc *rel; + asection **rel_csect; + + rel = reloc_info[o->target_index].relocs; + rel_csect = reloc_info[o->target_index].csects; + for (i = 0; i < o->reloc_count; i++, rel++, rel_csect++) + { + if (*rel_csect == NULL) + { + (*_bfd_error_handler) + (_("%s: reloc %s:%d not in csect"), + bfd_get_filename (abfd), o->name, i); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + + /* We identify all symbols which are called, so that we + can create glue code for calls to functions imported + from dynamic objects. */ + if (info->hash->creator == abfd->xvec + && *rel_csect != bfd_und_section_ptr + && (rel->r_type == R_BR + || rel->r_type == R_RBR) + && obj_xcoff_sym_hashes (abfd)[rel->r_symndx] != NULL) + { + struct xcoff_link_hash_entry *h; + + h = obj_xcoff_sym_hashes (abfd)[rel->r_symndx]; + h->flags |= XCOFF_CALLED; + /* If the symbol name starts with a period, it is + the code of a function. If the symbol is + currently undefined, then add an undefined symbol + for the function descriptor. This should do no + harm, because any regular object that defines the + function should also define the function + descriptor. It helps, because it means that we + will identify the function descriptor with a + dynamic object if a dynamic object defines it. */ + if (h->root.root.string[0] == '.' + && h->descriptor == NULL) + { + struct xcoff_link_hash_entry *hds; + + hds = xcoff_link_hash_lookup (xcoff_hash_table (info), + h->root.root.string + 1, + true, false, true); + if (hds == NULL) + goto error_return; + if (hds->root.type == bfd_link_hash_new) + { + if (! (_bfd_generic_link_add_one_symbol + (info, abfd, hds->root.root.string, + (flagword) 0, bfd_und_section_ptr, + (bfd_vma) 0, (const char *) NULL, false, + true, + (struct bfd_link_hash_entry **) &hds))) + goto error_return; + } + hds->flags |= XCOFF_DESCRIPTOR; + BFD_ASSERT ((hds->flags & XCOFF_CALLED) == 0 + && (h->flags & XCOFF_DESCRIPTOR) == 0); + hds->descriptor = h; + h->descriptor = hds; + } + } + } + + free (reloc_info[o->target_index].csects); + reloc_info[o->target_index].csects = NULL; + + /* Reset SEC_RELOC and the reloc_count, since the reloc + information is now attached to the csects. */ + o->flags &= ~SEC_RELOC; + o->reloc_count = 0; + + /* If we are not keeping memory, free the reloc information. */ + if (! info->keep_memory + && coff_section_data (abfd, o) != NULL + && coff_section_data (abfd, o)->relocs != NULL + && ! coff_section_data (abfd, o)->keep_relocs) + { + free (coff_section_data (abfd, o)->relocs); + coff_section_data (abfd, o)->relocs = NULL; + } + } + + /* Free up the line numbers. FIXME: We could cache these + somewhere for the final link, to avoid reading them again. */ + if (reloc_info[o->target_index].linenos != NULL) + { + free (reloc_info[o->target_index].linenos); + reloc_info[o->target_index].linenos = NULL; + } + } + + free (reloc_info); + + obj_coff_keep_syms (abfd) = keep_syms; + + return true; + + error_return: + if (reloc_info != NULL) + { + for (o = abfd->sections; o != NULL; o = o->next) + { + if (reloc_info[o->target_index].csects != NULL) + free (reloc_info[o->target_index].csects); + if (reloc_info[o->target_index].linenos != NULL) + free (reloc_info[o->target_index].linenos); + } + free (reloc_info); + } + obj_coff_keep_syms (abfd) = keep_syms; + return false; +} + +#undef N_TMASK +#undef N_BTSHFT + +/* This function is used to add symbols from a dynamic object to the + global symbol table. */ + +static boolean +xcoff_link_add_dynamic_symbols (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + asection *lsec; + bfd_byte *buf; + struct internal_ldhdr ldhdr; + const char *strings; + struct external_ldsym *elsym, *elsymend; + struct xcoff_import_file *n; + const char *bname; + const char *mname; + const char *s; + unsigned int c; + struct xcoff_import_file **pp; + + /* We can only handle a dynamic object if we are generating an XCOFF + output file. */ + if (info->hash->creator != abfd->xvec) + { + (*_bfd_error_handler) + (_("%s: XCOFF shared object when not producing XCOFF output"), + bfd_get_filename (abfd)); + bfd_set_error (bfd_error_invalid_operation); + return false; + } + + /* The symbols we use from a dynamic object are not the symbols in + the normal symbol table, but, rather, the symbols in the export + table. If there is a global symbol in a dynamic object which is + not in the export table, the loader will not be able to find it, + so we don't want to find it either. Also, on AIX 4.1.3, shr.o in + libc.a has symbols in the export table which are not in the + symbol table. */ + + /* Read in the .loader section. FIXME: We should really use the + o_snloader field in the a.out header, rather than grabbing the + section by name. */ + lsec = bfd_get_section_by_name (abfd, ".loader"); + if (lsec == NULL) + { + (*_bfd_error_handler) + (_("%s: dynamic object with no .loader section"), + bfd_get_filename (abfd)); + bfd_set_error (bfd_error_no_symbols); + return false; + } + + if (! xcoff_get_section_contents (abfd, lsec)) + return false; + buf = coff_section_data (abfd, lsec)->contents; + + /* Remove the sections from this object, so that they do not get + included in the link. */ + abfd->sections = NULL; + + xcoff_swap_ldhdr_in (abfd, (struct external_ldhdr *) buf, &ldhdr); + + strings = (char *) buf + ldhdr.l_stoff; + + elsym = (struct external_ldsym *) (buf + LDHDRSZ); + elsymend = elsym + ldhdr.l_nsyms; + BFD_ASSERT (sizeof (struct external_ldsym) == LDSYMSZ); + for (; elsym < elsymend; elsym++) + { + struct internal_ldsym ldsym; + char nambuf[SYMNMLEN + 1]; + const char *name; + struct xcoff_link_hash_entry *h; + + xcoff_swap_ldsym_in (abfd, elsym, &ldsym); + + /* We are only interested in exported symbols. */ + if ((ldsym.l_smtype & L_EXPORT) == 0) + continue; + + if (ldsym._l._l_l._l_zeroes == 0) + name = strings + ldsym._l._l_l._l_offset; + else + { + memcpy (nambuf, ldsym._l._l_name, SYMNMLEN); + nambuf[SYMNMLEN] = '\0'; + name = nambuf; + } + + /* Normally we could not call xcoff_link_hash_lookup in an add + symbols routine, since we might not be using an XCOFF hash + table. However, we verified above that we are using an XCOFF + hash table. */ + + h = xcoff_link_hash_lookup (xcoff_hash_table (info), name, true, + true, true); + if (h == NULL) + return false; + + h->flags |= XCOFF_DEF_DYNAMIC; + + /* If the symbol is undefined, and the BFD it was found in is + not a dynamic object, change the BFD to this dynamic object, + so that we can get the correct import file ID. */ + if ((h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak) + && (h->root.u.undef.abfd == NULL + || (h->root.u.undef.abfd->flags & DYNAMIC) == 0)) + h->root.u.undef.abfd = abfd; + + if (h->root.type == bfd_link_hash_new) + { + h->root.type = bfd_link_hash_undefined; + h->root.u.undef.abfd = abfd; + /* We do not want to add this to the undefined symbol list. */ + } + + if (h->smclas == XMC_UA + || h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak) + h->smclas = ldsym.l_smclas; + + /* Unless this is an XMC_XO symbol, we don't bother to actually + define it, since we don't have a section to put it in anyhow. + Instead, the relocation routines handle the DEF_DYNAMIC flag + correctly. */ + + if (h->smclas == XMC_XO + && (h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak)) + { + /* This symbol has an absolute value. */ + h->root.type = bfd_link_hash_defined; + h->root.u.def.section = bfd_abs_section_ptr; + h->root.u.def.value = ldsym.l_value; + } + + /* If this symbol defines a function descriptor, then it + implicitly defines the function code as well. */ + if (h->smclas == XMC_DS + || (h->smclas == XMC_XO && name[0] != '.')) + h->flags |= XCOFF_DESCRIPTOR; + if ((h->flags & XCOFF_DESCRIPTOR) != 0) + { + struct xcoff_link_hash_entry *hds; + + hds = h->descriptor; + if (hds == NULL) + { + char *dsnm; + + dsnm = bfd_malloc (strlen (name) + 2); + if (dsnm == NULL) + return false; + dsnm[0] = '.'; + strcpy (dsnm + 1, name); + hds = xcoff_link_hash_lookup (xcoff_hash_table (info), dsnm, + true, true, true); + free (dsnm); + if (hds == NULL) + return false; + + if (hds->root.type == bfd_link_hash_new) + { + hds->root.type = bfd_link_hash_undefined; + hds->root.u.undef.abfd = abfd; + /* We do not want to add this to the undefined + symbol list. */ + } + + hds->descriptor = h; + h->descriptor = hds; + } + + hds->flags |= XCOFF_DEF_DYNAMIC; + if (hds->smclas == XMC_UA) + hds->smclas = XMC_PR; + + /* An absolute symbol appears to actually define code, not a + function descriptor. This is how some math functions are + implemented on AIX 4.1. */ + if (h->smclas == XMC_XO + && (hds->root.type == bfd_link_hash_undefined + || hds->root.type == bfd_link_hash_undefweak)) + { + hds->smclas = XMC_XO; + hds->root.type = bfd_link_hash_defined; + hds->root.u.def.section = bfd_abs_section_ptr; + hds->root.u.def.value = ldsym.l_value; + } + } + } + + if (buf != NULL && ! coff_section_data (abfd, lsec)->keep_contents) + { + free (coff_section_data (abfd, lsec)->contents); + coff_section_data (abfd, lsec)->contents = NULL; + } + + /* Record this file in the import files. */ + + n = ((struct xcoff_import_file *) + bfd_alloc (abfd, sizeof (struct xcoff_import_file))); + if (n == NULL) + return false; + n->next = NULL; + + /* For some reason, the path entry in the import file list for a + shared object appears to always be empty. The file name is the + base name. */ + n->path = ""; + if (abfd->my_archive == NULL) + { + bname = bfd_get_filename (abfd); + mname = ""; + } + else + { + bname = bfd_get_filename (abfd->my_archive); + mname = bfd_get_filename (abfd); + } + s = strrchr (bname, '/'); + if (s != NULL) + bname = s + 1; + n->file = bname; + n->member = mname; + + /* We start c at 1 because the first import file number is reserved + for LIBPATH. */ + for (pp = &xcoff_hash_table (info)->imports, c = 1; + *pp != NULL; + pp = &(*pp)->next, ++c) + ; + *pp = n; + + xcoff_data (abfd)->import_file_id = c; + + return true; +} + +/* Routines that are called after all the input files have been + handled, but before the sections are laid out in memory. */ + +/* Mark a symbol as not being garbage, including the section in which + it is defined. */ + +static INLINE boolean +xcoff_mark_symbol (info, h) + struct bfd_link_info *info; + struct xcoff_link_hash_entry *h; +{ + if ((h->flags & XCOFF_MARK) != 0) + return true; + + h->flags |= XCOFF_MARK; + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + asection *hsec; + + hsec = h->root.u.def.section; + if (! bfd_is_abs_section (hsec) + && (hsec->flags & SEC_MARK) == 0) + { + if (! xcoff_mark (info, hsec)) + return false; + } + } + + if (h->toc_section != NULL + && (h->toc_section->flags & SEC_MARK) == 0) + { + if (! xcoff_mark (info, h->toc_section)) + return false; + } + + return true; +} + +/* The mark phase of garbage collection. For a given section, mark + it, and all the sections which define symbols to which it refers. + Because this function needs to look at the relocs, we also count + the number of relocs which need to be copied into the .loader + section. */ + +static boolean +xcoff_mark (info, sec) + struct bfd_link_info *info; + asection *sec; +{ + if (bfd_is_abs_section (sec) + || (sec->flags & SEC_MARK) != 0) + return true; + + sec->flags |= SEC_MARK; + + if (sec->owner->xvec == info->hash->creator + && coff_section_data (sec->owner, sec) != NULL + && xcoff_section_data (sec->owner, sec) != NULL) + { + register struct xcoff_link_hash_entry **hp, **hpend; + struct internal_reloc *rel, *relend; + + /* Mark all the symbols in this section. */ + + hp = (obj_xcoff_sym_hashes (sec->owner) + + xcoff_section_data (sec->owner, sec)->first_symndx); + hpend = (obj_xcoff_sym_hashes (sec->owner) + + xcoff_section_data (sec->owner, sec)->last_symndx); + for (; hp < hpend; hp++) + { + register struct xcoff_link_hash_entry *h; + + h = *hp; + if (h != NULL + && (h->flags & XCOFF_MARK) == 0) + { + if (! xcoff_mark_symbol (info, h)) + return false; + } + } + + /* Look through the section relocs. */ + + if ((sec->flags & SEC_RELOC) != 0 + && sec->reloc_count > 0) + { + rel = xcoff_read_internal_relocs (sec->owner, sec, true, + (bfd_byte *) NULL, false, + (struct internal_reloc *) NULL); + if (rel == NULL) + return false; + relend = rel + sec->reloc_count; + for (; rel < relend; rel++) + { + asection *rsec; + struct xcoff_link_hash_entry *h; + + if ((unsigned int) rel->r_symndx + > obj_raw_syment_count (sec->owner)) + continue; + + h = obj_xcoff_sym_hashes (sec->owner)[rel->r_symndx]; + if (h != NULL + && (h->flags & XCOFF_MARK) == 0) + { + if (! xcoff_mark_symbol (info, h)) + return false; + } + + rsec = xcoff_data (sec->owner)->csects[rel->r_symndx]; + if (rsec != NULL + && (rsec->flags & SEC_MARK) == 0) + { + if (! xcoff_mark (info, rsec)) + return false; + } + + /* See if this reloc needs to be copied into the .loader + section. */ + switch (rel->r_type) + { + default: + if (h == NULL + || h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak + || h->root.type == bfd_link_hash_common + || ((h->flags & XCOFF_CALLED) != 0 + && (h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak) + && h->root.root.string[0] == '.' + && h->descriptor != NULL + && ((h->descriptor->flags & XCOFF_DEF_DYNAMIC) != 0 + || ((h->descriptor->flags & XCOFF_IMPORT) != 0 + && (h->descriptor->flags + & XCOFF_DEF_REGULAR) == 0)))) + break; + /* Fall through. */ + case R_POS: + case R_NEG: + case R_RL: + case R_RLA: + ++xcoff_hash_table (info)->ldrel_count; + if (h != NULL) + h->flags |= XCOFF_LDREL; + break; + case R_TOC: + case R_GL: + case R_TCL: + case R_TRL: + case R_TRLA: + /* We should never need a .loader reloc for a TOC + relative reloc. */ + break; + } + } + + if (! info->keep_memory + && coff_section_data (sec->owner, sec) != NULL + && coff_section_data (sec->owner, sec)->relocs != NULL + && ! coff_section_data (sec->owner, sec)->keep_relocs) + { + free (coff_section_data (sec->owner, sec)->relocs); + coff_section_data (sec->owner, sec)->relocs = NULL; + } + } + } + + return true; +} + +/* The sweep phase of garbage collection. Remove all garbage + sections. */ + +static void +xcoff_sweep (info) + struct bfd_link_info *info; +{ + bfd *sub; + + for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + { + asection *o; + + for (o = sub->sections; o != NULL; o = o->next) + { + if ((o->flags & SEC_MARK) == 0) + { + /* Keep all sections from non-XCOFF input files. Keep + special sections. Keep .debug sections for the + moment. */ + if (sub->xvec != info->hash->creator + || o == xcoff_hash_table (info)->debug_section + || o == xcoff_hash_table (info)->loader_section + || o == xcoff_hash_table (info)->linkage_section + || o == xcoff_hash_table (info)->toc_section + || o == xcoff_hash_table (info)->descriptor_section + || strcmp (o->name, ".debug") == 0) + o->flags |= SEC_MARK; + else + { + o->_raw_size = 0; + o->reloc_count = 0; + o->lineno_count = 0; + } + } + } + } +} + +/* Record the number of elements in a set. This is used to output the + correct csect length. */ + +boolean +bfd_xcoff_link_record_set (output_bfd, info, harg, size) + bfd *output_bfd; + struct bfd_link_info *info; + struct bfd_link_hash_entry *harg; + bfd_size_type size; +{ + struct xcoff_link_hash_entry *h = (struct xcoff_link_hash_entry *) harg; + struct xcoff_link_size_list *n; + + if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour) + return true; + + /* This will hardly ever be called. I don't want to burn four bytes + per global symbol, so instead the size is kept on a linked list + attached to the hash table. */ + + n = ((struct xcoff_link_size_list *) + bfd_alloc (output_bfd, sizeof (struct xcoff_link_size_list))); + if (n == NULL) + return false; + n->next = xcoff_hash_table (info)->size_list; + n->h = h; + n->size = size; + xcoff_hash_table (info)->size_list = n; + + h->flags |= XCOFF_HAS_SIZE; + + return true; +} + +/* Import a symbol. */ + +boolean +bfd_xcoff_import_symbol (output_bfd, info, harg, val, imppath, impfile, + impmember) + bfd *output_bfd; + struct bfd_link_info *info; + struct bfd_link_hash_entry *harg; + bfd_vma val; + const char *imppath; + const char *impfile; + const char *impmember; +{ + struct xcoff_link_hash_entry *h = (struct xcoff_link_hash_entry *) harg; + + if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour) + return true; + + /* A symbol name which starts with a period is the code for a + function. If the symbol is undefined, then add an undefined + symbol for the function descriptor, and import that instead. */ + if (h->root.root.string[0] == '.' + && h->root.type == bfd_link_hash_undefined + && val == (bfd_vma) -1) + { + struct xcoff_link_hash_entry *hds; + + hds = h->descriptor; + if (hds == NULL) + { + hds = xcoff_link_hash_lookup (xcoff_hash_table (info), + h->root.root.string + 1, + true, false, true); + if (hds == NULL) + return false; + if (hds->root.type == bfd_link_hash_new) + { + hds->root.type = bfd_link_hash_undefined; + hds->root.u.undef.abfd = h->root.u.undef.abfd; + } + hds->flags |= XCOFF_DESCRIPTOR; + BFD_ASSERT ((hds->flags & XCOFF_CALLED) == 0 + && (h->flags & XCOFF_DESCRIPTOR) == 0); + hds->descriptor = h; + h->descriptor = hds; + } + + /* Now, if the descriptor is undefined, import the descriptor + rather than the symbol we were told to import. FIXME: Is + this correct in all cases? */ + if (hds->root.type == bfd_link_hash_undefined) + h = hds; + } + + h->flags |= XCOFF_IMPORT; + + if (val != (bfd_vma) -1) + { + if (h->root.type == bfd_link_hash_defined + && (! bfd_is_abs_section (h->root.u.def.section) + || h->root.u.def.value != val)) + { + if (! ((*info->callbacks->multiple_definition) + (info, h->root.root.string, h->root.u.def.section->owner, + h->root.u.def.section, h->root.u.def.value, + output_bfd, bfd_abs_section_ptr, val))) + return false; + } + + h->root.type = bfd_link_hash_defined; + h->root.u.def.section = bfd_abs_section_ptr; + h->root.u.def.value = val; + } + + /* We overload the ldindx field to hold the l_ifile value for this + symbol. */ + BFD_ASSERT (h->ldsym == NULL); + BFD_ASSERT ((h->flags & XCOFF_BUILT_LDSYM) == 0); + if (imppath == NULL) + h->ldindx = -1; + else + { + unsigned int c; + struct xcoff_import_file **pp; + + /* We start c at 1 because the first entry in the import list is + reserved for the library search path. */ + for (pp = &xcoff_hash_table (info)->imports, c = 1; + *pp != NULL; + pp = &(*pp)->next, ++c) + { + if (strcmp ((*pp)->path, imppath) == 0 + && strcmp ((*pp)->file, impfile) == 0 + && strcmp ((*pp)->member, impmember) == 0) + break; + } + + if (*pp == NULL) + { + struct xcoff_import_file *n; + + n = ((struct xcoff_import_file *) + bfd_alloc (output_bfd, sizeof (struct xcoff_import_file))); + if (n == NULL) + return false; + n->next = NULL; + n->path = imppath; + n->file = impfile; + n->member = impmember; + *pp = n; + } + + h->ldindx = c; + } + + return true; +} + +/* Export a symbol. */ + +boolean +bfd_xcoff_export_symbol (output_bfd, info, harg, syscall) + bfd *output_bfd; + struct bfd_link_info *info; + struct bfd_link_hash_entry *harg; + boolean syscall ATTRIBUTE_UNUSED; +{ + struct xcoff_link_hash_entry *h = (struct xcoff_link_hash_entry *) harg; + + if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour) + return true; + + h->flags |= XCOFF_EXPORT; + + /* FIXME: I'm not at all sure what syscall is supposed to mean, so + I'm just going to ignore it until somebody explains it. */ + + /* See if this is a function descriptor. It may be one even though + it is not so marked. */ + if ((h->flags & XCOFF_DESCRIPTOR) == 0 + && h->root.root.string[0] != '.') + { + char *fnname; + struct xcoff_link_hash_entry *hfn; + + fnname = (char *) bfd_malloc (strlen (h->root.root.string) + 2); + if (fnname == NULL) + return false; + fnname[0] = '.'; + strcpy (fnname + 1, h->root.root.string); + hfn = xcoff_link_hash_lookup (xcoff_hash_table (info), + fnname, false, false, true); + free (fnname); + if (hfn != NULL + && hfn->smclas == XMC_PR + && (hfn->root.type == bfd_link_hash_defined + || hfn->root.type == bfd_link_hash_defweak)) + { + h->flags |= XCOFF_DESCRIPTOR; + h->descriptor = hfn; + hfn->descriptor = h; + } + } + + /* Make sure we don't garbage collect this symbol. */ + if (! xcoff_mark_symbol (info, h)) + return false; + + /* If this is a function descriptor, make sure we don't garbage + collect the associated function code. We normally don't have to + worry about this, because the descriptor will be attached to a + section with relocs, but if we are creating the descriptor + ourselves those relocs will not be visible to the mark code. */ + if ((h->flags & XCOFF_DESCRIPTOR) != 0) + { + if (! xcoff_mark_symbol (info, h->descriptor)) + return false; + } + + return true; +} + +/* Count a reloc against a symbol. This is called for relocs + generated by the linker script, typically for global constructors + and destructors. */ + +boolean +bfd_xcoff_link_count_reloc (output_bfd, info, name) + bfd *output_bfd; + struct bfd_link_info *info; + const char *name; +{ + struct xcoff_link_hash_entry *h; + + if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour) + return true; + + h = ((struct xcoff_link_hash_entry *) + bfd_wrapped_link_hash_lookup (output_bfd, info, name, false, false, + false)); + if (h == NULL) + { + (*_bfd_error_handler) (_("%s: no such symbol"), name); + bfd_set_error (bfd_error_no_symbols); + return false; + } + + h->flags |= XCOFF_REF_REGULAR | XCOFF_LDREL; + ++xcoff_hash_table (info)->ldrel_count; + + /* Mark the symbol to avoid garbage collection. */ + if (! xcoff_mark_symbol (info, h)) + return false; + + return true; +} + +/* This function is called for each symbol to which the linker script + assigns a value. */ + +boolean +bfd_xcoff_record_link_assignment (output_bfd, info, name) + bfd *output_bfd; + struct bfd_link_info *info; + const char *name; +{ + struct xcoff_link_hash_entry *h; + + if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour) + return true; + + h = xcoff_link_hash_lookup (xcoff_hash_table (info), name, true, true, + false); + if (h == NULL) + return false; + + h->flags |= XCOFF_DEF_REGULAR; + + return true; +} + +/* This structure is used to pass information through + xcoff_link_hash_traverse. */ + +struct xcoff_loader_info { + /* Set if a problem occurred. */ + boolean failed; + /* Output BFD. */ + bfd *output_bfd; + /* Link information structure. */ + struct bfd_link_info *info; + /* Whether all defined symbols should be exported. */ + boolean export_defineds; + /* Number of ldsym structures. */ + size_t ldsym_count; + /* Size of string table. */ + size_t string_size; + /* String table. */ + bfd_byte *strings; + /* Allocated size of string table. */ + size_t string_alc; +}; + +/* Build the .loader section. This is called by the XCOFF linker + emulation before_allocation routine. We must set the size of the + .loader section before the linker lays out the output file. + LIBPATH is the library path to search for shared objects; this is + normally built from the -L arguments passed to the linker. ENTRY + is the name of the entry point symbol (the -e linker option). + FILE_ALIGN is the alignment to use for sections within the file + (the -H linker option). MAXSTACK is the maximum stack size (the + -bmaxstack linker option). MAXDATA is the maximum data size (the + -bmaxdata linker option). GC is whether to do garbage collection + (the -bgc linker option). MODTYPE is the module type (the + -bmodtype linker option). TEXTRO is whether the text section must + be read only (the -btextro linker option). EXPORT_DEFINEDS is + whether all defined symbols should be exported (the -unix linker + option). SPECIAL_SECTIONS is set by this routine to csects with + magic names like _end. */ + +boolean +bfd_xcoff_size_dynamic_sections (output_bfd, info, libpath, entry, + file_align, maxstack, maxdata, gc, + modtype, textro, export_defineds, + special_sections) + bfd *output_bfd; + struct bfd_link_info *info; + const char *libpath; + const char *entry; + unsigned long file_align; + unsigned long maxstack; + unsigned long maxdata; + boolean gc; + int modtype; + boolean textro; + boolean export_defineds; + asection **special_sections; +{ + struct xcoff_link_hash_entry *hentry; + asection *lsec; + struct xcoff_loader_info ldinfo; + int i; + size_t impsize, impcount; + struct xcoff_import_file *fl; + struct internal_ldhdr *ldhdr; + bfd_size_type stoff; + register char *out; + asection *sec; + bfd *sub; + struct bfd_strtab_hash *debug_strtab; + bfd_byte *debug_contents = NULL; + + if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour) + { + for (i = 0; i < 6; i++) + special_sections[i] = NULL; + return true; + } + + ldinfo.failed = false; + ldinfo.output_bfd = output_bfd; + ldinfo.info = info; + ldinfo.export_defineds = export_defineds; + ldinfo.ldsym_count = 0; + ldinfo.string_size = 0; + ldinfo.strings = NULL; + ldinfo.string_alc = 0; + + xcoff_data (output_bfd)->maxstack = maxstack; + xcoff_data (output_bfd)->maxdata = maxdata; + xcoff_data (output_bfd)->modtype = modtype; + + xcoff_hash_table (info)->file_align = file_align; + xcoff_hash_table (info)->textro = textro; + + if (entry == NULL) + hentry = NULL; + else + { + hentry = xcoff_link_hash_lookup (xcoff_hash_table (info), entry, + false, false, true); + if (hentry != NULL) + hentry->flags |= XCOFF_ENTRY; + } + + /* Garbage collect unused sections. */ + if (info->relocateable + || ! gc + || hentry == NULL + || (hentry->root.type != bfd_link_hash_defined + && hentry->root.type != bfd_link_hash_defweak)) + { + gc = false; + xcoff_hash_table (info)->gc = false; + + /* We still need to call xcoff_mark, in order to set ldrel_count + correctly. */ + for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + { + asection *o; + + for (o = sub->sections; o != NULL; o = o->next) + { + if ((o->flags & SEC_MARK) == 0) + { + if (! xcoff_mark (info, o)) + goto error_return; + } + } + } + } + else + { + if (! xcoff_mark (info, hentry->root.u.def.section)) + goto error_return; + xcoff_sweep (info); + xcoff_hash_table (info)->gc = true; + } + + /* Return special sections to the caller. */ + for (i = 0; i < 6; i++) + { + asection *sec; + + sec = xcoff_hash_table (info)->special_sections[i]; + if (sec != NULL + && gc + && (sec->flags & SEC_MARK) == 0) + sec = NULL; + special_sections[i] = sec; + } + + if (info->input_bfds == NULL) + { + /* I'm not sure what to do in this bizarre case. */ + return true; + } + + xcoff_link_hash_traverse (xcoff_hash_table (info), xcoff_build_ldsyms, + (PTR) &ldinfo); + if (ldinfo.failed) + goto error_return; + + /* Work out the size of the import file names. Each import file ID + consists of three null terminated strings: the path, the file + name, and the archive member name. The first entry in the list + of names is the path to use to find objects, which the linker has + passed in as the libpath argument. For some reason, the path + entry in the other import file names appears to always be empty. */ + impsize = strlen (libpath) + 3; + impcount = 1; + for (fl = xcoff_hash_table (info)->imports; fl != NULL; fl = fl->next) + { + ++impcount; + impsize += (strlen (fl->path) + + strlen (fl->file) + + strlen (fl->member) + + 3); + } + + /* Set up the .loader section header. */ + ldhdr = &xcoff_hash_table (info)->ldhdr; + ldhdr->l_version = 1; + ldhdr->l_nsyms = ldinfo.ldsym_count; + ldhdr->l_nreloc = xcoff_hash_table (info)->ldrel_count; + ldhdr->l_istlen = impsize; + ldhdr->l_nimpid = impcount; + ldhdr->l_impoff = (LDHDRSZ + + ldhdr->l_nsyms * LDSYMSZ + + ldhdr->l_nreloc * LDRELSZ); + ldhdr->l_stlen = ldinfo.string_size; + stoff = ldhdr->l_impoff + impsize; + if (ldinfo.string_size == 0) + ldhdr->l_stoff = 0; + else + ldhdr->l_stoff = stoff; + + /* We now know the final size of the .loader section. Allocate + space for it. */ + lsec = xcoff_hash_table (info)->loader_section; + lsec->_raw_size = stoff + ldhdr->l_stlen; + lsec->contents = (bfd_byte *) bfd_zalloc (output_bfd, lsec->_raw_size); + if (lsec->contents == NULL) + goto error_return; + + /* Set up the header. */ + xcoff_swap_ldhdr_out (output_bfd, ldhdr, + (struct external_ldhdr *) lsec->contents); + + /* Set up the import file names. */ + out = (char *) lsec->contents + ldhdr->l_impoff; + strcpy (out, libpath); + out += strlen (libpath) + 1; + *out++ = '\0'; + *out++ = '\0'; + for (fl = xcoff_hash_table (info)->imports; fl != NULL; fl = fl->next) + { + register const char *s; + + s = fl->path; + while ((*out++ = *s++) != '\0') + ; + s = fl->file; + while ((*out++ = *s++) != '\0') + ; + s = fl->member; + while ((*out++ = *s++) != '\0') + ; + } + + BFD_ASSERT ((bfd_size_type) ((bfd_byte *) out - lsec->contents) == stoff); + + /* Set up the symbol string table. */ + if (ldinfo.string_size > 0) + { + memcpy (out, ldinfo.strings, ldinfo.string_size); + free (ldinfo.strings); + ldinfo.strings = NULL; + } + + /* We can't set up the symbol table or the relocs yet, because we + don't yet know the final position of the various sections. The + .loader symbols are written out when the corresponding normal + symbols are written out in xcoff_link_input_bfd or + xcoff_write_global_symbol. The .loader relocs are written out + when the corresponding normal relocs are handled in + xcoff_link_input_bfd. */ + + /* Allocate space for the magic sections. */ + sec = xcoff_hash_table (info)->linkage_section; + if (sec->_raw_size > 0) + { + sec->contents = (bfd_byte *) bfd_zalloc (output_bfd, sec->_raw_size); + if (sec->contents == NULL) + goto error_return; + } + sec = xcoff_hash_table (info)->toc_section; + if (sec->_raw_size > 0) + { + sec->contents = (bfd_byte *) bfd_zalloc (output_bfd, sec->_raw_size); + if (sec->contents == NULL) + goto error_return; + } + sec = xcoff_hash_table (info)->descriptor_section; + if (sec->_raw_size > 0) + { + sec->contents = (bfd_byte *) bfd_zalloc (output_bfd, sec->_raw_size); + if (sec->contents == NULL) + goto error_return; + } + + /* Now that we've done garbage collection, figure out the contents + of the .debug section. */ + debug_strtab = xcoff_hash_table (info)->debug_strtab; + + for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + { + asection *subdeb; + bfd_size_type symcount; + unsigned long *debug_index; + asection **csectpp; + bfd_byte *esym, *esymend; + bfd_size_type symesz; + + if (sub->xvec != info->hash->creator) + continue; + subdeb = bfd_get_section_by_name (sub, ".debug"); + if (subdeb == NULL || subdeb->_raw_size == 0) + continue; + + if (info->strip == strip_all + || info->strip == strip_debugger + || info->discard == discard_all) + { + subdeb->_raw_size = 0; + continue; + } + + if (! _bfd_coff_get_external_symbols (sub)) + goto error_return; + + symcount = obj_raw_syment_count (sub); + debug_index = ((unsigned long *) + bfd_zalloc (sub, symcount * sizeof (unsigned long))); + if (debug_index == NULL) + goto error_return; + xcoff_data (sub)->debug_indices = debug_index; + + /* Grab the contents of the .debug section. We use malloc and + copy the names into the debug stringtab, rather than + bfd_alloc, because I expect that, when linking many files + together, many of the strings will be the same. Storing the + strings in the hash table should save space in this case. */ + debug_contents = (bfd_byte *) bfd_malloc (subdeb->_raw_size); + if (debug_contents == NULL) + goto error_return; + if (! bfd_get_section_contents (sub, subdeb, (PTR) debug_contents, + (file_ptr) 0, subdeb->_raw_size)) + goto error_return; + + csectpp = xcoff_data (sub)->csects; + + symesz = bfd_coff_symesz (sub); + esym = (bfd_byte *) obj_coff_external_syms (sub); + esymend = esym + symcount * symesz; + while (esym < esymend) + { + struct internal_syment sym; + + bfd_coff_swap_sym_in (sub, (PTR) esym, (PTR) &sym); + + *debug_index = (unsigned long) -1; + + if (sym._n._n_n._n_zeroes == 0 + && *csectpp != NULL + && (! gc + || ((*csectpp)->flags & SEC_MARK) != 0 + || *csectpp == bfd_abs_section_ptr) + && bfd_coff_symname_in_debug (sub, &sym)) + { + char *name; + bfd_size_type indx; + + name = (char *) debug_contents + sym._n._n_n._n_offset; + indx = _bfd_stringtab_add (debug_strtab, name, true, true); + if (indx == (bfd_size_type) -1) + goto error_return; + *debug_index = indx; + } + + esym += (sym.n_numaux + 1) * symesz; + csectpp += sym.n_numaux + 1; + debug_index += sym.n_numaux + 1; + } + + free (debug_contents); + debug_contents = NULL; + + /* Clear the size of subdeb, so that it is not included directly + in the output file. */ + subdeb->_raw_size = 0; + + if (! info->keep_memory) + { + if (! _bfd_coff_free_symbols (sub)) + goto error_return; + } + } + + if (info->strip != strip_all) + xcoff_hash_table (info)->debug_section->_raw_size = + _bfd_stringtab_size (debug_strtab); + + return true; + + error_return: + if (ldinfo.strings != NULL) + free (ldinfo.strings); + if (debug_contents != NULL) + free (debug_contents); + return false; +} + +/* Add a symbol to the .loader symbols, if necessary. */ + +static boolean +xcoff_build_ldsyms (h, p) + struct xcoff_link_hash_entry *h; + PTR p; +{ + struct xcoff_loader_info *ldinfo = (struct xcoff_loader_info *) p; + size_t len; + + /* If this is a final link, and the symbol was defined as a common + symbol in a regular object file, and there was no definition in + any dynamic object, then the linker will have allocated space for + the symbol in a common section but the XCOFF_DEF_REGULAR flag + will not have been set. */ + if (h->root.type == bfd_link_hash_defined + && (h->flags & XCOFF_DEF_REGULAR) == 0 + && (h->flags & XCOFF_REF_REGULAR) != 0 + && (h->flags & XCOFF_DEF_DYNAMIC) == 0 + && (bfd_is_abs_section (h->root.u.def.section) + || (h->root.u.def.section->owner->flags & DYNAMIC) == 0)) + h->flags |= XCOFF_DEF_REGULAR; + + /* If all defined symbols should be exported, mark them now. We + don't want to export the actual functions, just the function + descriptors. */ + if (ldinfo->export_defineds + && (h->flags & XCOFF_DEF_REGULAR) != 0 + && h->root.root.string[0] != '.') + { + boolean export; + + /* We don't export a symbol which is being defined by an object + included from an archive which contains a shared object. The + rationale is that if an archive contains both an unshared and + a shared object, then there must be some reason that the + unshared object is unshared, and we don't want to start + providing a shared version of it. In particular, this solves + a bug involving the _savefNN set of functions. gcc will call + those functions without providing a slot to restore the TOC, + so it is essential that these functions be linked in directly + and not from a shared object, which means that a shared + object which also happens to link them in must not export + them. This is confusing, but I haven't been able to think of + a different approach. Note that the symbols can, of course, + be exported explicitly. */ + export = true; + if ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && h->root.u.def.section->owner != NULL + && h->root.u.def.section->owner->my_archive != NULL) + { + bfd *arbfd, *member; + + arbfd = h->root.u.def.section->owner->my_archive; + member = bfd_openr_next_archived_file (arbfd, (bfd *) NULL); + while (member != NULL) + { + if ((member->flags & DYNAMIC) != 0) + { + export = false; + break; + } + member = bfd_openr_next_archived_file (arbfd, member); + } + } + + if (export) + h->flags |= XCOFF_EXPORT; + } + + /* We don't want to garbage collect symbols which are not defined in + XCOFF files. This is a convenient place to mark them. */ + if (xcoff_hash_table (ldinfo->info)->gc + && (h->flags & XCOFF_MARK) == 0 + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && (h->root.u.def.section->owner == NULL + || (h->root.u.def.section->owner->xvec + != ldinfo->info->hash->creator))) + h->flags |= XCOFF_MARK; + + /* If this symbol is called and defined in a dynamic object, or it + is imported, then we need to set up global linkage code for it. + (Unless we did garbage collection and we didn't need this + symbol.) */ + if ((h->flags & XCOFF_CALLED) != 0 + && (h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak) + && h->root.root.string[0] == '.' + && h->descriptor != NULL + && ((h->descriptor->flags & XCOFF_DEF_DYNAMIC) != 0 + || ((h->descriptor->flags & XCOFF_IMPORT) != 0 + && (h->descriptor->flags & XCOFF_DEF_REGULAR) == 0)) + && (! xcoff_hash_table (ldinfo->info)->gc + || (h->flags & XCOFF_MARK) != 0)) + { + asection *sec; + struct xcoff_link_hash_entry *hds; + + sec = xcoff_hash_table (ldinfo->info)->linkage_section; + h->root.type = bfd_link_hash_defined; + h->root.u.def.section = sec; + h->root.u.def.value = sec->_raw_size; + h->smclas = XMC_GL; + h->flags |= XCOFF_DEF_REGULAR; + sec->_raw_size += XCOFF_GLINK_SIZE; + + /* The global linkage code requires a TOC entry for the + descriptor. */ + hds = h->descriptor; + BFD_ASSERT ((hds->root.type == bfd_link_hash_undefined + || hds->root.type == bfd_link_hash_undefweak) + && (hds->flags & XCOFF_DEF_REGULAR) == 0); + hds->flags |= XCOFF_MARK; + if (hds->toc_section == NULL) + { + hds->toc_section = xcoff_hash_table (ldinfo->info)->toc_section; + hds->u.toc_offset = hds->toc_section->_raw_size; + hds->toc_section->_raw_size += 4; + ++xcoff_hash_table (ldinfo->info)->ldrel_count; + ++hds->toc_section->reloc_count; + hds->indx = -2; + hds->flags |= XCOFF_SET_TOC | XCOFF_LDREL; + + /* We need to call xcoff_build_ldsyms recursively here, + because we may already have passed hds on the traversal. */ + xcoff_build_ldsyms (hds, p); + } + } + + /* If this symbol is exported, but not defined, we need to try to + define it. */ + if ((h->flags & XCOFF_EXPORT) != 0 + && (h->flags & XCOFF_IMPORT) == 0 + && (h->flags & XCOFF_DEF_REGULAR) == 0 + && (h->flags & XCOFF_DEF_DYNAMIC) == 0 + && (h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak)) + { + if ((h->flags & XCOFF_DESCRIPTOR) != 0 + && (h->descriptor->root.type == bfd_link_hash_defined + || h->descriptor->root.type == bfd_link_hash_defweak)) + { + asection *sec; + + /* This is an undefined function descriptor associated with + a defined entry point. We can build up a function + descriptor ourselves. Believe it or not, the AIX linker + actually does this, and there are cases where we need to + do it as well. */ + sec = xcoff_hash_table (ldinfo->info)->descriptor_section; + h->root.type = bfd_link_hash_defined; + h->root.u.def.section = sec; + h->root.u.def.value = sec->_raw_size; + h->smclas = XMC_DS; + h->flags |= XCOFF_DEF_REGULAR; + sec->_raw_size += 12; + + /* A function descriptor uses two relocs: one for the + associated code, and one for the TOC address. */ + xcoff_hash_table (ldinfo->info)->ldrel_count += 2; + sec->reloc_count += 2; + + /* We handle writing out the contents of the descriptor in + xcoff_write_global_symbol. */ + } + else + { + (*_bfd_error_handler) + (_("warning: attempt to export undefined symbol `%s'"), + h->root.root.string); + h->ldsym = NULL; + return true; + } + } + + /* If this is still a common symbol, and it wasn't garbage + collected, we need to actually allocate space for it in the .bss + section. */ + if (h->root.type == bfd_link_hash_common + && (! xcoff_hash_table (ldinfo->info)->gc + || (h->flags & XCOFF_MARK) != 0) + && h->root.u.c.p->section->_raw_size == 0) + { + BFD_ASSERT (bfd_is_com_section (h->root.u.c.p->section)); + h->root.u.c.p->section->_raw_size = h->root.u.c.size; + } + + /* We need to add a symbol to the .loader section if it is mentioned + in a reloc which we are copying to the .loader section and it was + not defined or common, or if it is the entry point, or if it is + being exported. */ + + if (((h->flags & XCOFF_LDREL) == 0 + || h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak + || h->root.type == bfd_link_hash_common) + && (h->flags & XCOFF_ENTRY) == 0 + && (h->flags & XCOFF_EXPORT) == 0) + { + h->ldsym = NULL; + return true; + } + + /* We don't need to add this symbol if we did garbage collection and + we did not mark this symbol. */ + if (xcoff_hash_table (ldinfo->info)->gc + && (h->flags & XCOFF_MARK) == 0) + { + h->ldsym = NULL; + return true; + } + + /* We may have already processed this symbol due to the recursive + call above. */ + if ((h->flags & XCOFF_BUILT_LDSYM) != 0) + return true; + + /* We need to add this symbol to the .loader symbols. */ + + BFD_ASSERT (h->ldsym == NULL); + h->ldsym = ((struct internal_ldsym *) + bfd_zalloc (ldinfo->output_bfd, + sizeof (struct internal_ldsym))); + if (h->ldsym == NULL) + { + ldinfo->failed = true; + return false; + } + + if ((h->flags & XCOFF_IMPORT) != 0) + h->ldsym->l_ifile = h->ldindx; + + /* The first 3 symbol table indices are reserved to indicate the + sections. */ + h->ldindx = ldinfo->ldsym_count + 3; + + ++ldinfo->ldsym_count; + + len = strlen (h->root.root.string); + if (len <= SYMNMLEN) + strncpy (h->ldsym->_l._l_name, h->root.root.string, SYMNMLEN); + else + { + if (ldinfo->string_size + len + 3 > ldinfo->string_alc) + { + size_t newalc; + bfd_byte *newstrings; + + newalc = ldinfo->string_alc * 2; + if (newalc == 0) + newalc = 32; + while (ldinfo->string_size + len + 3 > newalc) + newalc *= 2; + + newstrings = ((bfd_byte *) + bfd_realloc ((PTR) ldinfo->strings, newalc)); + if (newstrings == NULL) + { + ldinfo->failed = true; + return false; + } + ldinfo->string_alc = newalc; + ldinfo->strings = newstrings; + } + + bfd_put_16 (ldinfo->output_bfd, len + 1, + ldinfo->strings + ldinfo->string_size); + strcpy (ldinfo->strings + ldinfo->string_size + 2, h->root.root.string); + h->ldsym->_l._l_l._l_zeroes = 0; + h->ldsym->_l._l_l._l_offset = ldinfo->string_size + 2; + ldinfo->string_size += len + 3; + } + + h->flags |= XCOFF_BUILT_LDSYM; + + return true; +} + +/* Do the final link step. */ + +boolean +_bfd_xcoff_bfd_final_link (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + bfd_size_type symesz; + struct xcoff_final_link_info finfo; + asection *o; + struct bfd_link_order *p; + size_t max_contents_size; + size_t max_sym_count; + size_t max_lineno_count; + size_t max_reloc_count; + size_t max_output_reloc_count; + file_ptr rel_filepos; + unsigned int relsz; + file_ptr line_filepos; + unsigned int linesz; + bfd *sub; + bfd_byte *external_relocs = NULL; + char strbuf[STRING_SIZE_SIZE]; + + if (info->shared) + abfd->flags |= DYNAMIC; + + symesz = bfd_coff_symesz (abfd); + + finfo.info = info; + finfo.output_bfd = abfd; + finfo.strtab = NULL; + finfo.section_info = NULL; + finfo.last_file_index = -1; + finfo.toc_symindx = -1; + finfo.internal_syms = NULL; + finfo.sym_indices = NULL; + finfo.outsyms = NULL; + finfo.linenos = NULL; + finfo.contents = NULL; + finfo.external_relocs = NULL; + + finfo.ldsym = ((struct external_ldsym *) + (xcoff_hash_table (info)->loader_section->contents + + LDHDRSZ)); + finfo.ldrel = ((struct external_ldrel *) + (xcoff_hash_table (info)->loader_section->contents + + LDHDRSZ + + xcoff_hash_table (info)->ldhdr.l_nsyms * LDSYMSZ)); + + xcoff_data (abfd)->coff.link_info = info; + + finfo.strtab = _bfd_stringtab_init (); + if (finfo.strtab == NULL) + goto error_return; + + /* Count the line number and relocation entries required for the + output file. Determine a few maximum sizes. */ + max_contents_size = 0; + max_lineno_count = 0; + max_reloc_count = 0; + for (o = abfd->sections; o != NULL; o = o->next) + { + o->reloc_count = 0; + o->lineno_count = 0; + for (p = o->link_order_head; p != NULL; p = p->next) + { + if (p->type == bfd_indirect_link_order) + { + asection *sec; + + sec = p->u.indirect.section; + + /* Mark all sections which are to be included in the + link. This will normally be every section. We need + to do this so that we can identify any sections which + the linker has decided to not include. */ + sec->linker_mark = true; + + if (info->strip == strip_none + || info->strip == strip_some) + o->lineno_count += sec->lineno_count; + + o->reloc_count += sec->reloc_count; + + if (sec->_raw_size > max_contents_size) + max_contents_size = sec->_raw_size; + if (sec->lineno_count > max_lineno_count) + max_lineno_count = sec->lineno_count; + if (coff_section_data (sec->owner, sec) != NULL + && xcoff_section_data (sec->owner, sec) != NULL + && (xcoff_section_data (sec->owner, sec)->lineno_count + > max_lineno_count)) + max_lineno_count = + xcoff_section_data (sec->owner, sec)->lineno_count; + if (sec->reloc_count > max_reloc_count) + max_reloc_count = sec->reloc_count; + } + else if (p->type == bfd_section_reloc_link_order + || p->type == bfd_symbol_reloc_link_order) + ++o->reloc_count; + } + } + + /* Compute the file positions for all the sections. */ + if (abfd->output_has_begun) + { + if (xcoff_hash_table (info)->file_align != 0) + abort (); + } + else + { + bfd_vma file_align; + + file_align = xcoff_hash_table (info)->file_align; + if (file_align != 0) + { + boolean saw_contents; + int indx; + asection **op; + file_ptr sofar; + + /* Insert .pad sections before every section which has + contents and is loaded, if it is preceded by some other + section which has contents and is loaded. */ + saw_contents = true; + for (op = &abfd->sections; *op != NULL; op = &(*op)->next) + { + if (strcmp ((*op)->name, ".pad") == 0) + saw_contents = false; + else if (((*op)->flags & SEC_HAS_CONTENTS) != 0 + && ((*op)->flags & SEC_LOAD) != 0) + { + if (! saw_contents) + saw_contents = true; + else + { + asection *n, *hold; + + hold = *op; + *op = NULL; + n = bfd_make_section_anyway (abfd, ".pad"); + BFD_ASSERT (*op == n); + n->next = hold; + n->flags = SEC_HAS_CONTENTS; + n->alignment_power = 0; + saw_contents = false; + } + } + } + + /* Reset the section indices after inserting the new + sections. */ + indx = 0; + for (o = abfd->sections; o != NULL; o = o->next) + { + ++indx; + o->target_index = indx; + } + BFD_ASSERT ((unsigned int) indx == abfd->section_count); + + /* Work out appropriate sizes for the .pad sections to force + each section to land on a page boundary. This bit of + code knows what compute_section_file_positions is going + to do. */ + sofar = bfd_coff_filhsz (abfd); + sofar += bfd_coff_aoutsz (abfd); + sofar += abfd->section_count * bfd_coff_scnhsz (abfd); + for (o = abfd->sections; o != NULL; o = o->next) + if (o->reloc_count >= 0xffff || o->lineno_count >= 0xffff) + sofar += bfd_coff_scnhsz (abfd); + + for (o = abfd->sections; o != NULL; o = o->next) + { + if (strcmp (o->name, ".pad") == 0) + { + bfd_vma pageoff; + + BFD_ASSERT (o->_raw_size == 0); + pageoff = sofar & (file_align - 1); + if (pageoff != 0) + { + o->_raw_size = file_align - pageoff; + sofar += file_align - pageoff; + o->flags |= SEC_HAS_CONTENTS; + } + } + else + { + if ((o->flags & SEC_HAS_CONTENTS) != 0) + sofar += BFD_ALIGN (o->_raw_size, + 1 << o->alignment_power); + } + } + } + + if (! bfd_coff_compute_section_file_positions (abfd)) + goto error_return; + } + + /* Allocate space for the pointers we need to keep for the relocs. */ + { + unsigned int i; + + /* We use section_count + 1, rather than section_count, because + the target_index fields are 1 based. */ + finfo.section_info = + ((struct xcoff_link_section_info *) + bfd_malloc ((abfd->section_count + 1) + * sizeof (struct xcoff_link_section_info))); + if (finfo.section_info == NULL) + goto error_return; + for (i = 0; i <= abfd->section_count; i++) + { + finfo.section_info[i].relocs = NULL; + finfo.section_info[i].rel_hashes = NULL; + finfo.section_info[i].toc_rel_hashes = NULL; + } + } + + /* Set the file positions for the relocs. */ + rel_filepos = obj_relocbase (abfd); + relsz = bfd_coff_relsz (abfd); + max_output_reloc_count = 0; + for (o = abfd->sections; o != NULL; o = o->next) + { + if (o->reloc_count == 0) + o->rel_filepos = 0; + else + { + /* A stripped file has no relocs. However, we still + allocate the buffers, so that later code doesn't have to + worry about whether we are stripping or not. */ + if (info->strip == strip_all) + o->rel_filepos = 0; + else + { + o->flags |= SEC_RELOC; + o->rel_filepos = rel_filepos; + rel_filepos += o->reloc_count * relsz; + } + + /* We don't know the indices of global symbols until we have + written out all the local symbols. For each section in + the output file, we keep an array of pointers to hash + table entries. Each entry in the array corresponds to a + reloc. When we find a reloc against a global symbol, we + set the corresponding entry in this array so that we can + fix up the symbol index after we have written out all the + local symbols. + + Because of this problem, we also keep the relocs in + memory until the end of the link. This wastes memory. + We could backpatch the file later, I suppose, although it + would be slow. */ + finfo.section_info[o->target_index].relocs = + ((struct internal_reloc *) + bfd_malloc (o->reloc_count * sizeof (struct internal_reloc))); + finfo.section_info[o->target_index].rel_hashes = + ((struct xcoff_link_hash_entry **) + bfd_malloc (o->reloc_count + * sizeof (struct xcoff_link_hash_entry *))); + if (finfo.section_info[o->target_index].relocs == NULL + || finfo.section_info[o->target_index].rel_hashes == NULL) + goto error_return; + + if (o->reloc_count > max_output_reloc_count) + max_output_reloc_count = o->reloc_count; + } + } + + /* We now know the size of the relocs, so we can determine the file + positions of the line numbers. */ + line_filepos = rel_filepos; + finfo.line_filepos = line_filepos; + linesz = bfd_coff_linesz (abfd); + for (o = abfd->sections; o != NULL; o = o->next) + { + if (o->lineno_count == 0) + o->line_filepos = 0; + else + { + o->line_filepos = line_filepos; + line_filepos += o->lineno_count * linesz; + } + + /* Reset the reloc and lineno counts, so that we can use them to + count the number of entries we have output so far. */ + o->reloc_count = 0; + o->lineno_count = 0; + } + + obj_sym_filepos (abfd) = line_filepos; + + /* Figure out the largest number of symbols in an input BFD. Take + the opportunity to clear the output_has_begun fields of all the + input BFD's. We want at least 6 symbols, since that is the + number which xcoff_write_global_symbol may need. */ + max_sym_count = 6; + for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + { + size_t sz; + + sub->output_has_begun = false; + sz = obj_raw_syment_count (sub); + if (sz > max_sym_count) + max_sym_count = sz; + } + + /* Allocate some buffers used while linking. */ + finfo.internal_syms = ((struct internal_syment *) + bfd_malloc (max_sym_count + * sizeof (struct internal_syment))); + finfo.sym_indices = (long *) bfd_malloc (max_sym_count * sizeof (long)); + finfo.outsyms = ((bfd_byte *) + bfd_malloc ((size_t) ((max_sym_count + 1) * symesz))); + finfo.linenos = (bfd_byte *) bfd_malloc (max_lineno_count + * bfd_coff_linesz (abfd)); + finfo.contents = (bfd_byte *) bfd_malloc (max_contents_size); + finfo.external_relocs = (bfd_byte *) bfd_malloc (max_reloc_count * relsz); + if ((finfo.internal_syms == NULL && max_sym_count > 0) + || (finfo.sym_indices == NULL && max_sym_count > 0) + || finfo.outsyms == NULL + || (finfo.linenos == NULL && max_lineno_count > 0) + || (finfo.contents == NULL && max_contents_size > 0) + || (finfo.external_relocs == NULL && max_reloc_count > 0)) + goto error_return; + + obj_raw_syment_count (abfd) = 0; + xcoff_data (abfd)->toc = (bfd_vma) -1; + + /* We now know the position of everything in the file, except that + we don't know the size of the symbol table and therefore we don't + know where the string table starts. We just build the string + table in memory as we go along. We process all the relocations + for a single input file at once. */ + for (o = abfd->sections; o != NULL; o = o->next) + { + for (p = o->link_order_head; p != NULL; p = p->next) + { + if (p->type == bfd_indirect_link_order + && p->u.indirect.section->owner->xvec == abfd->xvec) + { + sub = p->u.indirect.section->owner; + if (! sub->output_has_begun) + { + if (! xcoff_link_input_bfd (&finfo, sub)) + goto error_return; + sub->output_has_begun = true; + } + } + else if (p->type == bfd_section_reloc_link_order + || p->type == bfd_symbol_reloc_link_order) + { + if (! xcoff_reloc_link_order (abfd, &finfo, o, p)) + goto error_return; + } + else + { + if (! _bfd_default_link_order (abfd, info, o, p)) + goto error_return; + } + } + } + + /* Free up the buffers used by xcoff_link_input_bfd. */ + + if (finfo.internal_syms != NULL) + { + free (finfo.internal_syms); + finfo.internal_syms = NULL; + } + if (finfo.sym_indices != NULL) + { + free (finfo.sym_indices); + finfo.sym_indices = NULL; + } + if (finfo.linenos != NULL) + { + free (finfo.linenos); + finfo.linenos = NULL; + } + if (finfo.contents != NULL) + { + free (finfo.contents); + finfo.contents = NULL; + } + if (finfo.external_relocs != NULL) + { + free (finfo.external_relocs); + finfo.external_relocs = NULL; + } + + /* The value of the last C_FILE symbol is supposed to be -1. Write + it out again. */ + if (finfo.last_file_index != -1) + { + finfo.last_file.n_value = -1; + bfd_coff_swap_sym_out (abfd, (PTR) &finfo.last_file, + (PTR) finfo.outsyms); + if (bfd_seek (abfd, + (obj_sym_filepos (abfd) + + finfo.last_file_index * symesz), + SEEK_SET) != 0 + || bfd_write (finfo.outsyms, symesz, 1, abfd) != symesz) + goto error_return; + } + + /* Write out all the global symbols which do not come from XCOFF + input files. */ + xcoff_link_hash_traverse (xcoff_hash_table (info), + xcoff_write_global_symbol, + (PTR) &finfo); + + if (finfo.outsyms != NULL) + { + free (finfo.outsyms); + finfo.outsyms = NULL; + } + + /* Now that we have written out all the global symbols, we know the + symbol indices to use for relocs against them, and we can finally + write out the relocs. */ + external_relocs = (bfd_byte *) bfd_malloc (max_output_reloc_count * relsz); + if (external_relocs == NULL && max_output_reloc_count != 0) + goto error_return; + + for (o = abfd->sections; o != NULL; o = o->next) + { + struct internal_reloc *irel; + struct internal_reloc *irelend; + struct xcoff_link_hash_entry **rel_hash; + struct xcoff_toc_rel_hash *toc_rel_hash; + bfd_byte *erel; + + /* A stripped file has no relocs. */ + if (info->strip == strip_all) + { + o->reloc_count = 0; + continue; + } + + if (o->reloc_count == 0) + continue; + + irel = finfo.section_info[o->target_index].relocs; + irelend = irel + o->reloc_count; + rel_hash = finfo.section_info[o->target_index].rel_hashes; + for (; irel < irelend; irel++, rel_hash++, erel += relsz) + { + if (*rel_hash != NULL) + { + if ((*rel_hash)->indx < 0) + { + if (! ((*info->callbacks->unattached_reloc) + (info, (*rel_hash)->root.root.string, + (bfd *) NULL, o, irel->r_vaddr))) + goto error_return; + (*rel_hash)->indx = 0; + } + irel->r_symndx = (*rel_hash)->indx; + } + } + + for (toc_rel_hash = finfo.section_info[o->target_index].toc_rel_hashes; + toc_rel_hash != NULL; + toc_rel_hash = toc_rel_hash->next) + { + if (toc_rel_hash->h->u.toc_indx < 0) + { + if (! ((*info->callbacks->unattached_reloc) + (info, toc_rel_hash->h->root.root.string, + (bfd *) NULL, o, toc_rel_hash->rel->r_vaddr))) + goto error_return; + toc_rel_hash->h->u.toc_indx = 0; + } + toc_rel_hash->rel->r_symndx = toc_rel_hash->h->u.toc_indx; + } + + /* XCOFF requires that the relocs be sorted by address. We tend + to produce them in the order in which their containing csects + appear in the symbol table, which is not necessarily by + address. So we sort them here. There may be a better way to + do this. */ + qsort ((PTR) finfo.section_info[o->target_index].relocs, + o->reloc_count, sizeof (struct internal_reloc), + xcoff_sort_relocs); + + irel = finfo.section_info[o->target_index].relocs; + irelend = irel + o->reloc_count; + erel = external_relocs; + for (; irel < irelend; irel++, rel_hash++, erel += relsz) + bfd_coff_swap_reloc_out (abfd, (PTR) irel, (PTR) erel); + + if (bfd_seek (abfd, o->rel_filepos, SEEK_SET) != 0 + || bfd_write ((PTR) external_relocs, relsz, o->reloc_count, + abfd) != relsz * o->reloc_count) + goto error_return; + } + + if (external_relocs != NULL) + { + free (external_relocs); + external_relocs = NULL; + } + + /* Free up the section information. */ + if (finfo.section_info != NULL) + { + unsigned int i; + + for (i = 0; i < abfd->section_count; i++) + { + if (finfo.section_info[i].relocs != NULL) + free (finfo.section_info[i].relocs); + if (finfo.section_info[i].rel_hashes != NULL) + free (finfo.section_info[i].rel_hashes); + } + free (finfo.section_info); + finfo.section_info = NULL; + } + + /* Write out the loader section contents. */ + BFD_ASSERT ((bfd_byte *) finfo.ldrel + == (xcoff_hash_table (info)->loader_section->contents + + xcoff_hash_table (info)->ldhdr.l_impoff)); + o = xcoff_hash_table (info)->loader_section; + if (! bfd_set_section_contents (abfd, o->output_section, + o->contents, o->output_offset, + o->_raw_size)) + goto error_return; + + /* Write out the magic sections. */ + o = xcoff_hash_table (info)->linkage_section; + if (o->_raw_size > 0 + && ! bfd_set_section_contents (abfd, o->output_section, o->contents, + o->output_offset, o->_raw_size)) + goto error_return; + o = xcoff_hash_table (info)->toc_section; + if (o->_raw_size > 0 + && ! bfd_set_section_contents (abfd, o->output_section, o->contents, + o->output_offset, o->_raw_size)) + goto error_return; + o = xcoff_hash_table (info)->descriptor_section; + if (o->_raw_size > 0 + && ! bfd_set_section_contents (abfd, o->output_section, o->contents, + o->output_offset, o->_raw_size)) + goto error_return; + + /* Write out the string table. */ + if (bfd_seek (abfd, + (obj_sym_filepos (abfd) + + obj_raw_syment_count (abfd) * symesz), + SEEK_SET) != 0) + goto error_return; + bfd_h_put_32 (abfd, + _bfd_stringtab_size (finfo.strtab) + STRING_SIZE_SIZE, + (bfd_byte *) strbuf); + if (bfd_write (strbuf, 1, STRING_SIZE_SIZE, abfd) != STRING_SIZE_SIZE) + goto error_return; + if (! _bfd_stringtab_emit (abfd, finfo.strtab)) + goto error_return; + + _bfd_stringtab_free (finfo.strtab); + + /* Write out the debugging string table. */ + o = xcoff_hash_table (info)->debug_section; + if (o != NULL) + { + struct bfd_strtab_hash *debug_strtab; + + debug_strtab = xcoff_hash_table (info)->debug_strtab; + BFD_ASSERT (o->output_section->_raw_size - o->output_offset + >= _bfd_stringtab_size (debug_strtab)); + if (bfd_seek (abfd, + o->output_section->filepos + o->output_offset, + SEEK_SET) != 0) + goto error_return; + if (! _bfd_stringtab_emit (abfd, debug_strtab)) + goto error_return; + } + + /* Setting bfd_get_symcount to 0 will cause write_object_contents to + not try to write out the symbols. */ + bfd_get_symcount (abfd) = 0; + + return true; + + error_return: + if (finfo.strtab != NULL) + _bfd_stringtab_free (finfo.strtab); + if (finfo.section_info != NULL) + { + unsigned int i; + + for (i = 0; i < abfd->section_count; i++) + { + if (finfo.section_info[i].relocs != NULL) + free (finfo.section_info[i].relocs); + if (finfo.section_info[i].rel_hashes != NULL) + free (finfo.section_info[i].rel_hashes); + } + free (finfo.section_info); + } + if (finfo.internal_syms != NULL) + free (finfo.internal_syms); + if (finfo.sym_indices != NULL) + free (finfo.sym_indices); + if (finfo.outsyms != NULL) + free (finfo.outsyms); + if (finfo.linenos != NULL) + free (finfo.linenos); + if (finfo.contents != NULL) + free (finfo.contents); + if (finfo.external_relocs != NULL) + free (finfo.external_relocs); + if (external_relocs != NULL) + free (external_relocs); + return false; +} + +/* Link an input file into the linker output file. This function + handles all the sections and relocations of the input file at once. */ + +static boolean +xcoff_link_input_bfd (finfo, input_bfd) + struct xcoff_final_link_info *finfo; + bfd *input_bfd; +{ + bfd *output_bfd; + const char *strings; + bfd_size_type syment_base; + unsigned int n_tmask; + unsigned int n_btshft; + boolean copy, hash; + bfd_size_type isymesz; + bfd_size_type osymesz; + bfd_size_type linesz; + bfd_byte *esym; + bfd_byte *esym_end; + struct xcoff_link_hash_entry **sym_hash; + struct internal_syment *isymp; + asection **csectpp; + unsigned long *debug_index; + long *indexp; + unsigned long output_index; + bfd_byte *outsym; + unsigned int incls; + asection *oline; + boolean keep_syms; + asection *o; + + /* We can just skip DYNAMIC files, unless this is a static link. */ + if ((input_bfd->flags & DYNAMIC) != 0 + && ! finfo->info->static_link) + return true; + + /* Move all the symbols to the output file. */ + + output_bfd = finfo->output_bfd; + strings = NULL; + syment_base = obj_raw_syment_count (output_bfd); + isymesz = bfd_coff_symesz (input_bfd); + osymesz = bfd_coff_symesz (output_bfd); + linesz = bfd_coff_linesz (input_bfd); + BFD_ASSERT (linesz == bfd_coff_linesz (output_bfd)); + + n_tmask = coff_data (input_bfd)->local_n_tmask; + n_btshft = coff_data (input_bfd)->local_n_btshft; + + /* Define macros so that ISFCN, et. al., macros work correctly. */ +#define N_TMASK n_tmask +#define N_BTSHFT n_btshft + + copy = false; + if (! finfo->info->keep_memory) + copy = true; + hash = true; + if ((output_bfd->flags & BFD_TRADITIONAL_FORMAT) != 0) + hash = false; + + if (! _bfd_coff_get_external_symbols (input_bfd)) + return false; + + esym = (bfd_byte *) obj_coff_external_syms (input_bfd); + esym_end = esym + obj_raw_syment_count (input_bfd) * isymesz; + sym_hash = obj_xcoff_sym_hashes (input_bfd); + csectpp = xcoff_data (input_bfd)->csects; + debug_index = xcoff_data (input_bfd)->debug_indices; + isymp = finfo->internal_syms; + indexp = finfo->sym_indices; + output_index = syment_base; + outsym = finfo->outsyms; + incls = 0; + oline = NULL; + + while (esym < esym_end) + { + struct internal_syment isym; + union internal_auxent aux; + int smtyp = 0; + boolean skip; + boolean require; + int add; + + bfd_coff_swap_sym_in (input_bfd, (PTR) esym, (PTR) isymp); + + /* If this is a C_EXT or C_HIDEXT symbol, we need the csect + information. */ + if (isymp->n_sclass == C_EXT || isymp->n_sclass == C_HIDEXT) + { + BFD_ASSERT (isymp->n_numaux > 0); + bfd_coff_swap_aux_in (input_bfd, + (PTR) (esym + isymesz * isymp->n_numaux), + isymp->n_type, isymp->n_sclass, + isymp->n_numaux - 1, isymp->n_numaux, + (PTR) &aux); + smtyp = SMTYP_SMTYP (aux.x_csect.x_smtyp); + } + + /* Make a copy of *isymp so that the relocate_section function + always sees the original values. This is more reliable than + always recomputing the symbol value even if we are stripping + the symbol. */ + isym = *isymp; + + /* If this symbol is in the .loader section, swap out the + .loader symbol information. If this is an external symbol + reference to a defined symbol, though, then wait until we get + to the definition. */ + if (isym.n_sclass == C_EXT + && *sym_hash != NULL + && (*sym_hash)->ldsym != NULL + && (smtyp != XTY_ER + || (*sym_hash)->root.type == bfd_link_hash_undefined)) + { + struct xcoff_link_hash_entry *h; + struct internal_ldsym *ldsym; + + h = *sym_hash; + ldsym = h->ldsym; + if (isym.n_scnum > 0) + { + ldsym->l_scnum = (*csectpp)->output_section->target_index; + ldsym->l_value = (isym.n_value + + (*csectpp)->output_section->vma + + (*csectpp)->output_offset + - (*csectpp)->vma); + } + else + { + ldsym->l_scnum = isym.n_scnum; + ldsym->l_value = isym.n_value; + } + + ldsym->l_smtype = smtyp; + if (((h->flags & XCOFF_DEF_REGULAR) == 0 + && (h->flags & XCOFF_DEF_DYNAMIC) != 0) + || (h->flags & XCOFF_IMPORT) != 0) + ldsym->l_smtype |= L_IMPORT; + if (((h->flags & XCOFF_DEF_REGULAR) != 0 + && (h->flags & XCOFF_DEF_DYNAMIC) != 0) + || (h->flags & XCOFF_EXPORT) != 0) + ldsym->l_smtype |= L_EXPORT; + if ((h->flags & XCOFF_ENTRY) != 0) + ldsym->l_smtype |= L_ENTRY; + + ldsym->l_smclas = aux.x_csect.x_smclas; + + if (ldsym->l_ifile == (bfd_size_type) -1) + ldsym->l_ifile = 0; + else if (ldsym->l_ifile == 0) + { + if ((ldsym->l_smtype & L_IMPORT) == 0) + ldsym->l_ifile = 0; + else + { + bfd *impbfd; + + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + impbfd = h->root.u.def.section->owner; + else if (h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak) + impbfd = h->root.u.undef.abfd; + else + impbfd = NULL; + + if (impbfd == NULL) + ldsym->l_ifile = 0; + else + { + BFD_ASSERT (impbfd->xvec == finfo->output_bfd->xvec); + ldsym->l_ifile = xcoff_data (impbfd)->import_file_id; + } + } + } + + ldsym->l_parm = 0; + + BFD_ASSERT (h->ldindx >= 0); + BFD_ASSERT (LDSYMSZ == sizeof (struct external_ldsym)); + xcoff_swap_ldsym_out (finfo->output_bfd, ldsym, + finfo->ldsym + h->ldindx - 3); + h->ldsym = NULL; + + /* Fill in snentry now that we know the target_index. */ + if ((h->flags & XCOFF_ENTRY) != 0 + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak)) + xcoff_data (output_bfd)->snentry = + h->root.u.def.section->output_section->target_index; + } + + *indexp = -1; + + skip = false; + require = false; + add = 1 + isym.n_numaux; + + /* If we are skipping this csect, we want to skip this symbol. */ + if (*csectpp == NULL) + skip = true; + + /* If we garbage collected this csect, we want to skip this + symbol. */ + if (! skip + && xcoff_hash_table (finfo->info)->gc + && ((*csectpp)->flags & SEC_MARK) == 0 + && *csectpp != bfd_abs_section_ptr) + skip = true; + + /* An XCOFF linker always skips C_STAT symbols. */ + if (! skip + && isymp->n_sclass == C_STAT) + skip = true; + + /* We skip all but the first TOC anchor. */ + if (! skip + && isymp->n_sclass == C_HIDEXT + && aux.x_csect.x_smclas == XMC_TC0) + { + if (finfo->toc_symindx != -1) + skip = true; + else + { + bfd_vma tocval, tocend; + bfd *inp; + + tocval = ((*csectpp)->output_section->vma + + (*csectpp)->output_offset + + isym.n_value + - (*csectpp)->vma); + + /* We want to find out if tocval is a good value to use + as the TOC anchor--that is, whether we can access all + of the TOC using a 16 bit offset from tocval. This + test assumes that the TOC comes at the end of the + output section, as it does in the default linker + script. */ + tocend = ((*csectpp)->output_section->vma + + (*csectpp)->output_section->_raw_size); + for (inp = finfo->info->input_bfds; + inp != NULL; + inp = inp->link_next) + { + asection *o; + + for (o = inp->sections; o != NULL; o = o->next) + if (strcmp (o->name, ".tocbss") == 0) + { + bfd_vma new_toc_end; + new_toc_end = (o->output_section->vma + + o->output_offset + + o->_cooked_size); + if (new_toc_end > tocend) + tocend = new_toc_end; + } + + } + + if (tocval + 0x10000 < tocend) + { + (*_bfd_error_handler) + (_("TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling"), + (unsigned long) (tocend - tocval)); + bfd_set_error (bfd_error_file_too_big); + return false; + } + + if (tocval + 0x8000 < tocend) + { + bfd_vma tocadd; + + tocadd = tocend - (tocval + 0x8000); + tocval += tocadd; + isym.n_value += tocadd; + } + + finfo->toc_symindx = output_index; + xcoff_data (finfo->output_bfd)->toc = tocval; + xcoff_data (finfo->output_bfd)->sntoc = + (*csectpp)->output_section->target_index; + require = true; + } + } + + /* If we are stripping all symbols, we want to skip this one. */ + if (! skip + && finfo->info->strip == strip_all) + skip = true; + + /* We can skip resolved external references. */ + if (! skip + && isym.n_sclass == C_EXT + && smtyp == XTY_ER + && (*sym_hash)->root.type != bfd_link_hash_undefined) + skip = true; + + /* We can skip common symbols if they got defined somewhere + else. */ + if (! skip + && isym.n_sclass == C_EXT + && smtyp == XTY_CM + && ((*sym_hash)->root.type != bfd_link_hash_common + || (*sym_hash)->root.u.c.p->section != *csectpp) + && ((*sym_hash)->root.type != bfd_link_hash_defined + || (*sym_hash)->root.u.def.section != *csectpp)) + skip = true; + + /* Skip local symbols if we are discarding them. */ + if (! skip + && finfo->info->discard == discard_all + && isym.n_sclass != C_EXT + && (isym.n_sclass != C_HIDEXT + || smtyp != XTY_SD)) + skip = true; + + /* If we stripping debugging symbols, and this is a debugging + symbol, then skip it. */ + if (! skip + && finfo->info->strip == strip_debugger + && isym.n_scnum == N_DEBUG) + skip = true; + + /* If some symbols are stripped based on the name, work out the + name and decide whether to skip this symbol. We don't handle + this correctly for symbols whose names are in the .debug + section; to get it right we would need a new bfd_strtab_hash + function to return the string given the index. */ + if (! skip + && (finfo->info->strip == strip_some + || finfo->info->discard == discard_l) + && (debug_index == NULL || *debug_index == (unsigned long) -1)) + { + const char *name; + char buf[SYMNMLEN + 1]; + + name = _bfd_coff_internal_syment_name (input_bfd, &isym, buf); + if (name == NULL) + return false; + + if ((finfo->info->strip == strip_some + && (bfd_hash_lookup (finfo->info->keep_hash, name, false, + false) == NULL)) + || (finfo->info->discard == discard_l + && (isym.n_sclass != C_EXT + && (isym.n_sclass != C_HIDEXT + || smtyp != XTY_SD)) + && bfd_is_local_label_name (input_bfd, name))) + skip = true; + } + + /* We can not skip the first TOC anchor. */ + if (skip + && require + && finfo->info->strip != strip_all) + skip = false; + + /* We now know whether we are to skip this symbol or not. */ + if (! skip) + { + /* Adjust the symbol in order to output it. */ + + if (isym._n._n_n._n_zeroes == 0 + && isym._n._n_n._n_offset != 0) + { + /* This symbol has a long name. Enter it in the string + table we are building. If *debug_index != -1, the + name has already been entered in the .debug section. */ + if (debug_index != NULL && *debug_index != (unsigned long) -1) + isym._n._n_n._n_offset = *debug_index; + else + { + const char *name; + bfd_size_type indx; + + name = _bfd_coff_internal_syment_name (input_bfd, &isym, + (char *) NULL); + if (name == NULL) + return false; + indx = _bfd_stringtab_add (finfo->strtab, name, hash, copy); + if (indx == (bfd_size_type) -1) + return false; + isym._n._n_n._n_offset = STRING_SIZE_SIZE + indx; + } + } + + if (isym.n_sclass != C_BSTAT + && isym.n_sclass != C_ESTAT + && isym.n_sclass != C_DECL + && isym.n_scnum > 0) + { + isym.n_scnum = (*csectpp)->output_section->target_index; + isym.n_value += ((*csectpp)->output_section->vma + + (*csectpp)->output_offset + - (*csectpp)->vma); + } + + /* The value of a C_FILE symbol is the symbol index of the + next C_FILE symbol. The value of the last C_FILE symbol + is -1. We try to get this right, below, just before we + write the symbols out, but in the general case we may + have to write the symbol out twice. */ + if (isym.n_sclass == C_FILE) + { + if (finfo->last_file_index != -1 + && finfo->last_file.n_value != (long) output_index) + { + /* We must correct the value of the last C_FILE entry. */ + finfo->last_file.n_value = output_index; + if ((bfd_size_type) finfo->last_file_index >= syment_base) + { + /* The last C_FILE symbol is in this input file. */ + bfd_coff_swap_sym_out (output_bfd, + (PTR) &finfo->last_file, + (PTR) (finfo->outsyms + + ((finfo->last_file_index + - syment_base) + * osymesz))); + } + else + { + /* We have already written out the last C_FILE + symbol. We need to write it out again. We + borrow *outsym temporarily. */ + bfd_coff_swap_sym_out (output_bfd, + (PTR) &finfo->last_file, + (PTR) outsym); + if (bfd_seek (output_bfd, + (obj_sym_filepos (output_bfd) + + finfo->last_file_index * osymesz), + SEEK_SET) != 0 + || (bfd_write (outsym, osymesz, 1, output_bfd) + != osymesz)) + return false; + } + } + + finfo->last_file_index = output_index; + finfo->last_file = isym; + } + + /* The value of a C_BINCL or C_EINCL symbol is a file offset + into the line numbers. We update the symbol values when + we handle the line numbers. */ + if (isym.n_sclass == C_BINCL + || isym.n_sclass == C_EINCL) + { + isym.n_value = finfo->line_filepos; + ++incls; + } + + /* Output the symbol. */ + + bfd_coff_swap_sym_out (output_bfd, (PTR) &isym, (PTR) outsym); + + *indexp = output_index; + + if (isym.n_sclass == C_EXT) + { + long indx; + struct xcoff_link_hash_entry *h; + + indx = ((esym - (bfd_byte *) obj_coff_external_syms (input_bfd)) + / isymesz); + h = obj_xcoff_sym_hashes (input_bfd)[indx]; + BFD_ASSERT (h != NULL); + h->indx = output_index; + } + + /* If this is a symbol in the TOC which we may have merged + (class XMC_TC), remember the symbol index of the TOC + symbol. */ + if (isym.n_sclass == C_HIDEXT + && aux.x_csect.x_smclas == XMC_TC + && *sym_hash != NULL) + { + BFD_ASSERT (((*sym_hash)->flags & XCOFF_SET_TOC) == 0); + BFD_ASSERT ((*sym_hash)->toc_section != NULL); + (*sym_hash)->u.toc_indx = output_index; + } + + output_index += add; + outsym += add * osymesz; + } + + esym += add * isymesz; + isymp += add; + csectpp += add; + sym_hash += add; + if (debug_index != NULL) + debug_index += add; + ++indexp; + for (--add; add > 0; --add) + *indexp++ = -1; + } + + /* Fix up the aux entries and the C_BSTAT symbols. This must be + done in a separate pass, because we don't know the correct symbol + indices until we have already decided which symbols we are going + to keep. */ + + esym = (bfd_byte *) obj_coff_external_syms (input_bfd); + esym_end = esym + obj_raw_syment_count (input_bfd) * isymesz; + isymp = finfo->internal_syms; + indexp = finfo->sym_indices; + csectpp = xcoff_data (input_bfd)->csects; + outsym = finfo->outsyms; + while (esym < esym_end) + { + int add; + + add = 1 + isymp->n_numaux; + + if (*indexp < 0) + esym += add * isymesz; + else + { + int i; + + if (isymp->n_sclass == C_BSTAT) + { + struct internal_syment isym; + unsigned long indx; + + /* The value of a C_BSTAT symbol is the symbol table + index of the containing csect. */ + bfd_coff_swap_sym_in (output_bfd, (PTR) outsym, (PTR) &isym); + indx = isym.n_value; + if (indx < obj_raw_syment_count (input_bfd)) + { + long symindx; + + symindx = finfo->sym_indices[indx]; + if (symindx < 0) + isym.n_value = 0; + else + isym.n_value = symindx; + bfd_coff_swap_sym_out (output_bfd, (PTR) &isym, + (PTR) outsym); + } + } + + esym += isymesz; + outsym += osymesz; + + for (i = 0; i < isymp->n_numaux && esym < esym_end; i++) + { + union internal_auxent aux; + + bfd_coff_swap_aux_in (input_bfd, (PTR) esym, isymp->n_type, + isymp->n_sclass, i, isymp->n_numaux, + (PTR) &aux); + + if (isymp->n_sclass == C_FILE) + { + /* This is the file name (or some comment put in by + the compiler). If it is long, we must put it in + the string table. */ + if (aux.x_file.x_n.x_zeroes == 0 + && aux.x_file.x_n.x_offset != 0) + { + const char *filename; + bfd_size_type indx; + + BFD_ASSERT (aux.x_file.x_n.x_offset + >= STRING_SIZE_SIZE); + if (strings == NULL) + { + strings = _bfd_coff_read_string_table (input_bfd); + if (strings == NULL) + return false; + } + filename = strings + aux.x_file.x_n.x_offset; + indx = _bfd_stringtab_add (finfo->strtab, filename, + hash, copy); + if (indx == (bfd_size_type) -1) + return false; + aux.x_file.x_n.x_offset = STRING_SIZE_SIZE + indx; + } + } + else if ((isymp->n_sclass == C_EXT + || isymp->n_sclass == C_HIDEXT) + && i + 1 == isymp->n_numaux) + { + /* We don't support type checking. I don't know if + anybody does. */ + aux.x_csect.x_parmhash = 0; + /* I don't think anybody uses these fields, but we'd + better clobber them just in case. */ + aux.x_csect.x_stab = 0; + aux.x_csect.x_snstab = 0; + if (SMTYP_SMTYP (aux.x_csect.x_smtyp) == XTY_LD) + { + unsigned long indx; + + indx = aux.x_csect.x_scnlen.l; + if (indx < obj_raw_syment_count (input_bfd)) + { + long symindx; + + symindx = finfo->sym_indices[indx]; + if (symindx < 0) + aux.x_sym.x_tagndx.l = 0; + else + aux.x_sym.x_tagndx.l = symindx; + } + } + } + else if (isymp->n_sclass != C_STAT || isymp->n_type != T_NULL) + { + unsigned long indx; + + if (ISFCN (isymp->n_type) + || ISTAG (isymp->n_sclass) + || isymp->n_sclass == C_BLOCK + || isymp->n_sclass == C_FCN) + { + indx = aux.x_sym.x_fcnary.x_fcn.x_endndx.l; + if (indx > 0 + && indx < obj_raw_syment_count (input_bfd)) + { + /* We look forward through the symbol for + the index of the next symbol we are going + to include. I don't know if this is + entirely right. */ + while (finfo->sym_indices[indx] < 0 + && indx < obj_raw_syment_count (input_bfd)) + ++indx; + if (indx >= obj_raw_syment_count (input_bfd)) + indx = output_index; + else + indx = finfo->sym_indices[indx]; + aux.x_sym.x_fcnary.x_fcn.x_endndx.l = indx; + } + } + + indx = aux.x_sym.x_tagndx.l; + if (indx > 0 && indx < obj_raw_syment_count (input_bfd)) + { + long symindx; + + symindx = finfo->sym_indices[indx]; + if (symindx < 0) + aux.x_sym.x_tagndx.l = 0; + else + aux.x_sym.x_tagndx.l = symindx; + } + } + + /* Copy over the line numbers, unless we are stripping + them. We do this on a symbol by symbol basis in + order to more easily handle garbage collection. */ + if ((isymp->n_sclass == C_EXT + || isymp->n_sclass == C_HIDEXT) + && i == 0 + && isymp->n_numaux > 1 + && ISFCN (isymp->n_type) + && aux.x_sym.x_fcnary.x_fcn.x_lnnoptr != 0) + { + if (finfo->info->strip != strip_none + && finfo->info->strip != strip_some) + aux.x_sym.x_fcnary.x_fcn.x_lnnoptr = 0; + else + { + asection *enclosing; + unsigned int enc_count; + bfd_size_type linoff; + struct internal_lineno lin; + + o = *csectpp; + enclosing = xcoff_section_data (abfd, o)->enclosing; + enc_count = xcoff_section_data (abfd, o)->lineno_count; + if (oline != enclosing) + { + if (bfd_seek (input_bfd, + enclosing->line_filepos, + SEEK_SET) != 0 + || (bfd_read (finfo->linenos, linesz, + enc_count, input_bfd) + != linesz * enc_count)) + return false; + oline = enclosing; + } + + linoff = (aux.x_sym.x_fcnary.x_fcn.x_lnnoptr + - enclosing->line_filepos); + + bfd_coff_swap_lineno_in (input_bfd, + (PTR) (finfo->linenos + linoff), + (PTR) &lin); + if (lin.l_lnno != 0 + || ((bfd_size_type) lin.l_addr.l_symndx + != ((esym + - isymesz + - ((bfd_byte *) + obj_coff_external_syms (input_bfd))) + / isymesz))) + aux.x_sym.x_fcnary.x_fcn.x_lnnoptr = 0; + else + { + bfd_byte *linpend, *linp; + bfd_vma offset; + bfd_size_type count; + + lin.l_addr.l_symndx = *indexp; + bfd_coff_swap_lineno_out (output_bfd, (PTR) &lin, + (PTR) (finfo->linenos + + linoff)); + + linpend = (finfo->linenos + + enc_count * linesz); + offset = (o->output_section->vma + + o->output_offset + - o->vma); + for (linp = finfo->linenos + linoff + linesz; + linp < linpend; + linp += linesz) + { + bfd_coff_swap_lineno_in (input_bfd, (PTR) linp, + (PTR) &lin); + if (lin.l_lnno == 0) + break; + lin.l_addr.l_paddr += offset; + bfd_coff_swap_lineno_out (output_bfd, + (PTR) &lin, + (PTR) linp); + } + + count = (linp - (finfo->linenos + linoff)) / linesz; + + aux.x_sym.x_fcnary.x_fcn.x_lnnoptr = + (o->output_section->line_filepos + + o->output_section->lineno_count * linesz); + + if (bfd_seek (output_bfd, + aux.x_sym.x_fcnary.x_fcn.x_lnnoptr, + SEEK_SET) != 0 + || (bfd_write (finfo->linenos + linoff, + linesz, count, output_bfd) + != linesz * count)) + return false; + + o->output_section->lineno_count += count; + + if (incls > 0) + { + struct internal_syment *iisp, *iispend; + long *iindp; + bfd_byte *oos; + int iiadd; + + /* Update any C_BINCL or C_EINCL symbols + that refer to a line number in the + range we just output. */ + iisp = finfo->internal_syms; + iispend = (iisp + + obj_raw_syment_count (input_bfd)); + iindp = finfo->sym_indices; + oos = finfo->outsyms; + while (iisp < iispend) + { + if (*iindp >= 0 + && (iisp->n_sclass == C_BINCL + || iisp->n_sclass == C_EINCL) + && ((bfd_size_type) iisp->n_value + >= enclosing->line_filepos + linoff) + && ((bfd_size_type) iisp->n_value + < (enclosing->line_filepos + + enc_count * linesz))) + { + struct internal_syment iis; + + bfd_coff_swap_sym_in (output_bfd, + (PTR) oos, + (PTR) &iis); + iis.n_value = + (iisp->n_value + - enclosing->line_filepos + - linoff + + aux.x_sym.x_fcnary.x_fcn.x_lnnoptr); + bfd_coff_swap_sym_out (output_bfd, + (PTR) &iis, + (PTR) oos); + --incls; + } + + iiadd = 1 + iisp->n_numaux; + if (*iindp >= 0) + oos += iiadd * osymesz; + iisp += iiadd; + iindp += iiadd; + } + } + } + } + } + + bfd_coff_swap_aux_out (output_bfd, (PTR) &aux, isymp->n_type, + isymp->n_sclass, i, isymp->n_numaux, + (PTR) outsym); + outsym += osymesz; + esym += isymesz; + } + } + + indexp += add; + isymp += add; + csectpp += add; + } + + /* If we swapped out a C_FILE symbol, guess that the next C_FILE + symbol will be the first symbol in the next input file. In the + normal case, this will save us from writing out the C_FILE symbol + again. */ + if (finfo->last_file_index != -1 + && (bfd_size_type) finfo->last_file_index >= syment_base) + { + finfo->last_file.n_value = output_index; + bfd_coff_swap_sym_out (output_bfd, (PTR) &finfo->last_file, + (PTR) (finfo->outsyms + + ((finfo->last_file_index - syment_base) + * osymesz))); + } + + /* Write the modified symbols to the output file. */ + if (outsym > finfo->outsyms) + { + if (bfd_seek (output_bfd, + obj_sym_filepos (output_bfd) + syment_base * osymesz, + SEEK_SET) != 0 + || (bfd_write (finfo->outsyms, outsym - finfo->outsyms, 1, + output_bfd) + != (bfd_size_type) (outsym - finfo->outsyms))) + return false; + + BFD_ASSERT ((obj_raw_syment_count (output_bfd) + + (outsym - finfo->outsyms) / osymesz) + == output_index); + + obj_raw_syment_count (output_bfd) = output_index; + } + + /* Don't let the linker relocation routines discard the symbols. */ + keep_syms = obj_coff_keep_syms (input_bfd); + obj_coff_keep_syms (input_bfd) = true; + + /* Relocate the contents of each section. */ + for (o = input_bfd->sections; o != NULL; o = o->next) + { + bfd_byte *contents; + + if (! o->linker_mark) + { + /* This section was omitted from the link. */ + continue; + } + + if ((o->flags & SEC_HAS_CONTENTS) == 0 + || o->_raw_size == 0 + || (o->flags & SEC_IN_MEMORY) != 0) + continue; + + /* We have set filepos correctly for the sections we created to + represent csects, so bfd_get_section_contents should work. */ + if (coff_section_data (input_bfd, o) != NULL + && coff_section_data (input_bfd, o)->contents != NULL) + contents = coff_section_data (input_bfd, o)->contents; + else + { + if (! bfd_get_section_contents (input_bfd, o, finfo->contents, + (file_ptr) 0, o->_raw_size)) + return false; + contents = finfo->contents; + } + + if ((o->flags & SEC_RELOC) != 0) + { + int target_index; + struct internal_reloc *internal_relocs; + struct internal_reloc *irel; + bfd_vma offset; + struct internal_reloc *irelend; + struct xcoff_link_hash_entry **rel_hash; + long r_symndx; + + /* Read in the relocs. */ + target_index = o->output_section->target_index; + internal_relocs = (xcoff_read_internal_relocs + (input_bfd, o, false, finfo->external_relocs, + true, + (finfo->section_info[target_index].relocs + + o->output_section->reloc_count))); + if (internal_relocs == NULL) + return false; + + /* Call processor specific code to relocate the section + contents. */ + if (! bfd_coff_relocate_section (output_bfd, finfo->info, + input_bfd, o, + contents, + internal_relocs, + finfo->internal_syms, + xcoff_data (input_bfd)->csects)) + return false; + + offset = o->output_section->vma + o->output_offset - o->vma; + irel = internal_relocs; + irelend = irel + o->reloc_count; + rel_hash = (finfo->section_info[target_index].rel_hashes + + o->output_section->reloc_count); + for (; irel < irelend; irel++, rel_hash++) + { + struct xcoff_link_hash_entry *h = NULL; + struct internal_ldrel ldrel; + boolean quiet; + + *rel_hash = NULL; + + /* Adjust the reloc address and symbol index. */ + + irel->r_vaddr += offset; + + r_symndx = irel->r_symndx; + + if (r_symndx == -1) + h = NULL; + else + h = obj_xcoff_sym_hashes (input_bfd)[r_symndx]; + + if (r_symndx != -1 && finfo->info->strip != strip_all) + { + if (h != NULL + && h->smclas != XMC_TD + && (irel->r_type == R_TOC + || irel->r_type == R_GL + || irel->r_type == R_TCL + || irel->r_type == R_TRL + || irel->r_type == R_TRLA)) + { + /* This is a TOC relative reloc with a symbol + attached. The symbol should be the one which + this reloc is for. We want to make this + reloc against the TOC address of the symbol, + not the symbol itself. */ + BFD_ASSERT (h->toc_section != NULL); + BFD_ASSERT ((h->flags & XCOFF_SET_TOC) == 0); + if (h->u.toc_indx != -1) + irel->r_symndx = h->u.toc_indx; + else + { + struct xcoff_toc_rel_hash *n; + struct xcoff_link_section_info *si; + + n = ((struct xcoff_toc_rel_hash *) + bfd_alloc (finfo->output_bfd, + sizeof (struct xcoff_toc_rel_hash))); + if (n == NULL) + return false; + si = finfo->section_info + target_index; + n->next = si->toc_rel_hashes; + n->h = h; + n->rel = irel; + si->toc_rel_hashes = n; + } + } + else if (h != NULL) + { + /* This is a global symbol. */ + if (h->indx >= 0) + irel->r_symndx = h->indx; + else + { + /* This symbol is being written at the end + of the file, and we do not yet know the + symbol index. We save the pointer to the + hash table entry in the rel_hash list. + We set the indx field to -2 to indicate + that this symbol must not be stripped. */ + *rel_hash = h; + h->indx = -2; + } + } + else + { + long indx; + + indx = finfo->sym_indices[r_symndx]; + + if (indx == -1) + { + struct internal_syment *is; + + /* Relocations against a TC0 TOC anchor are + automatically transformed to be against + the TOC anchor in the output file. */ + is = finfo->internal_syms + r_symndx; + if (is->n_sclass == C_HIDEXT + && is->n_numaux > 0) + { + PTR auxptr; + union internal_auxent aux; + + auxptr = ((PTR) + (((bfd_byte *) + obj_coff_external_syms (input_bfd)) + + ((r_symndx + is->n_numaux) + * isymesz))); + bfd_coff_swap_aux_in (input_bfd, auxptr, + is->n_type, is->n_sclass, + is->n_numaux - 1, + is->n_numaux, + (PTR) &aux); + if (SMTYP_SMTYP (aux.x_csect.x_smtyp) == XTY_SD + && aux.x_csect.x_smclas == XMC_TC0) + indx = finfo->toc_symindx; + } + } + + if (indx != -1) + irel->r_symndx = indx; + else + { + struct internal_syment *is; + const char *name; + char buf[SYMNMLEN + 1]; + + /* This reloc is against a symbol we are + stripping. It would be possible to handle + this case, but I don't think it's worth it. */ + is = finfo->internal_syms + r_symndx; + + name = (_bfd_coff_internal_syment_name + (input_bfd, is, buf)); + if (name == NULL) + return false; + + if (! ((*finfo->info->callbacks->unattached_reloc) + (finfo->info, name, input_bfd, o, + irel->r_vaddr))) + return false; + } + } + } + + quiet = false; + switch (irel->r_type) + { + default: + if (h == NULL + || h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak + || h->root.type == bfd_link_hash_common) + break; + /* Fall through. */ + case R_POS: + case R_NEG: + case R_RL: + case R_RLA: + /* This reloc needs to be copied into the .loader + section. */ + ldrel.l_vaddr = irel->r_vaddr; + if (r_symndx == -1) + ldrel.l_symndx = -1; + else if (h == NULL + || (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak + || h->root.type == bfd_link_hash_common)) + { + asection *sec; + + if (h == NULL) + sec = xcoff_data (input_bfd)->csects[r_symndx]; + else if (h->root.type == bfd_link_hash_common) + sec = h->root.u.c.p->section; + else + sec = h->root.u.def.section; + sec = sec->output_section; + + if (strcmp (sec->name, ".text") == 0) + ldrel.l_symndx = 0; + else if (strcmp (sec->name, ".data") == 0) + ldrel.l_symndx = 1; + else if (strcmp (sec->name, ".bss") == 0) + ldrel.l_symndx = 2; + else + { + (*_bfd_error_handler) + (_("%s: loader reloc in unrecognized section `%s'"), + bfd_get_filename (input_bfd), + sec->name); + bfd_set_error (bfd_error_nonrepresentable_section); + return false; + } + } + else + { + if (! finfo->info->relocateable + && (h->flags & XCOFF_DEF_DYNAMIC) == 0 + && (h->flags & XCOFF_IMPORT) == 0) + { + /* We already called the undefined_symbol + callback for this relocation, in + _bfd_ppc_xcoff_relocate_section. Don't + issue any more warnings. */ + quiet = true; + } + if (h->ldindx < 0 && ! quiet) + { + (*_bfd_error_handler) + (_("%s: `%s' in loader reloc but not loader sym"), + bfd_get_filename (input_bfd), + h->root.root.string); + bfd_set_error (bfd_error_bad_value); + return false; + } + ldrel.l_symndx = h->ldindx; + } + ldrel.l_rtype = (irel->r_size << 8) | irel->r_type; + ldrel.l_rsecnm = o->output_section->target_index; + if (xcoff_hash_table (finfo->info)->textro + && strcmp (o->output_section->name, ".text") == 0 + && ! quiet) + { + (*_bfd_error_handler) + (_("%s: loader reloc in read-only section %s"), + bfd_get_filename (input_bfd), + bfd_get_section_name (finfo->output_bfd, + o->output_section)); + bfd_set_error (bfd_error_invalid_operation); + return false; + } + xcoff_swap_ldrel_out (output_bfd, &ldrel, + finfo->ldrel); + BFD_ASSERT (sizeof (struct external_ldrel) == LDRELSZ); + ++finfo->ldrel; + break; + + case R_TOC: + case R_GL: + case R_TCL: + case R_TRL: + case R_TRLA: + /* We should never need a .loader reloc for a TOC + relative reloc. */ + break; + } + } + + o->output_section->reloc_count += o->reloc_count; + } + + /* Write out the modified section contents. */ + if (! bfd_set_section_contents (output_bfd, o->output_section, + contents, o->output_offset, + (o->_cooked_size != 0 + ? o->_cooked_size + : o->_raw_size))) + return false; + } + + obj_coff_keep_syms (input_bfd) = keep_syms; + + if (! finfo->info->keep_memory) + { + if (! _bfd_coff_free_symbols (input_bfd)) + return false; + } + + return true; +} + +#undef N_TMASK +#undef N_BTSHFT + +/* Write out a non-XCOFF global symbol. */ + +static boolean +xcoff_write_global_symbol (h, p) + struct xcoff_link_hash_entry *h; + PTR p; +{ + struct xcoff_final_link_info *finfo = (struct xcoff_final_link_info *) p; + bfd *output_bfd; + bfd_byte *outsym; + struct internal_syment isym; + union internal_auxent aux; + + output_bfd = finfo->output_bfd; + outsym = finfo->outsyms; + + /* If this symbol was garbage collected, just skip it. */ + if (xcoff_hash_table (finfo->info)->gc + && (h->flags & XCOFF_MARK) == 0) + return true; + + /* If we need a .loader section entry, write it out. */ + if (h->ldsym != NULL) + { + struct internal_ldsym *ldsym; + bfd *impbfd; + + ldsym = h->ldsym; + + if (h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak) + { + ldsym->l_value = 0; + ldsym->l_scnum = N_UNDEF; + ldsym->l_smtype = XTY_ER; + impbfd = h->root.u.undef.abfd; + } + else if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + asection *sec; + + sec = h->root.u.def.section; + ldsym->l_value = (sec->output_section->vma + + sec->output_offset + + h->root.u.def.value); + ldsym->l_scnum = sec->output_section->target_index; + ldsym->l_smtype = XTY_SD; + impbfd = sec->owner; + } + else + abort (); + + if (((h->flags & XCOFF_DEF_REGULAR) == 0 + && (h->flags & XCOFF_DEF_DYNAMIC) != 0) + || (h->flags & XCOFF_IMPORT) != 0) + ldsym->l_smtype |= L_IMPORT; + if (((h->flags & XCOFF_DEF_REGULAR) != 0 + && (h->flags & XCOFF_DEF_DYNAMIC) != 0) + || (h->flags & XCOFF_EXPORT) != 0) + ldsym->l_smtype |= L_EXPORT; + if ((h->flags & XCOFF_ENTRY) != 0) + ldsym->l_smtype |= L_ENTRY; + + ldsym->l_smclas = h->smclas; + + if (ldsym->l_ifile == (bfd_size_type) -1) + ldsym->l_ifile = 0; + else if (ldsym->l_ifile == 0) + { + if ((ldsym->l_smtype & L_IMPORT) == 0) + ldsym->l_ifile = 0; + else if (impbfd == NULL) + ldsym->l_ifile = 0; + else + { + BFD_ASSERT (impbfd->xvec == output_bfd->xvec); + ldsym->l_ifile = xcoff_data (impbfd)->import_file_id; + } + } + + ldsym->l_parm = 0; + + BFD_ASSERT (h->ldindx >= 0); + BFD_ASSERT (LDSYMSZ == sizeof (struct external_ldsym)); + xcoff_swap_ldsym_out (output_bfd, ldsym, finfo->ldsym + h->ldindx - 3); + h->ldsym = NULL; + } + + /* If this symbol needs global linkage code, write it out. */ + if (h->root.type == bfd_link_hash_defined + && (h->root.u.def.section + == xcoff_hash_table (finfo->info)->linkage_section)) + { + bfd_byte *p; + bfd_vma tocoff; + unsigned int i; + + p = h->root.u.def.section->contents + h->root.u.def.value; + + /* The first instruction in the global linkage code loads a + specific TOC element. */ + tocoff = (h->descriptor->toc_section->output_section->vma + + h->descriptor->toc_section->output_offset + - xcoff_data (output_bfd)->toc); + if ((h->descriptor->flags & XCOFF_SET_TOC) != 0) + tocoff += h->descriptor->u.toc_offset; + bfd_put_32 (output_bfd, XCOFF_GLINK_FIRST | (tocoff & 0xffff), p); + for (i = 0, p += 4; + i < sizeof xcoff_glink_code / sizeof xcoff_glink_code[0]; + i++, p += 4) + bfd_put_32 (output_bfd, xcoff_glink_code[i], p); + } + + /* If we created a TOC entry for this symbol, write out the required + relocs. */ + if ((h->flags & XCOFF_SET_TOC) != 0) + { + asection *tocsec; + asection *osec; + int oindx; + struct internal_reloc *irel; + struct internal_ldrel ldrel; + struct internal_syment irsym; + union internal_auxent iraux; + + tocsec = h->toc_section; + osec = tocsec->output_section; + oindx = osec->target_index; + irel = finfo->section_info[oindx].relocs + osec->reloc_count; + irel->r_vaddr = (osec->vma + + tocsec->output_offset + + h->u.toc_offset); + if (h->indx >= 0) + irel->r_symndx = h->indx; + else + { + h->indx = -2; + irel->r_symndx = obj_raw_syment_count (output_bfd); + } + irel->r_type = R_POS; + irel->r_size = 31; + finfo->section_info[oindx].rel_hashes[osec->reloc_count] = NULL; + ++osec->reloc_count; + + BFD_ASSERT (h->ldindx >= 0); + ldrel.l_vaddr = irel->r_vaddr; + ldrel.l_symndx = h->ldindx; + ldrel.l_rtype = (31 << 8) | R_POS; + ldrel.l_rsecnm = oindx; + xcoff_swap_ldrel_out (output_bfd, &ldrel, finfo->ldrel); + ++finfo->ldrel; + + /* We need to emit a symbol to define a csect which holds the + reloc. */ + if (finfo->info->strip != strip_all) + { + if (strlen (h->root.root.string) <= SYMNMLEN) + strncpy (irsym._n._n_name, h->root.root.string, SYMNMLEN); + else + { + boolean hash; + bfd_size_type indx; + + hash = true; + if ((output_bfd->flags & BFD_TRADITIONAL_FORMAT) != 0) + hash = false; + indx = _bfd_stringtab_add (finfo->strtab, h->root.root.string, + hash, false); + if (indx == (bfd_size_type) -1) + return false; + irsym._n._n_n._n_zeroes = 0; + irsym._n._n_n._n_offset = STRING_SIZE_SIZE + indx; + } + + irsym.n_value = irel->r_vaddr; + irsym.n_scnum = osec->target_index; + irsym.n_sclass = C_HIDEXT; + irsym.n_type = T_NULL; + irsym.n_numaux = 1; + + bfd_coff_swap_sym_out (output_bfd, (PTR) &irsym, (PTR) outsym); + outsym += bfd_coff_symesz (output_bfd); + + memset (&iraux, 0, sizeof iraux); + iraux.x_csect.x_smtyp = XTY_SD; + iraux.x_csect.x_scnlen.l = 4; + iraux.x_csect.x_smclas = XMC_TC; + + bfd_coff_swap_aux_out (output_bfd, (PTR) &iraux, T_NULL, C_HIDEXT, + 0, 1, (PTR) outsym); + outsym += bfd_coff_auxesz (output_bfd); + + if (h->indx >= 0) + { + /* We aren't going to write out the symbols below, so we + need to write them out now. */ + if (bfd_seek (output_bfd, + (obj_sym_filepos (output_bfd) + + (obj_raw_syment_count (output_bfd) + * bfd_coff_symesz (output_bfd))), + SEEK_SET) != 0 + || (bfd_write (finfo->outsyms, outsym - finfo->outsyms, 1, + output_bfd) + != (bfd_size_type) (outsym - finfo->outsyms))) + return false; + obj_raw_syment_count (output_bfd) += + (outsym - finfo->outsyms) / bfd_coff_symesz (output_bfd); + + outsym = finfo->outsyms; + } + } + } + + /* If this symbol is a specially defined function descriptor, write + it out. The first word is the address of the function code + itself, the second word is the address of the TOC, and the third + word is zero. */ + if ((h->flags & XCOFF_DESCRIPTOR) != 0 + && h->root.type == bfd_link_hash_defined + && (h->root.u.def.section + == xcoff_hash_table (finfo->info)->descriptor_section)) + { + asection *sec; + asection *osec; + int oindx; + bfd_byte *p; + struct xcoff_link_hash_entry *hentry; + asection *esec; + struct internal_reloc *irel; + struct internal_ldrel ldrel; + asection *tsec; + + sec = h->root.u.def.section; + osec = sec->output_section; + oindx = osec->target_index; + p = sec->contents + h->root.u.def.value; + + hentry = h->descriptor; + BFD_ASSERT (hentry != NULL + && (hentry->root.type == bfd_link_hash_defined + || hentry->root.type == bfd_link_hash_defweak)); + esec = hentry->root.u.def.section; + bfd_put_32 (output_bfd, + (esec->output_section->vma + + esec->output_offset + + hentry->root.u.def.value), + p); + + irel = finfo->section_info[oindx].relocs + osec->reloc_count; + irel->r_vaddr = (osec->vma + + sec->output_offset + + h->root.u.def.value); + irel->r_symndx = esec->output_section->target_index; + irel->r_type = R_POS; + irel->r_size = 31; + finfo->section_info[oindx].rel_hashes[osec->reloc_count] = NULL; + ++osec->reloc_count; + + ldrel.l_vaddr = irel->r_vaddr; + if (strcmp (esec->output_section->name, ".text") == 0) + ldrel.l_symndx = 0; + else if (strcmp (esec->output_section->name, ".data") == 0) + ldrel.l_symndx = 1; + else if (strcmp (esec->output_section->name, ".bss") == 0) + ldrel.l_symndx = 2; + else + { + (*_bfd_error_handler) + (_("%s: loader reloc in unrecognized section `%s'"), + bfd_get_filename (output_bfd), + esec->output_section->name); + bfd_set_error (bfd_error_nonrepresentable_section); + return false; + } + ldrel.l_rtype = (31 << 8) | R_POS; + ldrel.l_rsecnm = oindx; + xcoff_swap_ldrel_out (output_bfd, &ldrel, finfo->ldrel); + ++finfo->ldrel; + + bfd_put_32 (output_bfd, xcoff_data (output_bfd)->toc, p + 4); + + tsec = coff_section_from_bfd_index (output_bfd, + xcoff_data (output_bfd)->sntoc); + + ++irel; + irel->r_vaddr = (osec->vma + + sec->output_offset + + h->root.u.def.value + + 4); + irel->r_symndx = tsec->output_section->target_index; + irel->r_type = R_POS; + irel->r_size = 31; + finfo->section_info[oindx].rel_hashes[osec->reloc_count] = NULL; + ++osec->reloc_count; + + ldrel.l_vaddr = irel->r_vaddr; + if (strcmp (tsec->output_section->name, ".text") == 0) + ldrel.l_symndx = 0; + else if (strcmp (tsec->output_section->name, ".data") == 0) + ldrel.l_symndx = 1; + else if (strcmp (tsec->output_section->name, ".bss") == 0) + ldrel.l_symndx = 2; + else + { + (*_bfd_error_handler) + (_("%s: loader reloc in unrecognized section `%s'"), + bfd_get_filename (output_bfd), + tsec->output_section->name); + bfd_set_error (bfd_error_nonrepresentable_section); + return false; + } + ldrel.l_rtype = (31 << 8) | R_POS; + ldrel.l_rsecnm = oindx; + xcoff_swap_ldrel_out (output_bfd, &ldrel, finfo->ldrel); + ++finfo->ldrel; + } + + if (h->indx >= 0 || finfo->info->strip == strip_all) + { + BFD_ASSERT (outsym == finfo->outsyms); + return true; + } + + if (h->indx != -2 + && (finfo->info->strip == strip_all + || (finfo->info->strip == strip_some + && (bfd_hash_lookup (finfo->info->keep_hash, + h->root.root.string, false, false) + == NULL)))) + { + BFD_ASSERT (outsym == finfo->outsyms); + return true; + } + + if (h->indx != -2 + && (h->flags & (XCOFF_REF_REGULAR | XCOFF_DEF_REGULAR)) == 0) + { + BFD_ASSERT (outsym == finfo->outsyms); + return true; + } + + memset (&aux, 0, sizeof aux); + + h->indx = obj_raw_syment_count (output_bfd); + + if (strlen (h->root.root.string) <= SYMNMLEN) + strncpy (isym._n._n_name, h->root.root.string, SYMNMLEN); + else + { + boolean hash; + bfd_size_type indx; + + hash = true; + if ((output_bfd->flags & BFD_TRADITIONAL_FORMAT) != 0) + hash = false; + indx = _bfd_stringtab_add (finfo->strtab, h->root.root.string, hash, + false); + if (indx == (bfd_size_type) -1) + return false; + isym._n._n_n._n_zeroes = 0; + isym._n._n_n._n_offset = STRING_SIZE_SIZE + indx; + } + + if (h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak) + { + isym.n_value = 0; + isym.n_scnum = N_UNDEF; + isym.n_sclass = C_EXT; + aux.x_csect.x_smtyp = XTY_ER; + } + else if ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && h->smclas == XMC_XO) + { + BFD_ASSERT (bfd_is_abs_section (h->root.u.def.section)); + isym.n_value = h->root.u.def.value; + isym.n_scnum = N_UNDEF; + isym.n_sclass = C_EXT; + aux.x_csect.x_smtyp = XTY_ER; + } + else if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + struct xcoff_link_size_list *l; + + isym.n_value = (h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset + + h->root.u.def.value); + isym.n_scnum = h->root.u.def.section->output_section->target_index; + isym.n_sclass = C_HIDEXT; + aux.x_csect.x_smtyp = XTY_SD; + + if ((h->flags & XCOFF_HAS_SIZE) != 0) + { + for (l = xcoff_hash_table (finfo->info)->size_list; + l != NULL; + l = l->next) + { + if (l->h == h) + { + aux.x_csect.x_scnlen.l = l->size; + break; + } + } + } + } + else if (h->root.type == bfd_link_hash_common) + { + isym.n_value = (h->root.u.c.p->section->output_section->vma + + h->root.u.c.p->section->output_offset); + isym.n_scnum = h->root.u.c.p->section->output_section->target_index; + isym.n_sclass = C_EXT; + aux.x_csect.x_smtyp = XTY_CM; + aux.x_csect.x_scnlen.l = h->root.u.c.size; + } + else + abort (); + + isym.n_type = T_NULL; + isym.n_numaux = 1; + + bfd_coff_swap_sym_out (output_bfd, (PTR) &isym, (PTR) outsym); + outsym += bfd_coff_symesz (output_bfd); + + aux.x_csect.x_smclas = h->smclas; + + bfd_coff_swap_aux_out (output_bfd, (PTR) &aux, T_NULL, isym.n_sclass, 0, 1, + (PTR) outsym); + outsym += bfd_coff_auxesz (output_bfd); + + if ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && h->smclas != XMC_XO) + { + /* We just output an SD symbol. Now output an LD symbol. */ + + h->indx += 2; + + isym.n_sclass = C_EXT; + bfd_coff_swap_sym_out (output_bfd, (PTR) &isym, (PTR) outsym); + outsym += bfd_coff_symesz (output_bfd); + + aux.x_csect.x_smtyp = XTY_LD; + aux.x_csect.x_scnlen.l = obj_raw_syment_count (output_bfd); + + bfd_coff_swap_aux_out (output_bfd, (PTR) &aux, T_NULL, C_EXT, 0, 1, + (PTR) outsym); + outsym += bfd_coff_auxesz (output_bfd); + } + + if (bfd_seek (output_bfd, + (obj_sym_filepos (output_bfd) + + (obj_raw_syment_count (output_bfd) + * bfd_coff_symesz (output_bfd))), + SEEK_SET) != 0 + || (bfd_write (finfo->outsyms, outsym - finfo->outsyms, 1, output_bfd) + != (bfd_size_type) (outsym - finfo->outsyms))) + return false; + obj_raw_syment_count (output_bfd) += + (outsym - finfo->outsyms) / bfd_coff_symesz (output_bfd); + + return true; +} + +/* Handle a link order which is supposed to generate a reloc. */ + +static boolean +xcoff_reloc_link_order (output_bfd, finfo, output_section, link_order) + bfd *output_bfd; + struct xcoff_final_link_info *finfo; + asection *output_section; + struct bfd_link_order *link_order; +{ + reloc_howto_type *howto; + struct xcoff_link_hash_entry *h; + asection *hsec; + bfd_vma hval; + bfd_vma addend; + struct internal_reloc *irel; + struct xcoff_link_hash_entry **rel_hash_ptr; + struct internal_ldrel ldrel; + + if (link_order->type == bfd_section_reloc_link_order) + { + /* We need to somehow locate a symbol in the right section. The + symbol must either have a value of zero, or we must adjust + the addend by the value of the symbol. FIXME: Write this + when we need it. The old linker couldn't handle this anyhow. */ + abort (); + } + + howto = bfd_reloc_type_lookup (output_bfd, link_order->u.reloc.p->reloc); + if (howto == NULL) + { + bfd_set_error (bfd_error_bad_value); + return false; + } + + h = ((struct xcoff_link_hash_entry *) + bfd_wrapped_link_hash_lookup (output_bfd, finfo->info, + link_order->u.reloc.p->u.name, + false, false, true)); + if (h == NULL) + { + if (! ((*finfo->info->callbacks->unattached_reloc) + (finfo->info, link_order->u.reloc.p->u.name, (bfd *) NULL, + (asection *) NULL, (bfd_vma) 0))) + return false; + return true; + } + + if (h->root.type == bfd_link_hash_common) + { + hsec = h->root.u.c.p->section; + hval = 0; + } + else if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + hsec = h->root.u.def.section; + hval = h->root.u.def.value; + } + else + { + hsec = NULL; + hval = 0; + } + + addend = link_order->u.reloc.p->addend; + if (hsec != NULL) + addend += (hsec->output_section->vma + + hsec->output_offset + + hval); + + if (addend != 0) + { + bfd_size_type size; + bfd_byte *buf; + bfd_reloc_status_type rstat; + boolean ok; + + size = bfd_get_reloc_size (howto); + buf = (bfd_byte *) bfd_zmalloc (size); + if (buf == NULL) + return false; + + rstat = _bfd_relocate_contents (howto, output_bfd, addend, buf); + switch (rstat) + { + case bfd_reloc_ok: + break; + default: + case bfd_reloc_outofrange: + abort (); + case bfd_reloc_overflow: + if (! ((*finfo->info->callbacks->reloc_overflow) + (finfo->info, link_order->u.reloc.p->u.name, + howto->name, addend, (bfd *) NULL, (asection *) NULL, + (bfd_vma) 0))) + { + free (buf); + return false; + } + break; + } + ok = bfd_set_section_contents (output_bfd, output_section, (PTR) buf, + (file_ptr) link_order->offset, size); + free (buf); + if (! ok) + return false; + } + + /* Store the reloc information in the right place. It will get + swapped and written out at the end of the final_link routine. */ + + irel = (finfo->section_info[output_section->target_index].relocs + + output_section->reloc_count); + rel_hash_ptr = (finfo->section_info[output_section->target_index].rel_hashes + + output_section->reloc_count); + + memset (irel, 0, sizeof (struct internal_reloc)); + *rel_hash_ptr = NULL; + + irel->r_vaddr = output_section->vma + link_order->offset; + + if (h->indx >= 0) + irel->r_symndx = h->indx; + else + { + /* Set the index to -2 to force this symbol to get written out. */ + h->indx = -2; + *rel_hash_ptr = h; + irel->r_symndx = 0; + } + + irel->r_type = howto->type; + irel->r_size = howto->bitsize - 1; + if (howto->complain_on_overflow == complain_overflow_signed) + irel->r_size |= 0x80; + + ++output_section->reloc_count; + + /* Now output the reloc to the .loader section. */ + + ldrel.l_vaddr = irel->r_vaddr; + + if (hsec != NULL) + { + const char *secname; + + secname = hsec->output_section->name; + + if (strcmp (secname, ".text") == 0) + ldrel.l_symndx = 0; + else if (strcmp (secname, ".data") == 0) + ldrel.l_symndx = 1; + else if (strcmp (secname, ".bss") == 0) + ldrel.l_symndx = 2; + else + { + (*_bfd_error_handler) + (_("%s: loader reloc in unrecognized section `%s'"), + bfd_get_filename (output_bfd), secname); + bfd_set_error (bfd_error_nonrepresentable_section); + return false; + } + } + else + { + if (h->ldindx < 0) + { + (*_bfd_error_handler) + (_("%s: `%s' in loader reloc but not loader sym"), + bfd_get_filename (output_bfd), + h->root.root.string); + bfd_set_error (bfd_error_bad_value); + return false; + } + ldrel.l_symndx = h->ldindx; + } + + ldrel.l_rtype = (irel->r_size << 8) | irel->r_type; + ldrel.l_rsecnm = output_section->target_index; + xcoff_swap_ldrel_out (output_bfd, &ldrel, finfo->ldrel); + ++finfo->ldrel; + + return true; +} + +/* Sort relocs by VMA. This is called via qsort. */ + +static int +xcoff_sort_relocs (p1, p2) + const PTR p1; + const PTR p2; +{ + const struct internal_reloc *r1 = (const struct internal_reloc *) p1; + const struct internal_reloc *r2 = (const struct internal_reloc *) p2; + + if (r1->r_vaddr > r2->r_vaddr) + return 1; + else if (r1->r_vaddr < r2->r_vaddr) + return -1; + else + return 0; +} + +/* This is the relocation function for the RS/6000/POWER/PowerPC. + This is currently the only processor which uses XCOFF; I hope that + will never change. */ + +boolean +_bfd_ppc_xcoff_relocate_section (output_bfd, info, input_bfd, + input_section, contents, relocs, syms, + sections) + bfd *output_bfd; + struct bfd_link_info *info; + bfd *input_bfd; + asection *input_section; + bfd_byte *contents; + struct internal_reloc *relocs; + struct internal_syment *syms; + asection **sections; +{ + struct internal_reloc *rel; + struct internal_reloc *relend; + + rel = relocs; + relend = rel + input_section->reloc_count; + for (; rel < relend; rel++) + { + long symndx; + struct xcoff_link_hash_entry *h; + struct internal_syment *sym; + bfd_vma addend; + bfd_vma val; + struct reloc_howto_struct howto; + bfd_reloc_status_type rstat; + + /* Relocation type R_REF is a special relocation type which is + merely used to prevent garbage collection from occurring for + the csect including the symbol which it references. */ + if (rel->r_type == R_REF) + continue; + + symndx = rel->r_symndx; + + if (symndx == -1) + { + h = NULL; + sym = NULL; + addend = 0; + } + else + { + h = obj_xcoff_sym_hashes (input_bfd)[symndx]; + sym = syms + symndx; + addend = - sym->n_value; + } + + /* We build the howto information on the fly. */ + + howto.type = rel->r_type; + howto.rightshift = 0; + howto.size = 2; + howto.bitsize = (rel->r_size & 0x1f) + 1; + howto.pc_relative = false; + howto.bitpos = 0; + if ((rel->r_size & 0x80) != 0) + howto.complain_on_overflow = complain_overflow_signed; + else + howto.complain_on_overflow = complain_overflow_bitfield; + howto.special_function = NULL; + howto.name = "internal"; + howto.partial_inplace = true; + if (howto.bitsize == 32) + howto.src_mask = howto.dst_mask = 0xffffffff; + else + { + howto.src_mask = howto.dst_mask = (1 << howto.bitsize) - 1; + if (howto.bitsize == 16) + howto.size = 1; + } + howto.pcrel_offset = false; + + val = 0; + + if (h == NULL) + { + asection *sec; + + if (symndx == -1) + { + sec = bfd_abs_section_ptr; + val = 0; + } + else + { + sec = sections[symndx]; + /* Hack to make sure we use the right TOC anchor value + if this reloc is against the TOC anchor. */ + if (sec->name[3] == '0' + && strcmp (sec->name, ".tc0") == 0) + val = xcoff_data (output_bfd)->toc; + else + val = (sec->output_section->vma + + sec->output_offset + + sym->n_value + - sec->vma); + } + } + else + { + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + asection *sec; + + sec = h->root.u.def.section; + val = (h->root.u.def.value + + sec->output_section->vma + + sec->output_offset); + } + else if (h->root.type == bfd_link_hash_common) + { + asection *sec; + + sec = h->root.u.c.p->section; + val = (sec->output_section->vma + + sec->output_offset); + } + else if ((h->flags & XCOFF_DEF_DYNAMIC) != 0 + || (h->flags & XCOFF_IMPORT) != 0) + { + /* Every symbol in a shared object is defined somewhere. */ + val = 0; + } + else if (! info->relocateable) + { + if (! ((*info->callbacks->undefined_symbol) + (info, h->root.root.string, input_bfd, input_section, + rel->r_vaddr - input_section->vma, true))) + return false; + + /* Don't try to process the reloc. It can't help, and + it may generate another error. */ + continue; + } + } + + /* I took the relocation type definitions from two documents: + the PowerPC AIX Version 4 Application Binary Interface, First + Edition (April 1992), and the PowerOpen ABI, Big-Endian + 32-Bit Hardware Implementation (June 30, 1994). Differences + between the documents are noted below. */ + + switch (rel->r_type) + { + case R_RTB: + case R_RRTBI: + case R_RRTBA: + /* These relocs are defined by the PowerPC ABI to be + relative branches which use half of the difference + between the symbol and the program counter. I can't + quite figure out when this is useful. These relocs are + not defined by the PowerOpen ABI. */ + default: + (*_bfd_error_handler) + (_("%s: unsupported relocation type 0x%02x"), + bfd_get_filename (input_bfd), (unsigned int) rel->r_type); + bfd_set_error (bfd_error_bad_value); + return false; + case R_POS: + /* Simple positive relocation. */ + break; + case R_NEG: + /* Simple negative relocation. */ + val = - val; + break; + case R_REL: + /* Simple PC relative relocation. */ + howto.pc_relative = true; + break; + case R_TOC: + /* TOC relative relocation. The value in the instruction in + the input file is the offset from the input file TOC to + the desired location. We want the offset from the final + TOC to the desired location. We have: + isym = iTOC + in + iinsn = in + o + osym = oTOC + on + oinsn = on + o + so we must change insn by on - in. + */ + case R_GL: + /* Global linkage relocation. The value of this relocation + is the address of the entry in the TOC section. */ + case R_TCL: + /* Local object TOC address. I can't figure out the + difference between this and case R_GL. */ + case R_TRL: + /* TOC relative relocation. A TOC relative load instruction + which may be changed to a load address instruction. + FIXME: We don't currently implement this optimization. */ + case R_TRLA: + /* TOC relative relocation. This is a TOC relative load + address instruction which may be changed to a load + instruction. FIXME: I don't know if this is the correct + implementation. */ + if (h != NULL && h->smclas != XMC_TD) + { + if (h->toc_section == NULL) + { + (*_bfd_error_handler) + (_("%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry"), + bfd_get_filename (input_bfd), rel->r_vaddr, + h->root.root.string); + bfd_set_error (bfd_error_bad_value); + return false; + } + + BFD_ASSERT ((h->flags & XCOFF_SET_TOC) == 0); + val = (h->toc_section->output_section->vma + + h->toc_section->output_offset); + } + + val = ((val - xcoff_data (output_bfd)->toc) + - (sym->n_value - xcoff_data (input_bfd)->toc)); + addend = 0; + break; + case R_BA: + /* Absolute branch. We don't want to mess with the lower + two bits of the instruction. */ + case R_CAI: + /* The PowerPC ABI defines this as an absolute call which + may be modified to become a relative call. The PowerOpen + ABI does not define this relocation type. */ + case R_RBA: + /* Absolute branch which may be modified to become a + relative branch. */ + case R_RBAC: + /* The PowerPC ABI defines this as an absolute branch to a + fixed address which may be modified to an absolute branch + to a symbol. The PowerOpen ABI does not define this + relocation type. */ + case R_RBRC: + /* The PowerPC ABI defines this as an absolute branch to a + fixed address which may be modified to a relative branch. + The PowerOpen ABI does not define this relocation type. */ + howto.src_mask &= ~3; + howto.dst_mask = howto.src_mask; + break; + case R_BR: + /* Relative branch. We don't want to mess with the lower + two bits of the instruction. */ + case R_CREL: + /* The PowerPC ABI defines this as a relative call which may + be modified to become an absolute call. The PowerOpen + ABI does not define this relocation type. */ + case R_RBR: + /* A relative branch which may be modified to become an + absolute branch. FIXME: We don't implement this, + although we should for symbols of storage mapping class + XMC_XO. */ + howto.pc_relative = true; + howto.src_mask &= ~3; + howto.dst_mask = howto.src_mask; + break; + case R_RL: + /* The PowerPC AIX ABI describes this as a load which may be + changed to a load address. The PowerOpen ABI says this + is the same as case R_POS. */ + break; + case R_RLA: + /* The PowerPC AIX ABI describes this as a load address + which may be changed to a load. The PowerOpen ABI says + this is the same as R_POS. */ + break; + } + + /* If we see an R_BR or R_RBR reloc which is jumping to global + linkage code, and it is followed by an appropriate cror nop + instruction, we replace the cror with lwz r2,20(r1). This + restores the TOC after the glink code. Contrariwise, if the + call is followed by a lwz r2,20(r1), but the call is not + going to global linkage code, we can replace the load with a + cror. */ + if ((rel->r_type == R_BR || rel->r_type == R_RBR) + && h != NULL + && h->root.type == bfd_link_hash_defined + && (rel->r_vaddr - input_section->vma + 8 + <= input_section->_cooked_size)) + { + bfd_byte *pnext; + unsigned long next; + + pnext = contents + (rel->r_vaddr - input_section->vma) + 4; + next = bfd_get_32 (input_bfd, pnext); + + /* The _ptrgl function is magic. It is used by the AIX + compiler to call a function through a pointer. */ + if (h->smclas == XMC_GL + || strcmp (h->root.root.string, "._ptrgl") == 0) + { + if (next == 0x4def7b82 /* cror 15,15,15 */ + || next == 0x4ffffb82 /* cror 31,31,31 */ + || next == 0x60000000) /* ori r0,r0,0 */ + bfd_put_32 (input_bfd, 0x80410014, pnext); /* lwz r1,20(r1) */ + } + else + { + if (next == 0x80410014) /* lwz r1,20(r1) */ + bfd_put_32 (input_bfd, 0x60000000, pnext); /* ori r0,r0,0 */ + } + } + + /* A PC relative reloc includes the section address. */ + if (howto.pc_relative) + addend += input_section->vma; + + rstat = _bfd_final_link_relocate (&howto, input_bfd, input_section, + contents, + rel->r_vaddr - input_section->vma, + val, addend); + + switch (rstat) + { + default: + abort (); + case bfd_reloc_ok: + break; + case bfd_reloc_overflow: + { + const char *name; + char buf[SYMNMLEN + 1]; + char howto_name[10]; + + if (symndx == -1) + name = "*ABS*"; + else if (h != NULL) + name = h->root.root.string; + else + { + name = _bfd_coff_internal_syment_name (input_bfd, sym, buf); + if (name == NULL) + return false; + } + sprintf (howto_name, "0x%02x", rel->r_type); + + if (! ((*info->callbacks->reloc_overflow) + (info, name, howto_name, (bfd_vma) 0, input_bfd, + input_section, rel->r_vaddr - input_section->vma))) + return false; + } + } + } + + return true; +} diff --git a/contrib/binutils/gas/config/tc-ia64.c b/contrib/binutils/gas/config/tc-ia64.c new file mode 100644 index 0000000..0e1c578 --- /dev/null +++ b/contrib/binutils/gas/config/tc-ia64.c @@ -0,0 +1,10143 @@ +/* tc-ia64.c -- Assembler for the HP/Intel IA-64 architecture. + Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + This file is part of GAS, the GNU Assembler. + + GAS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GAS is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GAS; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + TODO: + + - optional operands + - directives: + .alias + .eb + .estate + .lb + .popsection + .previous + .psr + .pushsection + - labels are wrong if automatic alignment is introduced + (e.g., checkout the second real10 definition in test-data.s) + - DV-related stuff: + <reg>.safe_across_calls and any other DV-related directives I don't + have documentation for. + verify mod-sched-brs reads/writes are checked/marked (and other + notes) + + */ + +#include "as.h" +#include "dwarf2dbg.h" +#include "subsegs.h" + +#include "opcode/ia64.h" + +#include "elf/ia64.h" + +#define NELEMS(a) ((int) (sizeof (a)/sizeof ((a)[0]))) +#define MIN(a,b) ((a) < (b) ? (a) : (b)) + +#define NUM_SLOTS 4 +#define PREV_SLOT md.slot[(md.curr_slot + NUM_SLOTS - 1) % NUM_SLOTS] +#define CURR_SLOT md.slot[md.curr_slot] + +#define O_pseudo_fixup (O_max + 1) + +enum special_section + { + SPECIAL_SECTION_BSS = 0, + SPECIAL_SECTION_SBSS, + SPECIAL_SECTION_SDATA, + SPECIAL_SECTION_RODATA, + SPECIAL_SECTION_COMMENT, + SPECIAL_SECTION_UNWIND, + SPECIAL_SECTION_UNWIND_INFO + }; + +enum reloc_func + { + FUNC_FPTR_RELATIVE, + FUNC_GP_RELATIVE, + FUNC_LT_RELATIVE, + FUNC_PC_RELATIVE, + FUNC_PLT_RELATIVE, + FUNC_SEC_RELATIVE, + FUNC_SEG_RELATIVE, + FUNC_LTV_RELATIVE, + FUNC_LT_FPTR_RELATIVE, + }; + +enum reg_symbol + { + REG_GR = 0, + REG_FR = (REG_GR + 128), + REG_AR = (REG_FR + 128), + REG_CR = (REG_AR + 128), + REG_P = (REG_CR + 128), + REG_BR = (REG_P + 64), + REG_IP = (REG_BR + 8), + REG_CFM, + REG_PR, + REG_PR_ROT, + REG_PSR, + REG_PSR_L, + REG_PSR_UM, + /* The following are pseudo-registers for use by gas only. */ + IND_CPUID, + IND_DBR, + IND_DTR, + IND_ITR, + IND_IBR, + IND_MEM, + IND_MSR, + IND_PKR, + IND_PMC, + IND_PMD, + IND_RR, + /* The following pseudo-registers are used for unwind directives only: */ + REG_PSP, + REG_PRIUNAT, + REG_NUM + }; + +enum dynreg_type + { + DYNREG_GR = 0, /* dynamic general purpose register */ + DYNREG_FR, /* dynamic floating point register */ + DYNREG_PR, /* dynamic predicate register */ + DYNREG_NUM_TYPES + }; + +enum operand_match_result + { + OPERAND_MATCH, + OPERAND_OUT_OF_RANGE, + OPERAND_MISMATCH + }; + +/* On the ia64, we can't know the address of a text label until the + instructions are packed into a bundle. To handle this, we keep + track of the list of labels that appear in front of each + instruction. */ +struct label_fix +{ + struct label_fix *next; + struct symbol *sym; +}; + +extern int target_big_endian; + +/* Characters which always start a comment. */ +const char comment_chars[] = ""; + +/* Characters which start a comment at the beginning of a line. */ +const char line_comment_chars[] = "#"; + +/* Characters which may be used to separate multiple commands on a + single line. */ +const char line_separator_chars[] = ";"; + +/* Characters which are used to indicate an exponent in a floating + point number. */ +const char EXP_CHARS[] = "eE"; + +/* Characters which mean that a number is a floating point constant, + as in 0d1.0. */ +const char FLT_CHARS[] = "rRsSfFdDxXpP"; + +/* ia64-specific option processing: */ + +const char *md_shortopts = "m:N:x::"; + +struct option md_longopts[] = + { +#define OPTION_MCONSTANT_GP (OPTION_MD_BASE + 1) + {"mconstant-gp", no_argument, NULL, OPTION_MCONSTANT_GP}, +#define OPTION_MAUTO_PIC (OPTION_MD_BASE + 2) + {"mauto-pic", no_argument, NULL, OPTION_MAUTO_PIC} + }; + +size_t md_longopts_size = sizeof (md_longopts); + +static struct + { + struct hash_control *pseudo_hash; /* pseudo opcode hash table */ + struct hash_control *reg_hash; /* register name hash table */ + struct hash_control *dynreg_hash; /* dynamic register hash table */ + struct hash_control *const_hash; /* constant hash table */ + struct hash_control *entry_hash; /* code entry hint hash table */ + + symbolS *regsym[REG_NUM]; + + /* If X_op is != O_absent, the registername for the instruction's + qualifying predicate. If NULL, p0 is assumed for instructions + that are predicatable. */ + expressionS qp; + + unsigned int + manual_bundling : 1, + debug_dv: 1, + detect_dv: 1, + explicit_mode : 1, /* which mode we're in */ + default_explicit_mode : 1, /* which mode is the default */ + mode_explicitly_set : 1, /* was the current mode explicitly set? */ + auto_align : 1, + keep_pending_output : 1; + + /* Each bundle consists of up to three instructions. We keep + track of four most recent instructions so we can correctly set + the end_of_insn_group for the last instruction in a bundle. */ + int curr_slot; + int num_slots_in_use; + struct slot + { + unsigned int + end_of_insn_group : 1, + manual_bundling_on : 1, + manual_bundling_off : 1; + signed char user_template; /* user-selected template, if any */ + unsigned char qp_regno; /* qualifying predicate */ + /* This duplicates a good fraction of "struct fix" but we + can't use a "struct fix" instead since we can't call + fix_new_exp() until we know the address of the instruction. */ + int num_fixups; + struct insn_fix + { + bfd_reloc_code_real_type code; + enum ia64_opnd opnd; /* type of operand in need of fix */ + unsigned int is_pcrel : 1; /* is operand pc-relative? */ + expressionS expr; /* the value to be inserted */ + } + fixup[2]; /* at most two fixups per insn */ + struct ia64_opcode *idesc; + struct label_fix *label_fixups; + struct label_fix *tag_fixups; + struct unw_rec_list *unwind_record; /* Unwind directive. */ + expressionS opnd[6]; + char *src_file; + unsigned int src_line; + struct dwarf2_line_info debug_line; + } + slot[NUM_SLOTS]; + + segT last_text_seg; + + struct dynreg + { + struct dynreg *next; /* next dynamic register */ + const char *name; + unsigned short base; /* the base register number */ + unsigned short num_regs; /* # of registers in this set */ + } + *dynreg[DYNREG_NUM_TYPES], in, loc, out, rot; + + flagword flags; /* ELF-header flags */ + + struct mem_offset { + unsigned hint:1; /* is this hint currently valid? */ + bfd_vma offset; /* mem.offset offset */ + bfd_vma base; /* mem.offset base */ + } mem_offset; + + int path; /* number of alt. entry points seen */ + const char **entry_labels; /* labels of all alternate paths in + the current DV-checking block. */ + int maxpaths; /* size currently allocated for + entry_labels */ + /* Support for hardware errata workarounds. */ + + /* Record data about the last three insn groups. */ + struct group + { + /* B-step workaround. + For each predicate register, this is set if the corresponding insn + group conditionally sets this register with one of the affected + instructions. */ + int p_reg_set[64]; + /* B-step workaround. + For each general register, this is set if the corresponding insn + a) is conditional one one of the predicate registers for which + P_REG_SET is 1 in the corresponding entry of the previous group, + b) sets this general register with one of the affected + instructions. */ + int g_reg_set_conditionally[128]; + } last_groups[3]; + int group_idx; + } +md; + +/* application registers: */ + +#define AR_K0 0 +#define AR_K7 7 +#define AR_RSC 16 +#define AR_BSP 17 +#define AR_BSPSTORE 18 +#define AR_RNAT 19 +#define AR_UNAT 36 +#define AR_FPSR 40 +#define AR_ITC 44 +#define AR_PFS 64 +#define AR_LC 65 + +static const struct + { + const char *name; + int regnum; + } +ar[] = + { + {"ar.k0", 0}, {"ar.k1", 1}, {"ar.k2", 2}, {"ar.k3", 3}, + {"ar.k4", 4}, {"ar.k5", 5}, {"ar.k6", 6}, {"ar.k7", 7}, + {"ar.rsc", 16}, {"ar.bsp", 17}, + {"ar.bspstore", 18}, {"ar.rnat", 19}, + {"ar.fcr", 21}, {"ar.eflag", 24}, + {"ar.csd", 25}, {"ar.ssd", 26}, + {"ar.cflg", 27}, {"ar.fsr", 28}, + {"ar.fir", 29}, {"ar.fdr", 30}, + {"ar.ccv", 32}, {"ar.unat", 36}, + {"ar.fpsr", 40}, {"ar.itc", 44}, + {"ar.pfs", 64}, {"ar.lc", 65}, + {"ar.ec", 66}, + }; + +#define CR_IPSR 16 +#define CR_ISR 17 +#define CR_IIP 19 +#define CR_IFA 20 +#define CR_ITIR 21 +#define CR_IIPA 22 +#define CR_IFS 23 +#define CR_IIM 24 +#define CR_IHA 25 +#define CR_IVR 65 +#define CR_TPR 66 +#define CR_EOI 67 +#define CR_IRR0 68 +#define CR_IRR3 71 +#define CR_LRR0 80 +#define CR_LRR1 81 + +/* control registers: */ +static const struct + { + const char *name; + int regnum; + } +cr[] = + { + {"cr.dcr", 0}, + {"cr.itm", 1}, + {"cr.iva", 2}, + {"cr.pta", 8}, + {"cr.gpta", 9}, + {"cr.ipsr", 16}, + {"cr.isr", 17}, + {"cr.iip", 19}, + {"cr.ifa", 20}, + {"cr.itir", 21}, + {"cr.iipa", 22}, + {"cr.ifs", 23}, + {"cr.iim", 24}, + {"cr.iha", 25}, + {"cr.lid", 64}, + {"cr.ivr", 65}, + {"cr.tpr", 66}, + {"cr.eoi", 67}, + {"cr.irr0", 68}, + {"cr.irr1", 69}, + {"cr.irr2", 70}, + {"cr.irr3", 71}, + {"cr.itv", 72}, + {"cr.pmv", 73}, + {"cr.cmcv", 74}, + {"cr.lrr0", 80}, + {"cr.lrr1", 81} + }; + +#define PSR_MFL 4 +#define PSR_IC 13 +#define PSR_DFL 18 +#define PSR_CPL 32 + +static const struct const_desc + { + const char *name; + valueT value; + } +const_bits[] = + { + /* PSR constant masks: */ + + /* 0: reserved */ + {"psr.be", ((valueT) 1) << 1}, + {"psr.up", ((valueT) 1) << 2}, + {"psr.ac", ((valueT) 1) << 3}, + {"psr.mfl", ((valueT) 1) << 4}, + {"psr.mfh", ((valueT) 1) << 5}, + /* 6-12: reserved */ + {"psr.ic", ((valueT) 1) << 13}, + {"psr.i", ((valueT) 1) << 14}, + {"psr.pk", ((valueT) 1) << 15}, + /* 16: reserved */ + {"psr.dt", ((valueT) 1) << 17}, + {"psr.dfl", ((valueT) 1) << 18}, + {"psr.dfh", ((valueT) 1) << 19}, + {"psr.sp", ((valueT) 1) << 20}, + {"psr.pp", ((valueT) 1) << 21}, + {"psr.di", ((valueT) 1) << 22}, + {"psr.si", ((valueT) 1) << 23}, + {"psr.db", ((valueT) 1) << 24}, + {"psr.lp", ((valueT) 1) << 25}, + {"psr.tb", ((valueT) 1) << 26}, + {"psr.rt", ((valueT) 1) << 27}, + /* 28-31: reserved */ + /* 32-33: cpl (current privilege level) */ + {"psr.is", ((valueT) 1) << 34}, + {"psr.mc", ((valueT) 1) << 35}, + {"psr.it", ((valueT) 1) << 36}, + {"psr.id", ((valueT) 1) << 37}, + {"psr.da", ((valueT) 1) << 38}, + {"psr.dd", ((valueT) 1) << 39}, + {"psr.ss", ((valueT) 1) << 40}, + /* 41-42: ri (restart instruction) */ + {"psr.ed", ((valueT) 1) << 43}, + {"psr.bn", ((valueT) 1) << 44}, + }; + +/* indirect register-sets/memory: */ + +static const struct + { + const char *name; + int regnum; + } +indirect_reg[] = + { + { "CPUID", IND_CPUID }, + { "cpuid", IND_CPUID }, + { "dbr", IND_DBR }, + { "dtr", IND_DTR }, + { "itr", IND_ITR }, + { "ibr", IND_IBR }, + { "msr", IND_MSR }, + { "pkr", IND_PKR }, + { "pmc", IND_PMC }, + { "pmd", IND_PMD }, + { "rr", IND_RR }, + }; + +/* Pseudo functions used to indicate relocation types (these functions + start with an at sign (@). */ +static struct + { + const char *name; + enum pseudo_type + { + PSEUDO_FUNC_NONE, + PSEUDO_FUNC_RELOC, + PSEUDO_FUNC_CONST, + PSEUDO_FUNC_REG, + PSEUDO_FUNC_FLOAT + } + type; + union + { + unsigned long ival; + symbolS *sym; + } + u; + } +pseudo_func[] = + { + /* reloc pseudo functions (these must come first!): */ + { "fptr", PSEUDO_FUNC_RELOC, { 0 } }, + { "gprel", PSEUDO_FUNC_RELOC, { 0 } }, + { "ltoff", PSEUDO_FUNC_RELOC, { 0 } }, + { "pcrel", PSEUDO_FUNC_RELOC, { 0 } }, + { "pltoff", PSEUDO_FUNC_RELOC, { 0 } }, + { "secrel", PSEUDO_FUNC_RELOC, { 0 } }, + { "segrel", PSEUDO_FUNC_RELOC, { 0 } }, + { "ltv", PSEUDO_FUNC_RELOC, { 0 } }, + { "", 0, { 0 } }, /* placeholder for FUNC_LT_FPTR_RELATIVE */ + + /* mbtype4 constants: */ + { "alt", PSEUDO_FUNC_CONST, { 0xa } }, + { "brcst", PSEUDO_FUNC_CONST, { 0x0 } }, + { "mix", PSEUDO_FUNC_CONST, { 0x8 } }, + { "rev", PSEUDO_FUNC_CONST, { 0xb } }, + { "shuf", PSEUDO_FUNC_CONST, { 0x9 } }, + + /* fclass constants: */ + { "nat", PSEUDO_FUNC_CONST, { 0x100 } }, + { "qnan", PSEUDO_FUNC_CONST, { 0x080 } }, + { "snan", PSEUDO_FUNC_CONST, { 0x040 } }, + { "pos", PSEUDO_FUNC_CONST, { 0x001 } }, + { "neg", PSEUDO_FUNC_CONST, { 0x002 } }, + { "zero", PSEUDO_FUNC_CONST, { 0x004 } }, + { "unorm", PSEUDO_FUNC_CONST, { 0x008 } }, + { "norm", PSEUDO_FUNC_CONST, { 0x010 } }, + { "inf", PSEUDO_FUNC_CONST, { 0x020 } }, + + { "natval", PSEUDO_FUNC_CONST, { 0x100 } }, /* old usage */ + + /* unwind-related constants: */ + { "svr4", PSEUDO_FUNC_CONST, { 0 } }, + { "hpux", PSEUDO_FUNC_CONST, { 1 } }, + { "nt", PSEUDO_FUNC_CONST, { 2 } }, + + /* unwind-related registers: */ + { "priunat",PSEUDO_FUNC_REG, { REG_PRIUNAT } } + }; + +/* 41-bit nop opcodes (one per unit): */ +static const bfd_vma nop[IA64_NUM_UNITS] = + { + 0x0000000000LL, /* NIL => break 0 */ + 0x0008000000LL, /* I-unit nop */ + 0x0008000000LL, /* M-unit nop */ + 0x4000000000LL, /* B-unit nop */ + 0x0008000000LL, /* F-unit nop */ + 0x0008000000LL, /* L-"unit" nop */ + 0x0008000000LL, /* X-unit nop */ + }; + +/* Can't be `const' as it's passed to input routines (which have the + habit of setting temporary sentinels. */ +static char special_section_name[][20] = + { + {".bss"}, {".sbss"}, {".sdata"}, {".rodata"}, {".comment"}, + {".IA_64.unwind"}, {".IA_64.unwind_info"} + }; + +/* The best template for a particular sequence of up to three + instructions: */ +#define N IA64_NUM_TYPES +static unsigned char best_template[N][N][N]; +#undef N + +/* Resource dependencies currently in effect */ +static struct rsrc { + int depind; /* dependency index */ + const struct ia64_dependency *dependency; /* actual dependency */ + unsigned specific:1, /* is this a specific bit/regno? */ + link_to_qp_branch:1; /* will a branch on the same QP clear it?*/ + int index; /* specific regno/bit within dependency */ + int note; /* optional qualifying note (0 if none) */ +#define STATE_NONE 0 +#define STATE_STOP 1 +#define STATE_SRLZ 2 + int insn_srlz; /* current insn serialization state */ + int data_srlz; /* current data serialization state */ + int qp_regno; /* qualifying predicate for this usage */ + char *file; /* what file marked this dependency */ + unsigned int line; /* what line marked this dependency */ + struct mem_offset mem_offset; /* optional memory offset hint */ + enum { CMP_NONE, CMP_OR, CMP_AND } cmp_type; /* OR or AND compare? */ + int path; /* corresponding code entry index */ +} *regdeps = NULL; +static int regdepslen = 0; +static int regdepstotlen = 0; +static const char *dv_mode[] = { "RAW", "WAW", "WAR" }; +static const char *dv_sem[] = { "none", "implied", "impliedf", + "data", "instr", "specific", "stop", "other" }; +static const char *dv_cmp_type[] = { "none", "OR", "AND" }; + +/* Current state of PR mutexation */ +static struct qpmutex { + valueT prmask; + int path; +} *qp_mutexes = NULL; /* QP mutex bitmasks */ +static int qp_mutexeslen = 0; +static int qp_mutexestotlen = 0; +static valueT qp_safe_across_calls = 0; + +/* Current state of PR implications */ +static struct qp_imply { + unsigned p1:6; + unsigned p2:6; + unsigned p2_branched:1; + int path; +} *qp_implies = NULL; +static int qp_implieslen = 0; +static int qp_impliestotlen = 0; + +/* Keep track of static GR values so that indirect register usage can + sometimes be tracked. */ +static struct gr { + unsigned known:1; + int path; + valueT value; +} gr_values[128] = {{ 1, 0, 0 }}; + +/* These are the routines required to output the various types of + unwind records. */ + +/* A slot_number is a frag address plus the slot index (0-2). We use the + frag address here so that if there is a section switch in the middle of + a function, then instructions emitted to a different section are not + counted. Since there may be more than one frag for a function, this + means we also need to keep track of which frag this address belongs to + so we can compute inter-frag distances. This also nicely solves the + problem with nops emitted for align directives, which can't easily be + counted, but can easily be derived from frag sizes. */ + +typedef struct unw_rec_list { + unwind_record r; + unsigned long slot_number; + fragS *slot_frag; + struct unw_rec_list *next; +} unw_rec_list; + +#define SLOT_NUM_NOT_SET (unsigned)-1 + +static struct +{ + unsigned long next_slot_number; + fragS *next_slot_frag; + + /* Maintain a list of unwind entries for the current function. */ + unw_rec_list *list; + unw_rec_list *tail; + + /* Any unwind entires that should be attached to the current slot + that an insn is being constructed for. */ + unw_rec_list *current_entry; + + /* These are used to create the unwind table entry for this function. */ + symbolS *proc_start; + symbolS *proc_end; + symbolS *info; /* pointer to unwind info */ + symbolS *personality_routine; + segT saved_text_seg; + subsegT saved_text_subseg; + unsigned int force_unwind_entry : 1; /* force generation of unwind entry? */ + + /* TRUE if processing unwind directives in a prologue region. */ + int prologue; + int prologue_mask; + unsigned int prologue_count; /* number of .prologues seen so far */ +} unwind; + +typedef void (*vbyte_func) PARAMS ((int, char *, char *)); + +/* Forward delarations: */ +static int ar_is_in_integer_unit PARAMS ((int regnum)); +static void set_section PARAMS ((char *name)); +static unsigned int set_regstack PARAMS ((unsigned int, unsigned int, + unsigned int, unsigned int)); +static void dot_radix PARAMS ((int)); +static void dot_special_section PARAMS ((int)); +static void dot_proc PARAMS ((int)); +static void dot_fframe PARAMS ((int)); +static void dot_vframe PARAMS ((int)); +static void dot_vframesp PARAMS ((int)); +static void dot_vframepsp PARAMS ((int)); +static void dot_save PARAMS ((int)); +static void dot_restore PARAMS ((int)); +static void dot_restorereg PARAMS ((int)); +static void dot_restorereg_p PARAMS ((int)); +static void dot_handlerdata PARAMS ((int)); +static void dot_unwentry PARAMS ((int)); +static void dot_altrp PARAMS ((int)); +static void dot_savemem PARAMS ((int)); +static void dot_saveg PARAMS ((int)); +static void dot_savef PARAMS ((int)); +static void dot_saveb PARAMS ((int)); +static void dot_savegf PARAMS ((int)); +static void dot_spill PARAMS ((int)); +static void dot_spillreg PARAMS ((int)); +static void dot_spillmem PARAMS ((int)); +static void dot_spillreg_p PARAMS ((int)); +static void dot_spillmem_p PARAMS ((int)); +static void dot_label_state PARAMS ((int)); +static void dot_copy_state PARAMS ((int)); +static void dot_unwabi PARAMS ((int)); +static void dot_personality PARAMS ((int)); +static void dot_body PARAMS ((int)); +static void dot_prologue PARAMS ((int)); +static void dot_endp PARAMS ((int)); +static void dot_template PARAMS ((int)); +static void dot_regstk PARAMS ((int)); +static void dot_rot PARAMS ((int)); +static void dot_byteorder PARAMS ((int)); +static void dot_psr PARAMS ((int)); +static void dot_alias PARAMS ((int)); +static void dot_ln PARAMS ((int)); +static char *parse_section_name PARAMS ((void)); +static void dot_xdata PARAMS ((int)); +static void stmt_float_cons PARAMS ((int)); +static void stmt_cons_ua PARAMS ((int)); +static void dot_xfloat_cons PARAMS ((int)); +static void dot_xstringer PARAMS ((int)); +static void dot_xdata_ua PARAMS ((int)); +static void dot_xfloat_cons_ua PARAMS ((int)); +static void print_prmask PARAMS ((valueT mask)); +static void dot_pred_rel PARAMS ((int)); +static void dot_reg_val PARAMS ((int)); +static void dot_dv_mode PARAMS ((int)); +static void dot_entry PARAMS ((int)); +static void dot_mem_offset PARAMS ((int)); +static void add_unwind_entry PARAMS((unw_rec_list *ptr)); +static symbolS *declare_register PARAMS ((const char *name, int regnum)); +static void declare_register_set PARAMS ((const char *, int, int)); +static unsigned int operand_width PARAMS ((enum ia64_opnd)); +static enum operand_match_result operand_match PARAMS ((const struct ia64_opcode *idesc, + int index, + expressionS *e)); +static int parse_operand PARAMS ((expressionS *e)); +static struct ia64_opcode * parse_operands PARAMS ((struct ia64_opcode *)); +static void build_insn PARAMS ((struct slot *, bfd_vma *)); +static void emit_one_bundle PARAMS ((void)); +static void fix_insn PARAMS ((fixS *, const struct ia64_operand *, valueT)); +static bfd_reloc_code_real_type ia64_gen_real_reloc_type PARAMS ((struct symbol *sym, + bfd_reloc_code_real_type r_type)); +static void insn_group_break PARAMS ((int, int, int)); +static void mark_resource PARAMS ((struct ia64_opcode *, const struct ia64_dependency *, + struct rsrc *, int depind, int path)); +static void add_qp_mutex PARAMS((valueT mask)); +static void add_qp_imply PARAMS((int p1, int p2)); +static void clear_qp_branch_flag PARAMS((valueT mask)); +static void clear_qp_mutex PARAMS((valueT mask)); +static void clear_qp_implies PARAMS((valueT p1_mask, valueT p2_mask)); +static void clear_register_values PARAMS ((void)); +static void print_dependency PARAMS ((const char *action, int depind)); +static void instruction_serialization PARAMS ((void)); +static void data_serialization PARAMS ((void)); +static void remove_marked_resource PARAMS ((struct rsrc *)); +static int is_conditional_branch PARAMS ((struct ia64_opcode *)); +static int is_taken_branch PARAMS ((struct ia64_opcode *)); +static int is_interruption_or_rfi PARAMS ((struct ia64_opcode *)); +static int depends_on PARAMS ((int, struct ia64_opcode *)); +static int specify_resource PARAMS ((const struct ia64_dependency *, + struct ia64_opcode *, int, struct rsrc [], int, int)); +static int check_dv PARAMS((struct ia64_opcode *idesc)); +static void check_dependencies PARAMS((struct ia64_opcode *)); +static void mark_resources PARAMS((struct ia64_opcode *)); +static void update_dependencies PARAMS((struct ia64_opcode *)); +static void note_register_values PARAMS((struct ia64_opcode *)); +static int qp_mutex PARAMS ((int, int, int)); +static int resources_match PARAMS ((struct rsrc *, struct ia64_opcode *, int, int, int)); +static void output_vbyte_mem PARAMS ((int, char *, char *)); +static void count_output PARAMS ((int, char *, char *)); +static void output_R1_format PARAMS ((vbyte_func, unw_record_type, int)); +static void output_R2_format PARAMS ((vbyte_func, int, int, unsigned long)); +static void output_R3_format PARAMS ((vbyte_func, unw_record_type, unsigned long)); +static void output_P1_format PARAMS ((vbyte_func, int)); +static void output_P2_format PARAMS ((vbyte_func, int, int)); +static void output_P3_format PARAMS ((vbyte_func, unw_record_type, int)); +static void output_P4_format PARAMS ((vbyte_func, unsigned char *, unsigned long)); +static void output_P5_format PARAMS ((vbyte_func, int, unsigned long)); +static void output_P6_format PARAMS ((vbyte_func, unw_record_type, int)); +static void output_P7_format PARAMS ((vbyte_func, unw_record_type, unsigned long, unsigned long)); +static void output_P8_format PARAMS ((vbyte_func, unw_record_type, unsigned long)); +static void output_P9_format PARAMS ((vbyte_func, int, int)); +static void output_P10_format PARAMS ((vbyte_func, int, int)); +static void output_B1_format PARAMS ((vbyte_func, unw_record_type, unsigned long)); +static void output_B2_format PARAMS ((vbyte_func, unsigned long, unsigned long)); +static void output_B3_format PARAMS ((vbyte_func, unsigned long, unsigned long)); +static void output_B4_format PARAMS ((vbyte_func, unw_record_type, unsigned long)); +static char format_ab_reg PARAMS ((int, int)); +static void output_X1_format PARAMS ((vbyte_func, unw_record_type, int, int, unsigned long, + unsigned long)); +static void output_X2_format PARAMS ((vbyte_func, int, int, int, int, int, unsigned long)); +static void output_X3_format PARAMS ((vbyte_func, unw_record_type, int, int, int, unsigned long, + unsigned long)); +static void output_X4_format PARAMS ((vbyte_func, int, int, int, int, int, int, unsigned long)); +static void free_list_records PARAMS ((unw_rec_list *)); +static unw_rec_list *output_prologue PARAMS ((void)); +static unw_rec_list *output_prologue_gr PARAMS ((unsigned int, unsigned int)); +static unw_rec_list *output_body PARAMS ((void)); +static unw_rec_list *output_mem_stack_f PARAMS ((unsigned int)); +static unw_rec_list *output_mem_stack_v PARAMS ((void)); +static unw_rec_list *output_psp_gr PARAMS ((unsigned int)); +static unw_rec_list *output_psp_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_rp_when PARAMS ((void)); +static unw_rec_list *output_rp_gr PARAMS ((unsigned int)); +static unw_rec_list *output_rp_br PARAMS ((unsigned int)); +static unw_rec_list *output_rp_psprel PARAMS ((unsigned int)); +static unw_rec_list *output_rp_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_pfs_when PARAMS ((void)); +static unw_rec_list *output_pfs_gr PARAMS ((unsigned int)); +static unw_rec_list *output_pfs_psprel PARAMS ((unsigned int)); +static unw_rec_list *output_pfs_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_preds_when PARAMS ((void)); +static unw_rec_list *output_preds_gr PARAMS ((unsigned int)); +static unw_rec_list *output_preds_psprel PARAMS ((unsigned int)); +static unw_rec_list *output_preds_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_fr_mem PARAMS ((unsigned int)); +static unw_rec_list *output_frgr_mem PARAMS ((unsigned int, unsigned int)); +static unw_rec_list *output_gr_gr PARAMS ((unsigned int, unsigned int)); +static unw_rec_list *output_gr_mem PARAMS ((unsigned int)); +static unw_rec_list *output_br_mem PARAMS ((unsigned int)); +static unw_rec_list *output_br_gr PARAMS ((unsigned int, unsigned int)); +static unw_rec_list *output_spill_base PARAMS ((unsigned int)); +static unw_rec_list *output_unat_when PARAMS ((void)); +static unw_rec_list *output_unat_gr PARAMS ((unsigned int)); +static unw_rec_list *output_unat_psprel PARAMS ((unsigned int)); +static unw_rec_list *output_unat_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_lc_when PARAMS ((void)); +static unw_rec_list *output_lc_gr PARAMS ((unsigned int)); +static unw_rec_list *output_lc_psprel PARAMS ((unsigned int)); +static unw_rec_list *output_lc_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_fpsr_when PARAMS ((void)); +static unw_rec_list *output_fpsr_gr PARAMS ((unsigned int)); +static unw_rec_list *output_fpsr_psprel PARAMS ((unsigned int)); +static unw_rec_list *output_fpsr_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_priunat_when_gr PARAMS ((void)); +static unw_rec_list *output_priunat_when_mem PARAMS ((void)); +static unw_rec_list *output_priunat_gr PARAMS ((unsigned int)); +static unw_rec_list *output_priunat_psprel PARAMS ((unsigned int)); +static unw_rec_list *output_priunat_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_bsp_when PARAMS ((void)); +static unw_rec_list *output_bsp_gr PARAMS ((unsigned int)); +static unw_rec_list *output_bsp_psprel PARAMS ((unsigned int)); +static unw_rec_list *output_bsp_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_bspstore_when PARAMS ((void)); +static unw_rec_list *output_bspstore_gr PARAMS ((unsigned int)); +static unw_rec_list *output_bspstore_psprel PARAMS ((unsigned int)); +static unw_rec_list *output_bspstore_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_rnat_when PARAMS ((void)); +static unw_rec_list *output_rnat_gr PARAMS ((unsigned int)); +static unw_rec_list *output_rnat_psprel PARAMS ((unsigned int)); +static unw_rec_list *output_rnat_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_unwabi PARAMS ((unsigned long, unsigned long)); +static unw_rec_list *output_epilogue PARAMS ((unsigned long)); +static unw_rec_list *output_label_state PARAMS ((unsigned long)); +static unw_rec_list *output_copy_state PARAMS ((unsigned long)); +static unw_rec_list *output_spill_psprel PARAMS ((unsigned int, unsigned int, unsigned int)); +static unw_rec_list *output_spill_sprel PARAMS ((unsigned int, unsigned int, unsigned int)); +static unw_rec_list *output_spill_psprel_p PARAMS ((unsigned int, unsigned int, unsigned int, + unsigned int)); +static unw_rec_list *output_spill_sprel_p PARAMS ((unsigned int, unsigned int, unsigned int, + unsigned int)); +static unw_rec_list *output_spill_reg PARAMS ((unsigned int, unsigned int, unsigned int, + unsigned int)); +static unw_rec_list *output_spill_reg_p PARAMS ((unsigned int, unsigned int, unsigned int, + unsigned int, unsigned int)); +static void process_one_record PARAMS ((unw_rec_list *, vbyte_func)); +static void process_unw_records PARAMS ((unw_rec_list *, vbyte_func)); +static int calc_record_size PARAMS ((unw_rec_list *)); +static void set_imask PARAMS ((unw_rec_list *, unsigned long, unsigned long, unsigned int)); +static int count_bits PARAMS ((unsigned long)); +static unsigned long slot_index PARAMS ((unsigned long, fragS *, + unsigned long, fragS *)); +static unw_rec_list *optimize_unw_records PARAMS ((unw_rec_list *)); +static void fixup_unw_records PARAMS ((unw_rec_list *)); +static int output_unw_records PARAMS ((unw_rec_list *, void **)); +static int convert_expr_to_ab_reg PARAMS ((expressionS *, unsigned int *, unsigned int *)); +static int convert_expr_to_xy_reg PARAMS ((expressionS *, unsigned int *, unsigned int *)); +static int generate_unwind_image PARAMS ((const char *)); + +/* Build the unwind section name by appending the (possibly stripped) + text section NAME to the unwind PREFIX. The resulting string + pointer is assigned to RESULT. The string is allocated on the + stack, so this must be a macro... */ +#define make_unw_section_name(special, text_name, result) \ + { \ + char *_prefix = special_section_name[special]; \ + size_t _prefix_len = strlen (_prefix), _text_len = strlen (text_name); \ + char *_result = alloca (_prefix_len + _text_len + 1); \ + memcpy(_result, _prefix, _prefix_len); \ + memcpy(_result + _prefix_len, text_name, _text_len); \ + _result[_prefix_len + _text_len] = '\0'; \ + result = _result; \ + } \ +while (0) + +/* Determine if application register REGNUM resides in the integer + unit (as opposed to the memory unit). */ +static int +ar_is_in_integer_unit (reg) + int reg; +{ + reg -= REG_AR; + + return (reg == 64 /* pfs */ + || reg == 65 /* lc */ + || reg == 66 /* ec */ + /* ??? ias accepts and puts these in the integer unit. */ + || (reg >= 112 && reg <= 127)); +} + +/* Switch to section NAME and create section if necessary. It's + rather ugly that we have to manipulate input_line_pointer but I + don't see any other way to accomplish the same thing without + changing obj-elf.c (which may be the Right Thing, in the end). */ +static void +set_section (name) + char *name; +{ + char *saved_input_line_pointer; + + saved_input_line_pointer = input_line_pointer; + input_line_pointer = name; + obj_elf_section (0); + input_line_pointer = saved_input_line_pointer; +} + +/* Map SHF_IA_64_SHORT to SEC_SMALL_DATA. */ + +flagword +ia64_elf_section_flags (flags, attr, type) + flagword flags; + int attr, type ATTRIBUTE_UNUSED; +{ + if (attr & SHF_IA_64_SHORT) + flags |= SEC_SMALL_DATA; + return flags; +} + +int +ia64_elf_section_type (str, len) + const char *str; + size_t len; +{ + len = sizeof (ELF_STRING_ia64_unwind_info) - 1; + if (strncmp (str, ELF_STRING_ia64_unwind_info, len) == 0) + return SHT_PROGBITS; + + len = sizeof (ELF_STRING_ia64_unwind) - 1; + if (strncmp (str, ELF_STRING_ia64_unwind, len) == 0) + return SHT_IA_64_UNWIND; + + return -1; +} + +static unsigned int +set_regstack (ins, locs, outs, rots) + unsigned int ins, locs, outs, rots; +{ + /* Size of frame. */ + unsigned int sof; + + sof = ins + locs + outs; + if (sof > 96) + { + as_bad ("Size of frame exceeds maximum of 96 registers"); + return 0; + } + if (rots > sof) + { + as_warn ("Size of rotating registers exceeds frame size"); + return 0; + } + md.in.base = REG_GR + 32; + md.loc.base = md.in.base + ins; + md.out.base = md.loc.base + locs; + + md.in.num_regs = ins; + md.loc.num_regs = locs; + md.out.num_regs = outs; + md.rot.num_regs = rots; + return sof; +} + +void +ia64_flush_insns () +{ + struct label_fix *lfix; + segT saved_seg; + subsegT saved_subseg; + unw_rec_list *ptr; + + if (!md.last_text_seg) + return; + + saved_seg = now_seg; + saved_subseg = now_subseg; + + subseg_set (md.last_text_seg, 0); + + while (md.num_slots_in_use > 0) + emit_one_bundle (); /* force out queued instructions */ + + /* In case there are labels following the last instruction, resolve + those now: */ + for (lfix = CURR_SLOT.label_fixups; lfix; lfix = lfix->next) + { + S_SET_VALUE (lfix->sym, frag_now_fix ()); + symbol_set_frag (lfix->sym, frag_now); + } + CURR_SLOT.label_fixups = 0; + for (lfix = CURR_SLOT.tag_fixups; lfix; lfix = lfix->next) + { + S_SET_VALUE (lfix->sym, frag_now_fix ()); + symbol_set_frag (lfix->sym, frag_now); + } + CURR_SLOT.tag_fixups = 0; + + /* In case there are unwind directives following the last instruction, + resolve those now. We only handle body and prologue directives here. + Give an error for others. */ + for (ptr = unwind.current_entry; ptr; ptr = ptr->next) + { + if (ptr->r.type == prologue || ptr->r.type == prologue_gr + || ptr->r.type == body) + { + ptr->slot_number = (unsigned long) frag_more (0); + ptr->slot_frag = frag_now; + } + else + as_bad (_("Unwind directive not followed by an instruction.")); + } + unwind.current_entry = NULL; + + subseg_set (saved_seg, saved_subseg); + + if (md.qp.X_op == O_register) + as_bad ("qualifying predicate not followed by instruction"); +} + +void +ia64_do_align (nbytes) + int nbytes; +{ + char *saved_input_line_pointer = input_line_pointer; + + input_line_pointer = ""; + s_align_bytes (nbytes); + input_line_pointer = saved_input_line_pointer; +} + +void +ia64_cons_align (nbytes) + int nbytes; +{ + if (md.auto_align) + { + char *saved_input_line_pointer = input_line_pointer; + input_line_pointer = ""; + s_align_bytes (nbytes); + input_line_pointer = saved_input_line_pointer; + } +} + +/* Output COUNT bytes to a memory location. */ +static unsigned char *vbyte_mem_ptr = NULL; + +void +output_vbyte_mem (count, ptr, comment) + int count; + char *ptr; + char *comment ATTRIBUTE_UNUSED; +{ + int x; + if (vbyte_mem_ptr == NULL) + abort (); + + if (count == 0) + return; + for (x = 0; x < count; x++) + *(vbyte_mem_ptr++) = ptr[x]; +} + +/* Count the number of bytes required for records. */ +static int vbyte_count = 0; +void +count_output (count, ptr, comment) + int count; + char *ptr ATTRIBUTE_UNUSED; + char *comment ATTRIBUTE_UNUSED; +{ + vbyte_count += count; +} + +static void +output_R1_format (f, rtype, rlen) + vbyte_func f; + unw_record_type rtype; + int rlen; +{ + int r = 0; + char byte; + if (rlen > 0x1f) + { + output_R3_format (f, rtype, rlen); + return; + } + + if (rtype == body) + r = 1; + else if (rtype != prologue) + as_bad ("record type is not valid"); + + byte = UNW_R1 | (r << 5) | (rlen & 0x1f); + (*f) (1, &byte, NULL); +} + +static void +output_R2_format (f, mask, grsave, rlen) + vbyte_func f; + int mask, grsave; + unsigned long rlen; +{ + char bytes[20]; + int count = 2; + mask = (mask & 0x0f); + grsave = (grsave & 0x7f); + + bytes[0] = (UNW_R2 | (mask >> 1)); + bytes[1] = (((mask & 0x01) << 7) | grsave); + count += output_leb128 (bytes + 2, rlen, 0); + (*f) (count, bytes, NULL); +} + +static void +output_R3_format (f, rtype, rlen) + vbyte_func f; + unw_record_type rtype; + unsigned long rlen; +{ + int r = 0, count; + char bytes[20]; + if (rlen <= 0x1f) + { + output_R1_format (f, rtype, rlen); + return; + } + + if (rtype == body) + r = 1; + else if (rtype != prologue) + as_bad ("record type is not valid"); + bytes[0] = (UNW_R3 | r); + count = output_leb128 (bytes + 1, rlen, 0); + (*f) (count + 1, bytes, NULL); +} + +static void +output_P1_format (f, brmask) + vbyte_func f; + int brmask; +{ + char byte; + byte = UNW_P1 | (brmask & 0x1f); + (*f) (1, &byte, NULL); +} + +static void +output_P2_format (f, brmask, gr) + vbyte_func f; + int brmask; + int gr; +{ + char bytes[2]; + brmask = (brmask & 0x1f); + bytes[0] = UNW_P2 | (brmask >> 1); + bytes[1] = (((brmask & 1) << 7) | gr); + (*f) (2, bytes, NULL); +} + +static void +output_P3_format (f, rtype, reg) + vbyte_func f; + unw_record_type rtype; + int reg; +{ + char bytes[2]; + int r = 0; + reg = (reg & 0x7f); + switch (rtype) + { + case psp_gr: + r = 0; + break; + case rp_gr: + r = 1; + break; + case pfs_gr: + r = 2; + break; + case preds_gr: + r = 3; + break; + case unat_gr: + r = 4; + break; + case lc_gr: + r = 5; + break; + case rp_br: + r = 6; + break; + case rnat_gr: + r = 7; + break; + case bsp_gr: + r = 8; + break; + case bspstore_gr: + r = 9; + break; + case fpsr_gr: + r = 10; + break; + case priunat_gr: + r = 11; + break; + default: + as_bad ("Invalid record type for P3 format."); + } + bytes[0] = (UNW_P3 | (r >> 1)); + bytes[1] = (((r & 1) << 7) | reg); + (*f) (2, bytes, NULL); +} + +static void +output_P4_format (f, imask, imask_size) + vbyte_func f; + unsigned char *imask; + unsigned long imask_size; +{ + imask[0] = UNW_P4; + (*f) (imask_size, imask, NULL); +} + +static void +output_P5_format (f, grmask, frmask) + vbyte_func f; + int grmask; + unsigned long frmask; +{ + char bytes[4]; + grmask = (grmask & 0x0f); + + bytes[0] = UNW_P5; + bytes[1] = ((grmask << 4) | ((frmask & 0x000f0000) >> 16)); + bytes[2] = ((frmask & 0x0000ff00) >> 8); + bytes[3] = (frmask & 0x000000ff); + (*f) (4, bytes, NULL); +} + +static void +output_P6_format (f, rtype, rmask) + vbyte_func f; + unw_record_type rtype; + int rmask; +{ + char byte; + int r = 0; + + if (rtype == gr_mem) + r = 1; + else if (rtype != fr_mem) + as_bad ("Invalid record type for format P6"); + byte = (UNW_P6 | (r << 4) | (rmask & 0x0f)); + (*f) (1, &byte, NULL); +} + +static void +output_P7_format (f, rtype, w1, w2) + vbyte_func f; + unw_record_type rtype; + unsigned long w1; + unsigned long w2; +{ + char bytes[20]; + int count = 1; + int r = 0; + count += output_leb128 (bytes + 1, w1, 0); + switch (rtype) + { + case mem_stack_f: + r = 0; + count += output_leb128 (bytes + count, w2 >> 4, 0); + break; + case mem_stack_v: + r = 1; + break; + case spill_base: + r = 2; + break; + case psp_sprel: + r = 3; + break; + case rp_when: + r = 4; + break; + case rp_psprel: + r = 5; + break; + case pfs_when: + r = 6; + break; + case pfs_psprel: + r = 7; + break; + case preds_when: + r = 8; + break; + case preds_psprel: + r = 9; + break; + case lc_when: + r = 10; + break; + case lc_psprel: + r = 11; + break; + case unat_when: + r = 12; + break; + case unat_psprel: + r = 13; + break; + case fpsr_when: + r = 14; + break; + case fpsr_psprel: + r = 15; + break; + default: + break; + } + bytes[0] = (UNW_P7 | r); + (*f) (count, bytes, NULL); +} + +static void +output_P8_format (f, rtype, t) + vbyte_func f; + unw_record_type rtype; + unsigned long t; +{ + char bytes[20]; + int r = 0; + int count = 2; + bytes[0] = UNW_P8; + switch (rtype) + { + case rp_sprel: + r = 1; + break; + case pfs_sprel: + r = 2; + break; + case preds_sprel: + r = 3; + break; + case lc_sprel: + r = 4; + break; + case unat_sprel: + r = 5; + break; + case fpsr_sprel: + r = 6; + break; + case bsp_when: + r = 7; + break; + case bsp_psprel: + r = 8; + break; + case bsp_sprel: + r = 9; + break; + case bspstore_when: + r = 10; + break; + case bspstore_psprel: + r = 11; + break; + case bspstore_sprel: + r = 12; + break; + case rnat_when: + r = 13; + break; + case rnat_psprel: + r = 14; + break; + case rnat_sprel: + r = 15; + break; + case priunat_when_gr: + r = 16; + break; + case priunat_psprel: + r = 17; + break; + case priunat_sprel: + r = 18; + break; + case priunat_when_mem: + r = 19; + break; + default: + break; + } + bytes[1] = r; + count += output_leb128 (bytes + 2, t, 0); + (*f) (count, bytes, NULL); +} + +static void +output_P9_format (f, grmask, gr) + vbyte_func f; + int grmask; + int gr; +{ + char bytes[3]; + bytes[0] = UNW_P9; + bytes[1] = (grmask & 0x0f); + bytes[2] = (gr & 0x7f); + (*f) (3, bytes, NULL); +} + +static void +output_P10_format (f, abi, context) + vbyte_func f; + int abi; + int context; +{ + char bytes[3]; + bytes[0] = UNW_P10; + bytes[1] = (abi & 0xff); + bytes[2] = (context & 0xff); + (*f) (3, bytes, NULL); +} + +static void +output_B1_format (f, rtype, label) + vbyte_func f; + unw_record_type rtype; + unsigned long label; +{ + char byte; + int r = 0; + if (label > 0x1f) + { + output_B4_format (f, rtype, label); + return; + } + if (rtype == copy_state) + r = 1; + else if (rtype != label_state) + as_bad ("Invalid record type for format B1"); + + byte = (UNW_B1 | (r << 5) | (label & 0x1f)); + (*f) (1, &byte, NULL); +} + +static void +output_B2_format (f, ecount, t) + vbyte_func f; + unsigned long ecount; + unsigned long t; +{ + char bytes[20]; + int count = 1; + if (ecount > 0x1f) + { + output_B3_format (f, ecount, t); + return; + } + bytes[0] = (UNW_B2 | (ecount & 0x1f)); + count += output_leb128 (bytes + 1, t, 0); + (*f) (count, bytes, NULL); +} + +static void +output_B3_format (f, ecount, t) + vbyte_func f; + unsigned long ecount; + unsigned long t; +{ + char bytes[20]; + int count = 1; + if (ecount <= 0x1f) + { + output_B2_format (f, ecount, t); + return; + } + bytes[0] = UNW_B3; + count += output_leb128 (bytes + 1, t, 0); + count += output_leb128 (bytes + count, ecount, 0); + (*f) (count, bytes, NULL); +} + +static void +output_B4_format (f, rtype, label) + vbyte_func f; + unw_record_type rtype; + unsigned long label; +{ + char bytes[20]; + int r = 0; + int count = 1; + if (label <= 0x1f) + { + output_B1_format (f, rtype, label); + return; + } + + if (rtype == copy_state) + r = 1; + else if (rtype != label_state) + as_bad ("Invalid record type for format B1"); + + bytes[0] = (UNW_B4 | (r << 3)); + count += output_leb128 (bytes + 1, label, 0); + (*f) (count, bytes, NULL); +} + +static char +format_ab_reg (ab, reg) + int ab; + int reg; +{ + int ret; + ab = (ab & 3); + reg = (reg & 0x1f); + ret = (ab << 5) | reg; + return ret; +} + +static void +output_X1_format (f, rtype, ab, reg, t, w1) + vbyte_func f; + unw_record_type rtype; + int ab, reg; + unsigned long t; + unsigned long w1; +{ + char bytes[20]; + int r = 0; + int count = 2; + bytes[0] = UNW_X1; + + if (rtype == spill_sprel) + r = 1; + else if (rtype != spill_psprel) + as_bad ("Invalid record type for format X1"); + bytes[1] = ((r << 7) | format_ab_reg (ab, reg)); + count += output_leb128 (bytes + 2, t, 0); + count += output_leb128 (bytes + count, w1, 0); + (*f) (count, bytes, NULL); +} + +static void +output_X2_format (f, ab, reg, x, y, treg, t) + vbyte_func f; + int ab, reg; + int x, y, treg; + unsigned long t; +{ + char bytes[20]; + int count = 3; + bytes[0] = UNW_X2; + bytes[1] = (((x & 1) << 7) | format_ab_reg (ab, reg)); + bytes[2] = (((y & 1) << 7) | (treg & 0x7f)); + count += output_leb128 (bytes + 3, t, 0); + (*f) (count, bytes, NULL); +} + +static void +output_X3_format (f, rtype, qp, ab, reg, t, w1) + vbyte_func f; + unw_record_type rtype; + int qp; + int ab, reg; + unsigned long t; + unsigned long w1; +{ + char bytes[20]; + int r = 0; + int count = 3; + bytes[0] = UNW_X3; + + if (rtype == spill_sprel_p) + r = 1; + else if (rtype != spill_psprel_p) + as_bad ("Invalid record type for format X3"); + bytes[1] = ((r << 7) | (qp & 0x3f)); + bytes[2] = format_ab_reg (ab, reg); + count += output_leb128 (bytes + 3, t, 0); + count += output_leb128 (bytes + count, w1, 0); + (*f) (count, bytes, NULL); +} + +static void +output_X4_format (f, qp, ab, reg, x, y, treg, t) + vbyte_func f; + int qp; + int ab, reg; + int x, y, treg; + unsigned long t; +{ + char bytes[20]; + int count = 4; + bytes[0] = UNW_X4; + bytes[1] = (qp & 0x3f); + bytes[2] = (((x & 1) << 7) | format_ab_reg (ab, reg)); + bytes[3] = (((y & 1) << 7) | (treg & 0x7f)); + count += output_leb128 (bytes + 4, t, 0); + (*f) (count, bytes, NULL); +} + +/* This function allocates a record list structure, and initializes fields. */ + +static unw_rec_list * +alloc_record (unw_record_type t) +{ + unw_rec_list *ptr; + ptr = xmalloc (sizeof (*ptr)); + ptr->next = NULL; + ptr->slot_number = SLOT_NUM_NOT_SET; + ptr->r.type = t; + return ptr; +} + +/* This function frees an entire list of record structures. */ + +void +free_list_records (unw_rec_list *first) +{ + unw_rec_list *ptr; + for (ptr = first; ptr != NULL;) + { + unw_rec_list *tmp = ptr; + + if ((tmp->r.type == prologue || tmp->r.type == prologue_gr) + && tmp->r.record.r.mask.i) + free (tmp->r.record.r.mask.i); + + ptr = ptr->next; + free (tmp); + } +} + +static unw_rec_list * +output_prologue () +{ + unw_rec_list *ptr = alloc_record (prologue); + memset (&ptr->r.record.r.mask, 0, sizeof (ptr->r.record.r.mask)); + return ptr; +} + +static unw_rec_list * +output_prologue_gr (saved_mask, reg) + unsigned int saved_mask; + unsigned int reg; +{ + unw_rec_list *ptr = alloc_record (prologue_gr); + memset (&ptr->r.record.r.mask, 0, sizeof (ptr->r.record.r.mask)); + ptr->r.record.r.grmask = saved_mask; + ptr->r.record.r.grsave = reg; + return ptr; +} + +static unw_rec_list * +output_body () +{ + unw_rec_list *ptr = alloc_record (body); + return ptr; +} + +static unw_rec_list * +output_mem_stack_f (size) + unsigned int size; +{ + unw_rec_list *ptr = alloc_record (mem_stack_f); + ptr->r.record.p.size = size; + return ptr; +} + +static unw_rec_list * +output_mem_stack_v () +{ + unw_rec_list *ptr = alloc_record (mem_stack_v); + return ptr; +} + +static unw_rec_list * +output_psp_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (psp_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_psp_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (psp_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_rp_when () +{ + unw_rec_list *ptr = alloc_record (rp_when); + return ptr; +} + +static unw_rec_list * +output_rp_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (rp_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_rp_br (br) + unsigned int br; +{ + unw_rec_list *ptr = alloc_record (rp_br); + ptr->r.record.p.br = br; + return ptr; +} + +static unw_rec_list * +output_rp_psprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (rp_psprel); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_rp_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (rp_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_pfs_when () +{ + unw_rec_list *ptr = alloc_record (pfs_when); + return ptr; +} + +static unw_rec_list * +output_pfs_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (pfs_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_pfs_psprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (pfs_psprel); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_pfs_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (pfs_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_preds_when () +{ + unw_rec_list *ptr = alloc_record (preds_when); + return ptr; +} + +static unw_rec_list * +output_preds_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (preds_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_preds_psprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (preds_psprel); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_preds_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (preds_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_fr_mem (mask) + unsigned int mask; +{ + unw_rec_list *ptr = alloc_record (fr_mem); + ptr->r.record.p.rmask = mask; + return ptr; +} + +static unw_rec_list * +output_frgr_mem (gr_mask, fr_mask) + unsigned int gr_mask; + unsigned int fr_mask; +{ + unw_rec_list *ptr = alloc_record (frgr_mem); + ptr->r.record.p.grmask = gr_mask; + ptr->r.record.p.frmask = fr_mask; + return ptr; +} + +static unw_rec_list * +output_gr_gr (mask, reg) + unsigned int mask; + unsigned int reg; +{ + unw_rec_list *ptr = alloc_record (gr_gr); + ptr->r.record.p.grmask = mask; + ptr->r.record.p.gr = reg; + return ptr; +} + +static unw_rec_list * +output_gr_mem (mask) + unsigned int mask; +{ + unw_rec_list *ptr = alloc_record (gr_mem); + ptr->r.record.p.rmask = mask; + return ptr; +} + +static unw_rec_list * +output_br_mem (unsigned int mask) +{ + unw_rec_list *ptr = alloc_record (br_mem); + ptr->r.record.p.brmask = mask; + return ptr; +} + +static unw_rec_list * +output_br_gr (save_mask, reg) + unsigned int save_mask; + unsigned int reg; +{ + unw_rec_list *ptr = alloc_record (br_gr); + ptr->r.record.p.brmask = save_mask; + ptr->r.record.p.gr = reg; + return ptr; +} + +static unw_rec_list * +output_spill_base (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (spill_base); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_unat_when () +{ + unw_rec_list *ptr = alloc_record (unat_when); + return ptr; +} + +static unw_rec_list * +output_unat_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (unat_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_unat_psprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (unat_psprel); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_unat_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (unat_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_lc_when () +{ + unw_rec_list *ptr = alloc_record (lc_when); + return ptr; +} + +static unw_rec_list * +output_lc_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (lc_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_lc_psprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (lc_psprel); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_lc_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (lc_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_fpsr_when () +{ + unw_rec_list *ptr = alloc_record (fpsr_when); + return ptr; +} + +static unw_rec_list * +output_fpsr_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (fpsr_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_fpsr_psprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (fpsr_psprel); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_fpsr_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (fpsr_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_priunat_when_gr () +{ + unw_rec_list *ptr = alloc_record (priunat_when_gr); + return ptr; +} + +static unw_rec_list * +output_priunat_when_mem () +{ + unw_rec_list *ptr = alloc_record (priunat_when_mem); + return ptr; +} + +static unw_rec_list * +output_priunat_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (priunat_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_priunat_psprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (priunat_psprel); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_priunat_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (priunat_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_bsp_when () +{ + unw_rec_list *ptr = alloc_record (bsp_when); + return ptr; +} + +static unw_rec_list * +output_bsp_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (bsp_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_bsp_psprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (bsp_psprel); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_bsp_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (bsp_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_bspstore_when () +{ + unw_rec_list *ptr = alloc_record (bspstore_when); + return ptr; +} + +static unw_rec_list * +output_bspstore_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (bspstore_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_bspstore_psprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (bspstore_psprel); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_bspstore_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (bspstore_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_rnat_when () +{ + unw_rec_list *ptr = alloc_record (rnat_when); + return ptr; +} + +static unw_rec_list * +output_rnat_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (rnat_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_rnat_psprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (rnat_psprel); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_rnat_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (rnat_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_unwabi (abi, context) + unsigned long abi; + unsigned long context; +{ + unw_rec_list *ptr = alloc_record (unwabi); + ptr->r.record.p.abi = abi; + ptr->r.record.p.context = context; + return ptr; +} + +static unw_rec_list * +output_epilogue (unsigned long ecount) +{ + unw_rec_list *ptr = alloc_record (epilogue); + ptr->r.record.b.ecount = ecount; + return ptr; +} + +static unw_rec_list * +output_label_state (unsigned long label) +{ + unw_rec_list *ptr = alloc_record (label_state); + ptr->r.record.b.label = label; + return ptr; +} + +static unw_rec_list * +output_copy_state (unsigned long label) +{ + unw_rec_list *ptr = alloc_record (copy_state); + ptr->r.record.b.label = label; + return ptr; +} + +static unw_rec_list * +output_spill_psprel (ab, reg, offset) + unsigned int ab; + unsigned int reg; + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (spill_psprel); + ptr->r.record.x.ab = ab; + ptr->r.record.x.reg = reg; + ptr->r.record.x.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_spill_sprel (ab, reg, offset) + unsigned int ab; + unsigned int reg; + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (spill_sprel); + ptr->r.record.x.ab = ab; + ptr->r.record.x.reg = reg; + ptr->r.record.x.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_spill_psprel_p (ab, reg, offset, predicate) + unsigned int ab; + unsigned int reg; + unsigned int offset; + unsigned int predicate; +{ + unw_rec_list *ptr = alloc_record (spill_psprel_p); + ptr->r.record.x.ab = ab; + ptr->r.record.x.reg = reg; + ptr->r.record.x.pspoff = offset / 4; + ptr->r.record.x.qp = predicate; + return ptr; +} + +static unw_rec_list * +output_spill_sprel_p (ab, reg, offset, predicate) + unsigned int ab; + unsigned int reg; + unsigned int offset; + unsigned int predicate; +{ + unw_rec_list *ptr = alloc_record (spill_sprel_p); + ptr->r.record.x.ab = ab; + ptr->r.record.x.reg = reg; + ptr->r.record.x.spoff = offset / 4; + ptr->r.record.x.qp = predicate; + return ptr; +} + +static unw_rec_list * +output_spill_reg (ab, reg, targ_reg, xy) + unsigned int ab; + unsigned int reg; + unsigned int targ_reg; + unsigned int xy; +{ + unw_rec_list *ptr = alloc_record (spill_reg); + ptr->r.record.x.ab = ab; + ptr->r.record.x.reg = reg; + ptr->r.record.x.treg = targ_reg; + ptr->r.record.x.xy = xy; + return ptr; +} + +static unw_rec_list * +output_spill_reg_p (ab, reg, targ_reg, xy, predicate) + unsigned int ab; + unsigned int reg; + unsigned int targ_reg; + unsigned int xy; + unsigned int predicate; +{ + unw_rec_list *ptr = alloc_record (spill_reg_p); + ptr->r.record.x.ab = ab; + ptr->r.record.x.reg = reg; + ptr->r.record.x.treg = targ_reg; + ptr->r.record.x.xy = xy; + ptr->r.record.x.qp = predicate; + return ptr; +} + +/* Given a unw_rec_list process the correct format with the + specified function. */ + +static void +process_one_record (ptr, f) + unw_rec_list *ptr; + vbyte_func f; +{ + unsigned long fr_mask, gr_mask; + + switch (ptr->r.type) + { + case gr_mem: + case fr_mem: + case br_mem: + case frgr_mem: + /* These are taken care of by prologue/prologue_gr. */ + break; + + case prologue_gr: + case prologue: + if (ptr->r.type == prologue_gr) + output_R2_format (f, ptr->r.record.r.grmask, + ptr->r.record.r.grsave, ptr->r.record.r.rlen); + else + output_R1_format (f, ptr->r.type, ptr->r.record.r.rlen); + + /* Output descriptor(s) for union of register spills (if any). */ + gr_mask = ptr->r.record.r.mask.gr_mem; + fr_mask = ptr->r.record.r.mask.fr_mem; + if (fr_mask) + { + if ((fr_mask & ~0xfUL) == 0) + output_P6_format (f, fr_mem, fr_mask); + else + { + output_P5_format (f, gr_mask, fr_mask); + gr_mask = 0; + } + } + if (gr_mask) + output_P6_format (f, gr_mem, gr_mask); + if (ptr->r.record.r.mask.br_mem) + output_P1_format (f, ptr->r.record.r.mask.br_mem); + + /* output imask descriptor if necessary: */ + if (ptr->r.record.r.mask.i) + output_P4_format (f, ptr->r.record.r.mask.i, + ptr->r.record.r.imask_size); + break; + + case body: + output_R1_format (f, ptr->r.type, ptr->r.record.r.rlen); + break; + case mem_stack_f: + case mem_stack_v: + output_P7_format (f, ptr->r.type, ptr->r.record.p.t, + ptr->r.record.p.size); + break; + case psp_gr: + case rp_gr: + case pfs_gr: + case preds_gr: + case unat_gr: + case lc_gr: + case fpsr_gr: + case priunat_gr: + case bsp_gr: + case bspstore_gr: + case rnat_gr: + output_P3_format (f, ptr->r.type, ptr->r.record.p.gr); + break; + case rp_br: + output_P3_format (f, rp_br, ptr->r.record.p.br); + break; + case psp_sprel: + output_P7_format (f, psp_sprel, ptr->r.record.p.spoff, 0); + break; + case rp_when: + case pfs_when: + case preds_when: + case unat_when: + case lc_when: + case fpsr_when: + output_P7_format (f, ptr->r.type, ptr->r.record.p.t, 0); + break; + case rp_psprel: + case pfs_psprel: + case preds_psprel: + case unat_psprel: + case lc_psprel: + case fpsr_psprel: + case spill_base: + output_P7_format (f, ptr->r.type, ptr->r.record.p.pspoff, 0); + break; + case rp_sprel: + case pfs_sprel: + case preds_sprel: + case unat_sprel: + case lc_sprel: + case fpsr_sprel: + case priunat_sprel: + case bsp_sprel: + case bspstore_sprel: + case rnat_sprel: + output_P8_format (f, ptr->r.type, ptr->r.record.p.spoff); + break; + case gr_gr: + output_P9_format (f, ptr->r.record.p.grmask, ptr->r.record.p.gr); + break; + case br_gr: + output_P2_format (f, ptr->r.record.p.brmask, ptr->r.record.p.gr); + break; + case spill_mask: + as_bad ("spill_mask record unimplemented."); + break; + case priunat_when_gr: + case priunat_when_mem: + case bsp_when: + case bspstore_when: + case rnat_when: + output_P8_format (f, ptr->r.type, ptr->r.record.p.t); + break; + case priunat_psprel: + case bsp_psprel: + case bspstore_psprel: + case rnat_psprel: + output_P8_format (f, ptr->r.type, ptr->r.record.p.pspoff); + break; + case unwabi: + output_P10_format (f, ptr->r.record.p.abi, ptr->r.record.p.context); + break; + case epilogue: + output_B3_format (f, ptr->r.record.b.ecount, ptr->r.record.b.t); + break; + case label_state: + case copy_state: + output_B4_format (f, ptr->r.type, ptr->r.record.b.label); + break; + case spill_psprel: + output_X1_format (f, ptr->r.type, ptr->r.record.x.ab, + ptr->r.record.x.reg, ptr->r.record.x.t, + ptr->r.record.x.pspoff); + break; + case spill_sprel: + output_X1_format (f, ptr->r.type, ptr->r.record.x.ab, + ptr->r.record.x.reg, ptr->r.record.x.t, + ptr->r.record.x.spoff); + break; + case spill_reg: + output_X2_format (f, ptr->r.record.x.ab, ptr->r.record.x.reg, + ptr->r.record.x.xy >> 1, ptr->r.record.x.xy, + ptr->r.record.x.treg, ptr->r.record.x.t); + break; + case spill_psprel_p: + output_X3_format (f, ptr->r.type, ptr->r.record.x.qp, + ptr->r.record.x.ab, ptr->r.record.x.reg, + ptr->r.record.x.t, ptr->r.record.x.pspoff); + break; + case spill_sprel_p: + output_X3_format (f, ptr->r.type, ptr->r.record.x.qp, + ptr->r.record.x.ab, ptr->r.record.x.reg, + ptr->r.record.x.t, ptr->r.record.x.spoff); + break; + case spill_reg_p: + output_X4_format (f, ptr->r.record.x.qp, ptr->r.record.x.ab, + ptr->r.record.x.reg, ptr->r.record.x.xy >> 1, + ptr->r.record.x.xy, ptr->r.record.x.treg, + ptr->r.record.x.t); + break; + default: + as_bad ("record_type_not_valid"); + break; + } +} + +/* Given a unw_rec_list list, process all the records with + the specified function. */ +static void +process_unw_records (list, f) + unw_rec_list *list; + vbyte_func f; +{ + unw_rec_list *ptr; + for (ptr = list; ptr; ptr = ptr->next) + process_one_record (ptr, f); +} + +/* Determine the size of a record list in bytes. */ +static int +calc_record_size (list) + unw_rec_list *list; +{ + vbyte_count = 0; + process_unw_records (list, count_output); + return vbyte_count; +} + +/* Update IMASK bitmask to reflect the fact that one or more registers + of type TYPE are saved starting at instruction with index T. If N + bits are set in REGMASK, it is assumed that instructions T through + T+N-1 save these registers. + + TYPE values: + 0: no save + 1: instruction saves next fp reg + 2: instruction saves next general reg + 3: instruction saves next branch reg */ +static void +set_imask (region, regmask, t, type) + unw_rec_list *region; + unsigned long regmask; + unsigned long t; + unsigned int type; +{ + unsigned char *imask; + unsigned long imask_size; + unsigned int i; + int pos; + + imask = region->r.record.r.mask.i; + imask_size = region->r.record.r.imask_size; + if (!imask) + { + imask_size = (region->r.record.r.rlen * 2 + 7) / 8 + 1; + imask = xmalloc (imask_size); + memset (imask, 0, imask_size); + + region->r.record.r.imask_size = imask_size; + region->r.record.r.mask.i = imask; + } + + i = (t / 4) + 1; + pos = 2 * (3 - t % 4); + while (regmask) + { + if (i >= imask_size) + { + as_bad ("Ignoring attempt to spill beyond end of region"); + return; + } + + imask[i] |= (type & 0x3) << pos; + + regmask &= (regmask - 1); + pos -= 2; + if (pos < 0) + { + pos = 0; + ++i; + } + } +} + +static int +count_bits (unsigned long mask) +{ + int n = 0; + + while (mask) + { + mask &= mask - 1; + ++n; + } + return n; +} + +/* Return the number of instruction slots from FIRST_ADDR to SLOT_ADDR. + SLOT_FRAG is the frag containing SLOT_ADDR, and FIRST_FRAG is the frag + containing FIRST_ADDR. */ + +unsigned long +slot_index (slot_addr, slot_frag, first_addr, first_frag) + unsigned long slot_addr; + fragS *slot_frag; + unsigned long first_addr; + fragS *first_frag; +{ + unsigned long index = 0; + + /* First time we are called, the initial address and frag are invalid. */ + if (first_addr == 0) + return 0; + + /* If the two addresses are in different frags, then we need to add in + the remaining size of this frag, and then the entire size of intermediate + frags. */ + while (slot_frag != first_frag) + { + unsigned long start_addr = (unsigned long) &first_frag->fr_literal; + + /* Add in the full size of the frag converted to instruction slots. */ + index += 3 * (first_frag->fr_fix >> 4); + /* Subtract away the initial part before first_addr. */ + index -= (3 * ((first_addr >> 4) - (start_addr >> 4)) + + ((first_addr & 0x3) - (start_addr & 0x3))); + + /* Move to the beginning of the next frag. */ + first_frag = first_frag->fr_next; + first_addr = (unsigned long) &first_frag->fr_literal; + } + + /* Add in the used part of the last frag. */ + index += (3 * ((slot_addr >> 4) - (first_addr >> 4)) + + ((slot_addr & 0x3) - (first_addr & 0x3))); + return index; +} + +/* Optimize unwind record directives. */ + +static unw_rec_list * +optimize_unw_records (list) + unw_rec_list *list; +{ + if (!list) + return NULL; + + /* If the only unwind record is ".prologue" or ".prologue" followed + by ".body", then we can optimize the unwind directives away. */ + if (list->r.type == prologue + && (list->next == NULL + || (list->next->r.type == body && list->next->next == NULL))) + return NULL; + + return list; +} + +/* Given a complete record list, process any records which have + unresolved fields, (ie length counts for a prologue). After + this has been run, all neccessary information should be available + within each record to generate an image. */ + +static void +fixup_unw_records (list) + unw_rec_list *list; +{ + unw_rec_list *ptr, *region = 0; + unsigned long first_addr = 0, rlen = 0, t; + fragS *first_frag = 0; + + for (ptr = list; ptr; ptr = ptr->next) + { + if (ptr->slot_number == SLOT_NUM_NOT_SET) + as_bad (" Insn slot not set in unwind record."); + t = slot_index (ptr->slot_number, ptr->slot_frag, + first_addr, first_frag); + switch (ptr->r.type) + { + case prologue: + case prologue_gr: + case body: + { + unw_rec_list *last; + int size, dir_len = 0; + unsigned long last_addr; + fragS *last_frag; + + first_addr = ptr->slot_number; + first_frag = ptr->slot_frag; + ptr->slot_number = 0; + /* Find either the next body/prologue start, or the end of + the list, and determine the size of the region. */ + last_addr = unwind.next_slot_number; + last_frag = unwind.next_slot_frag; + for (last = ptr->next; last != NULL; last = last->next) + if (last->r.type == prologue || last->r.type == prologue_gr + || last->r.type == body) + { + last_addr = last->slot_number; + last_frag = last->slot_frag; + break; + } + else if (!last->next) + { + /* In the absence of an explicit .body directive, + the prologue ends after the last instruction + covered by an unwind directive. */ + if (ptr->r.type != body) + { + last_addr = last->slot_number; + last_frag = last->slot_frag; + switch (last->r.type) + { + case frgr_mem: + dir_len = (count_bits (last->r.record.p.frmask) + + count_bits (last->r.record.p.grmask)); + break; + case fr_mem: + case gr_mem: + dir_len += count_bits (last->r.record.p.rmask); + break; + case br_mem: + case br_gr: + dir_len += count_bits (last->r.record.p.brmask); + break; + case gr_gr: + dir_len += count_bits (last->r.record.p.grmask); + break; + default: + dir_len = 1; + break; + } + } + break; + } + size = (slot_index (last_addr, last_frag, first_addr, first_frag) + + dir_len); + rlen = ptr->r.record.r.rlen = size; + region = ptr; + break; + } + case epilogue: + ptr->r.record.b.t = rlen - 1 - t; + break; + + case mem_stack_f: + case mem_stack_v: + case rp_when: + case pfs_when: + case preds_when: + case unat_when: + case lc_when: + case fpsr_when: + case priunat_when_gr: + case priunat_when_mem: + case bsp_when: + case bspstore_when: + case rnat_when: + ptr->r.record.p.t = t; + break; + + case spill_reg: + case spill_sprel: + case spill_psprel: + case spill_reg_p: + case spill_sprel_p: + case spill_psprel_p: + ptr->r.record.x.t = t; + break; + + case frgr_mem: + if (!region) + { + as_bad ("frgr_mem record before region record!\n"); + return; + } + region->r.record.r.mask.fr_mem |= ptr->r.record.p.frmask; + region->r.record.r.mask.gr_mem |= ptr->r.record.p.grmask; + set_imask (region, ptr->r.record.p.frmask, t, 1); + set_imask (region, ptr->r.record.p.grmask, t, 2); + break; + case fr_mem: + if (!region) + { + as_bad ("fr_mem record before region record!\n"); + return; + } + region->r.record.r.mask.fr_mem |= ptr->r.record.p.rmask; + set_imask (region, ptr->r.record.p.rmask, t, 1); + break; + case gr_mem: + if (!region) + { + as_bad ("gr_mem record before region record!\n"); + return; + } + region->r.record.r.mask.gr_mem |= ptr->r.record.p.rmask; + set_imask (region, ptr->r.record.p.rmask, t, 2); + break; + case br_mem: + if (!region) + { + as_bad ("br_mem record before region record!\n"); + return; + } + region->r.record.r.mask.br_mem |= ptr->r.record.p.brmask; + set_imask (region, ptr->r.record.p.brmask, t, 3); + break; + + case gr_gr: + if (!region) + { + as_bad ("gr_gr record before region record!\n"); + return; + } + set_imask (region, ptr->r.record.p.grmask, t, 2); + break; + case br_gr: + if (!region) + { + as_bad ("br_gr record before region record!\n"); + return; + } + set_imask (region, ptr->r.record.p.brmask, t, 3); + break; + + default: + break; + } + } +} + +/* Generate an unwind image from a record list. Returns the number of + bytes in the resulting image. The memory image itselof is returned + in the 'ptr' parameter. */ +static int +output_unw_records (list, ptr) + unw_rec_list *list; + void **ptr; +{ + int size, x, extra = 0; + unsigned char *mem; + + *ptr = NULL; + + list = optimize_unw_records (list); + fixup_unw_records (list); + size = calc_record_size (list); + + /* pad to 8 byte boundry. */ + x = size % 8; + if (x != 0) + extra = 8 - x; + + if (size > 0 || unwind.force_unwind_entry) + { + unwind.force_unwind_entry = 0; + + /* Add 8 for the header + 8 more bytes for the personality offset. */ + mem = xmalloc (size + extra + 16); + + vbyte_mem_ptr = mem + 8; + /* Clear the padding area and personality. */ + memset (mem + 8 + size, 0 , extra + 8); + /* Initialize the header area. */ + md_number_to_chars (mem, + (((bfd_vma) 1 << 48) /* version */ + | (unwind.personality_routine + ? ((bfd_vma) 3 << 32) /* U & E handler flags */ + : 0) + | ((size + extra) / 8)), /* length (dwords) */ + 8); + + process_unw_records (list, output_vbyte_mem); + + *ptr = mem; + + size += extra + 16; + } + return size; +} + +static int +convert_expr_to_ab_reg (e, ab, regp) + expressionS *e; + unsigned int *ab; + unsigned int *regp; +{ + unsigned int reg; + + if (e->X_op != O_register) + return 0; + + reg = e->X_add_number; + if (reg >= (REG_GR + 4) && reg <= (REG_GR + 7)) + { + *ab = 0; + *regp = reg - REG_GR; + } + else if ((reg >= (REG_FR + 2) && reg <= (REG_FR + 5)) + || (reg >= (REG_FR + 16) && reg <= (REG_FR + 31))) + { + *ab = 1; + *regp = reg - REG_FR; + } + else if (reg >= (REG_BR + 1) && reg <= (REG_BR + 5)) + { + *ab = 2; + *regp = reg - REG_BR; + } + else + { + *ab = 3; + switch (reg) + { + case REG_PR: *regp = 0; break; + case REG_PSP: *regp = 1; break; + case REG_PRIUNAT: *regp = 2; break; + case REG_BR + 0: *regp = 3; break; + case REG_AR + AR_BSP: *regp = 4; break; + case REG_AR + AR_BSPSTORE: *regp = 5; break; + case REG_AR + AR_RNAT: *regp = 6; break; + case REG_AR + AR_UNAT: *regp = 7; break; + case REG_AR + AR_FPSR: *regp = 8; break; + case REG_AR + AR_PFS: *regp = 9; break; + case REG_AR + AR_LC: *regp = 10; break; + + default: + return 0; + } + } + return 1; +} + +static int +convert_expr_to_xy_reg (e, xy, regp) + expressionS *e; + unsigned int *xy; + unsigned int *regp; +{ + unsigned int reg; + + if (e->X_op != O_register) + return 0; + + reg = e->X_add_number; + + if (/* reg >= REG_GR && */ reg <= (REG_GR + 127)) + { + *xy = 0; + *regp = reg - REG_GR; + } + else if (reg >= REG_FR && reg <= (REG_FR + 127)) + { + *xy = 1; + *regp = reg - REG_FR; + } + else if (reg >= REG_BR && reg <= (REG_BR + 7)) + { + *xy = 2; + *regp = reg - REG_BR; + } + else + return -1; + return 1; +} + +static void +dot_radix (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + int radix; + + SKIP_WHITESPACE (); + radix = *input_line_pointer++; + + if (radix != 'C' && !is_end_of_line[(unsigned char) radix]) + { + as_bad ("Radix `%c' unsupported", *input_line_pointer); + ignore_rest_of_line (); + return; + } +} + +/* .sbss, .bss etc. are macros that expand into ".section SECNAME". */ +static void +dot_special_section (which) + int which; +{ + set_section ((char *) special_section_name[which]); +} + +static void +add_unwind_entry (ptr) + unw_rec_list *ptr; +{ + if (unwind.tail) + unwind.tail->next = ptr; + else + unwind.list = ptr; + unwind.tail = ptr; + + /* The current entry can in fact be a chain of unwind entries. */ + if (unwind.current_entry == NULL) + unwind.current_entry = ptr; +} + +static void +dot_fframe (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e; + + parse_operand (&e); + + if (e.X_op != O_constant) + as_bad ("Operand to .fframe must be a constant"); + else + add_unwind_entry (output_mem_stack_f (e.X_add_number)); +} + +static void +dot_vframe (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e; + unsigned reg; + + parse_operand (&e); + reg = e.X_add_number - REG_GR; + if (e.X_op == O_register && reg < 128) + { + add_unwind_entry (output_mem_stack_v ()); + if (! (unwind.prologue_mask & 2)) + add_unwind_entry (output_psp_gr (reg)); + } + else + as_bad ("First operand to .vframe must be a general register"); +} + +static void +dot_vframesp (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e; + + parse_operand (&e); + if (e.X_op == O_constant) + { + add_unwind_entry (output_mem_stack_v ()); + add_unwind_entry (output_psp_sprel (e.X_add_number)); + } + else + as_bad ("First operand to .vframesp must be a general register"); +} + +static void +dot_vframepsp (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e; + + parse_operand (&e); + if (e.X_op == O_constant) + { + add_unwind_entry (output_mem_stack_v ()); + add_unwind_entry (output_psp_sprel (e.X_add_number)); + } + else + as_bad ("First operand to .vframepsp must be a general register"); +} + +static void +dot_save (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e1, e2; + int sep; + int reg1, reg2; + + sep = parse_operand (&e1); + if (sep != ',') + as_bad ("No second operand to .save"); + sep = parse_operand (&e2); + + reg1 = e1.X_add_number; + reg2 = e2.X_add_number - REG_GR; + + /* Make sure its a valid ar.xxx reg, OR its br0, aka 'rp'. */ + if (e1.X_op == O_register) + { + if (e2.X_op == O_register && reg2 >= 0 && reg2 < 128) + { + switch (reg1) + { + case REG_AR + AR_BSP: + add_unwind_entry (output_bsp_when ()); + add_unwind_entry (output_bsp_gr (reg2)); + break; + case REG_AR + AR_BSPSTORE: + add_unwind_entry (output_bspstore_when ()); + add_unwind_entry (output_bspstore_gr (reg2)); + break; + case REG_AR + AR_RNAT: + add_unwind_entry (output_rnat_when ()); + add_unwind_entry (output_rnat_gr (reg2)); + break; + case REG_AR + AR_UNAT: + add_unwind_entry (output_unat_when ()); + add_unwind_entry (output_unat_gr (reg2)); + break; + case REG_AR + AR_FPSR: + add_unwind_entry (output_fpsr_when ()); + add_unwind_entry (output_fpsr_gr (reg2)); + break; + case REG_AR + AR_PFS: + add_unwind_entry (output_pfs_when ()); + if (! (unwind.prologue_mask & 4)) + add_unwind_entry (output_pfs_gr (reg2)); + break; + case REG_AR + AR_LC: + add_unwind_entry (output_lc_when ()); + add_unwind_entry (output_lc_gr (reg2)); + break; + case REG_BR: + add_unwind_entry (output_rp_when ()); + if (! (unwind.prologue_mask & 8)) + add_unwind_entry (output_rp_gr (reg2)); + break; + case REG_PR: + add_unwind_entry (output_preds_when ()); + if (! (unwind.prologue_mask & 1)) + add_unwind_entry (output_preds_gr (reg2)); + break; + case REG_PRIUNAT: + add_unwind_entry (output_priunat_when_gr ()); + add_unwind_entry (output_priunat_gr (reg2)); + break; + default: + as_bad ("First operand not a valid register"); + } + } + else + as_bad (" Second operand not a valid register"); + } + else + as_bad ("First operand not a register"); +} + +static void +dot_restore (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e1, e2; + unsigned long ecount; /* # of _additional_ regions to pop */ + int sep; + + sep = parse_operand (&e1); + if (e1.X_op != O_register || e1.X_add_number != REG_GR + 12) + { + as_bad ("First operand to .restore must be stack pointer (sp)"); + return; + } + + if (sep == ',') + { + parse_operand (&e2); + if (e2.X_op != O_constant || e2.X_add_number < 0) + { + as_bad ("Second operand to .restore must be a constant >= 0"); + return; + } + ecount = e2.X_add_number; + } + else + ecount = unwind.prologue_count - 1; + add_unwind_entry (output_epilogue (ecount)); + + if (ecount < unwind.prologue_count) + unwind.prologue_count -= ecount + 1; + else + unwind.prologue_count = 0; +} + +static void +dot_restorereg (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + unsigned int ab, reg; + expressionS e; + + parse_operand (&e); + + if (!convert_expr_to_ab_reg (&e, &ab, ®)) + { + as_bad ("First operand to .restorereg must be a preserved register"); + return; + } + add_unwind_entry (output_spill_reg (ab, reg, 0, 0)); +} + +static void +dot_restorereg_p (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + unsigned int qp, ab, reg; + expressionS e1, e2; + int sep; + + sep = parse_operand (&e1); + if (sep != ',') + { + as_bad ("No second operand to .restorereg.p"); + return; + } + + parse_operand (&e2); + + qp = e1.X_add_number - REG_P; + if (e1.X_op != O_register || qp > 63) + { + as_bad ("First operand to .restorereg.p must be a predicate"); + return; + } + + if (!convert_expr_to_ab_reg (&e2, &ab, ®)) + { + as_bad ("Second operand to .restorereg.p must be a preserved register"); + return; + } + add_unwind_entry (output_spill_reg_p (ab, reg, 0, 0, qp)); +} + +static int +generate_unwind_image (text_name) + const char *text_name; +{ + int size; + unsigned char *unw_rec; + + /* Force out pending instructions, to make sure all unwind records have + a valid slot_number field. */ + ia64_flush_insns (); + + /* Generate the unwind record. */ + size = output_unw_records (unwind.list, (void **) &unw_rec); + if (size % 8 != 0) + as_bad ("Unwind record is not a multiple of 8 bytes."); + + /* If there are unwind records, switch sections, and output the info. */ + if (size != 0) + { + unsigned char *where; + char *sec_name; + expressionS exp; + + make_unw_section_name (SPECIAL_SECTION_UNWIND_INFO, text_name, sec_name); + set_section (sec_name); + bfd_set_section_flags (stdoutput, now_seg, + SEC_LOAD | SEC_ALLOC | SEC_READONLY); + + /* Make sure the section has 8 byte alignment. */ + frag_align (3, 0, 0); + record_alignment (now_seg, 3); + + /* Set expression which points to start of unwind descriptor area. */ + unwind.info = expr_build_dot (); + + where = (unsigned char *) frag_more (size); + + /* Issue a label for this address, and keep track of it to put it + in the unwind section. */ + + /* Copy the information from the unwind record into this section. The + data is already in the correct byte order. */ + memcpy (where, unw_rec, size); + + /* Add the personality address to the image. */ + if (unwind.personality_routine != 0) + { + exp.X_op = O_symbol; + exp.X_add_symbol = unwind.personality_routine; + exp.X_add_number = 0; + fix_new_exp (frag_now, frag_now_fix () - 8, 8, + &exp, 0, BFD_RELOC_IA64_LTOFF_FPTR64LSB); + unwind.personality_routine = 0; + } + } + + free_list_records (unwind.list); + unwind.list = unwind.tail = unwind.current_entry = NULL; + + return size; +} + +static void +dot_handlerdata (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + const char *text_name = segment_name (now_seg); + + /* If text section name starts with ".text" (which it should), + strip this prefix off. */ + if (strcmp (text_name, ".text") == 0) + text_name = ""; + + unwind.force_unwind_entry = 1; + + /* Remember which segment we're in so we can switch back after .endp */ + unwind.saved_text_seg = now_seg; + unwind.saved_text_subseg = now_subseg; + + /* Generate unwind info into unwind-info section and then leave that + section as the currently active one so dataXX directives go into + the language specific data area of the unwind info block. */ + generate_unwind_image (text_name); + demand_empty_rest_of_line (); +} + +static void +dot_unwentry (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + unwind.force_unwind_entry = 1; + demand_empty_rest_of_line (); +} + +static void +dot_altrp (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e; + unsigned reg; + + parse_operand (&e); + reg = e.X_add_number - REG_BR; + if (e.X_op == O_register && reg < 8) + add_unwind_entry (output_rp_br (reg)); + else + as_bad ("First operand not a valid branch register"); +} + +static void +dot_savemem (psprel) + int psprel; +{ + expressionS e1, e2; + int sep; + int reg1, val; + + sep = parse_operand (&e1); + if (sep != ',') + as_bad ("No second operand to .save%ssp", psprel ? "p" : ""); + sep = parse_operand (&e2); + + reg1 = e1.X_add_number; + val = e2.X_add_number; + + /* Make sure its a valid ar.xxx reg, OR its br0, aka 'rp'. */ + if (e1.X_op == O_register) + { + if (e2.X_op == O_constant) + { + switch (reg1) + { + case REG_AR + AR_BSP: + add_unwind_entry (output_bsp_when ()); + add_unwind_entry ((psprel + ? output_bsp_psprel + : output_bsp_sprel) (val)); + break; + case REG_AR + AR_BSPSTORE: + add_unwind_entry (output_bspstore_when ()); + add_unwind_entry ((psprel + ? output_bspstore_psprel + : output_bspstore_sprel) (val)); + break; + case REG_AR + AR_RNAT: + add_unwind_entry (output_rnat_when ()); + add_unwind_entry ((psprel + ? output_rnat_psprel + : output_rnat_sprel) (val)); + break; + case REG_AR + AR_UNAT: + add_unwind_entry (output_unat_when ()); + add_unwind_entry ((psprel + ? output_unat_psprel + : output_unat_sprel) (val)); + break; + case REG_AR + AR_FPSR: + add_unwind_entry (output_fpsr_when ()); + add_unwind_entry ((psprel + ? output_fpsr_psprel + : output_fpsr_sprel) (val)); + break; + case REG_AR + AR_PFS: + add_unwind_entry (output_pfs_when ()); + add_unwind_entry ((psprel + ? output_pfs_psprel + : output_pfs_sprel) (val)); + break; + case REG_AR + AR_LC: + add_unwind_entry (output_lc_when ()); + add_unwind_entry ((psprel + ? output_lc_psprel + : output_lc_sprel) (val)); + break; + case REG_BR: + add_unwind_entry (output_rp_when ()); + add_unwind_entry ((psprel + ? output_rp_psprel + : output_rp_sprel) (val)); + break; + case REG_PR: + add_unwind_entry (output_preds_when ()); + add_unwind_entry ((psprel + ? output_preds_psprel + : output_preds_sprel) (val)); + break; + case REG_PRIUNAT: + add_unwind_entry (output_priunat_when_mem ()); + add_unwind_entry ((psprel + ? output_priunat_psprel + : output_priunat_sprel) (val)); + break; + default: + as_bad ("First operand not a valid register"); + } + } + else + as_bad (" Second operand not a valid constant"); + } + else + as_bad ("First operand not a register"); +} + +static void +dot_saveg (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e1, e2; + int sep; + sep = parse_operand (&e1); + if (sep == ',') + parse_operand (&e2); + + if (e1.X_op != O_constant) + as_bad ("First operand to .save.g must be a constant."); + else + { + int grmask = e1.X_add_number; + if (sep != ',') + add_unwind_entry (output_gr_mem (grmask)); + else + { + int reg = e2.X_add_number - REG_GR; + if (e2.X_op == O_register && reg >= 0 && reg < 128) + add_unwind_entry (output_gr_gr (grmask, reg)); + else + as_bad ("Second operand is an invalid register."); + } + } +} + +static void +dot_savef (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e1; + int sep; + sep = parse_operand (&e1); + + if (e1.X_op != O_constant) + as_bad ("Operand to .save.f must be a constant."); + else + add_unwind_entry (output_fr_mem (e1.X_add_number)); +} + +static void +dot_saveb (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e1, e2; + unsigned int reg; + unsigned char sep; + int brmask; + + sep = parse_operand (&e1); + if (e1.X_op != O_constant) + { + as_bad ("First operand to .save.b must be a constant."); + return; + } + brmask = e1.X_add_number; + + if (sep == ',') + { + sep = parse_operand (&e2); + reg = e2.X_add_number - REG_GR; + if (e2.X_op != O_register || reg > 127) + { + as_bad ("Second operand to .save.b must be a general register."); + return; + } + add_unwind_entry (output_br_gr (brmask, e2.X_add_number)); + } + else + add_unwind_entry (output_br_mem (brmask)); + + if (!is_end_of_line[sep] && !is_it_end_of_statement ()) + ignore_rest_of_line (); +} + +static void +dot_savegf (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e1, e2; + int sep; + sep = parse_operand (&e1); + if (sep == ',') + parse_operand (&e2); + + if (e1.X_op != O_constant || sep != ',' || e2.X_op != O_constant) + as_bad ("Both operands of .save.gf must be constants."); + else + { + int grmask = e1.X_add_number; + int frmask = e2.X_add_number; + add_unwind_entry (output_frgr_mem (grmask, frmask)); + } +} + +static void +dot_spill (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e; + unsigned char sep; + + sep = parse_operand (&e); + if (!is_end_of_line[sep] && !is_it_end_of_statement ()) + ignore_rest_of_line (); + + if (e.X_op != O_constant) + as_bad ("Operand to .spill must be a constant"); + else + add_unwind_entry (output_spill_base (e.X_add_number)); +} + +static void +dot_spillreg (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + int sep, ab, xy, reg, treg; + expressionS e1, e2; + + sep = parse_operand (&e1); + if (sep != ',') + { + as_bad ("No second operand to .spillreg"); + return; + } + + parse_operand (&e2); + + if (!convert_expr_to_ab_reg (&e1, &ab, ®)) + { + as_bad ("First operand to .spillreg must be a preserved register"); + return; + } + + if (!convert_expr_to_xy_reg (&e2, &xy, &treg)) + { + as_bad ("Second operand to .spillreg must be a register"); + return; + } + + add_unwind_entry (output_spill_reg (ab, reg, treg, xy)); +} + +static void +dot_spillmem (psprel) + int psprel; +{ + expressionS e1, e2; + int sep, ab, reg; + + sep = parse_operand (&e1); + if (sep != ',') + { + as_bad ("Second operand missing"); + return; + } + + parse_operand (&e2); + + if (!convert_expr_to_ab_reg (&e1, &ab, ®)) + { + as_bad ("First operand to .spill%s must be a preserved register", + psprel ? "psp" : "sp"); + return; + } + + if (e2.X_op != O_constant) + { + as_bad ("Second operand to .spill%s must be a constant", + psprel ? "psp" : "sp"); + return; + } + + if (psprel) + add_unwind_entry (output_spill_psprel (ab, reg, e2.X_add_number)); + else + add_unwind_entry (output_spill_sprel (ab, reg, e2.X_add_number)); +} + +static void +dot_spillreg_p (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + int sep, ab, xy, reg, treg; + expressionS e1, e2, e3; + unsigned int qp; + + sep = parse_operand (&e1); + if (sep != ',') + { + as_bad ("No second and third operand to .spillreg.p"); + return; + } + + sep = parse_operand (&e2); + if (sep != ',') + { + as_bad ("No third operand to .spillreg.p"); + return; + } + + parse_operand (&e3); + + qp = e1.X_add_number - REG_P; + + if (e1.X_op != O_register || qp > 63) + { + as_bad ("First operand to .spillreg.p must be a predicate"); + return; + } + + if (!convert_expr_to_ab_reg (&e2, &ab, ®)) + { + as_bad ("Second operand to .spillreg.p must be a preserved register"); + return; + } + + if (!convert_expr_to_xy_reg (&e3, &xy, &treg)) + { + as_bad ("Third operand to .spillreg.p must be a register"); + return; + } + + add_unwind_entry (output_spill_reg_p (ab, reg, treg, xy, qp)); +} + +static void +dot_spillmem_p (psprel) + int psprel; +{ + expressionS e1, e2, e3; + int sep, ab, reg; + unsigned int qp; + + sep = parse_operand (&e1); + if (sep != ',') + { + as_bad ("Second operand missing"); + return; + } + + parse_operand (&e2); + if (sep != ',') + { + as_bad ("Second operand missing"); + return; + } + + parse_operand (&e3); + + qp = e1.X_add_number - REG_P; + if (e1.X_op != O_register || qp > 63) + { + as_bad ("First operand to .spill%s_p must be a predicate", + psprel ? "psp" : "sp"); + return; + } + + if (!convert_expr_to_ab_reg (&e2, &ab, ®)) + { + as_bad ("Second operand to .spill%s_p must be a preserved register", + psprel ? "psp" : "sp"); + return; + } + + if (e3.X_op != O_constant) + { + as_bad ("Third operand to .spill%s_p must be a constant", + psprel ? "psp" : "sp"); + return; + } + + if (psprel) + add_unwind_entry (output_spill_psprel_p (ab, reg, e3.X_add_number, qp)); + else + add_unwind_entry (output_spill_sprel_p (ab, reg, e3.X_add_number, qp)); +} + +static void +dot_label_state (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e; + + parse_operand (&e); + if (e.X_op != O_constant) + { + as_bad ("Operand to .label_state must be a constant"); + return; + } + add_unwind_entry (output_label_state (e.X_add_number)); +} + +static void +dot_copy_state (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e; + + parse_operand (&e); + if (e.X_op != O_constant) + { + as_bad ("Operand to .copy_state must be a constant"); + return; + } + add_unwind_entry (output_copy_state (e.X_add_number)); +} + +static void +dot_unwabi (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e1, e2; + unsigned char sep; + + sep = parse_operand (&e1); + if (sep != ',') + { + as_bad ("Second operand to .unwabi missing"); + return; + } + sep = parse_operand (&e2); + if (!is_end_of_line[sep] && !is_it_end_of_statement ()) + ignore_rest_of_line (); + + if (e1.X_op != O_constant) + { + as_bad ("First operand to .unwabi must be a constant"); + return; + } + + if (e2.X_op != O_constant) + { + as_bad ("Second operand to .unwabi must be a constant"); + return; + } + + add_unwind_entry (output_unwabi (e1.X_add_number, e2.X_add_number)); +} + +static void +dot_personality (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + char *name, *p, c; + SKIP_WHITESPACE (); + name = input_line_pointer; + c = get_symbol_end (); + p = input_line_pointer; + unwind.personality_routine = symbol_find_or_make (name); + unwind.force_unwind_entry = 1; + *p = c; + SKIP_WHITESPACE (); + demand_empty_rest_of_line (); +} + +static void +dot_proc (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + char *name, *p, c; + symbolS *sym; + + unwind.proc_start = expr_build_dot (); + /* Parse names of main and alternate entry points and mark them as + function symbols: */ + while (1) + { + SKIP_WHITESPACE (); + name = input_line_pointer; + c = get_symbol_end (); + p = input_line_pointer; + sym = symbol_find_or_make (name); + if (unwind.proc_start == 0) + { + unwind.proc_start = sym; + } + symbol_get_bfdsym (sym)->flags |= BSF_FUNCTION; + *p = c; + SKIP_WHITESPACE (); + if (*input_line_pointer != ',') + break; + ++input_line_pointer; + } + demand_empty_rest_of_line (); + ia64_do_align (16); + + unwind.prologue_count = 0; + unwind.list = unwind.tail = unwind.current_entry = NULL; + unwind.personality_routine = 0; +} + +static void +dot_body (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + unwind.prologue = 0; + unwind.prologue_mask = 0; + + add_unwind_entry (output_body ()); + demand_empty_rest_of_line (); +} + +static void +dot_prologue (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + unsigned char sep; + int mask = 0, grsave = 0; + + if (!is_it_end_of_statement ()) + { + expressionS e1, e2; + sep = parse_operand (&e1); + if (sep != ',') + as_bad ("No second operand to .prologue"); + sep = parse_operand (&e2); + if (!is_end_of_line[sep] && !is_it_end_of_statement ()) + ignore_rest_of_line (); + + if (e1.X_op == O_constant) + { + mask = e1.X_add_number; + + if (e2.X_op == O_constant) + grsave = e2.X_add_number; + else if (e2.X_op == O_register + && (grsave = e2.X_add_number - REG_GR) < 128) + ; + else + as_bad ("Second operand not a constant or general register"); + + add_unwind_entry (output_prologue_gr (mask, grsave)); + } + else + as_bad ("First operand not a constant"); + } + else + add_unwind_entry (output_prologue ()); + + unwind.prologue = 1; + unwind.prologue_mask = mask; + ++unwind.prologue_count; +} + +static void +dot_endp (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e; + unsigned char *ptr; + int bytes_per_address; + long where; + segT saved_seg; + subsegT saved_subseg; + const char *sec_name, *text_name; + + if (unwind.saved_text_seg) + { + saved_seg = unwind.saved_text_seg; + saved_subseg = unwind.saved_text_subseg; + unwind.saved_text_seg = NULL; + } + else + { + saved_seg = now_seg; + saved_subseg = now_subseg; + } + + /* + Use a slightly ugly scheme to derive the unwind section names from + the text section name: + + text sect. unwind table sect. + name: name: comments: + ---------- ----------------- -------------------------------- + .text .IA_64.unwind + .text.foo .IA_64.unwind.text.foo + .foo .IA_64.unwind.foo + _info .IA_64.unwind_info gas issues error message (ditto) + _infoFOO .IA_64.unwind_infoFOO gas issues error message (ditto) + + This mapping is done so that: + + (a) An object file with unwind info only in .text will use + unwind section names .IA_64.unwind and .IA_64.unwind_info. + This follows the letter of the ABI and also ensures backwards + compatibility with older toolchains. + + (b) An object file with unwind info in multiple text sections + will use separate unwind sections for each text section. + This allows us to properly set the "sh_info" and "sh_link" + fields in SHT_IA_64_UNWIND as required by the ABI and also + lets GNU ld support programs with multiple segments + containing unwind info (as might be the case for certain + embedded applications). + + (c) An error is issued if there would be a name clash. + */ + text_name = segment_name (saved_seg); + if (strncmp (text_name, "_info", 5) == 0) + { + as_bad ("Illegal section name `%s' (causes unwind section name clash)", + text_name); + ignore_rest_of_line (); + return; + } + if (strcmp (text_name, ".text") == 0) + text_name = ""; + + expression (&e); + demand_empty_rest_of_line (); + + insn_group_break (1, 0, 0); + + /* If there wasn't a .handlerdata, we haven't generated an image yet. */ + if (!unwind.info) + generate_unwind_image (text_name); + + if (unwind.info || unwind.force_unwind_entry) + { + subseg_set (md.last_text_seg, 0); + unwind.proc_end = expr_build_dot (); + + make_unw_section_name (SPECIAL_SECTION_UNWIND, text_name, sec_name); + set_section ((char *) sec_name); + bfd_set_section_flags (stdoutput, now_seg, + SEC_LOAD | SEC_ALLOC | SEC_READONLY); + + /* Make sure the section has 8 byte alignment. */ + record_alignment (now_seg, 3); + + ptr = frag_more (24); + where = frag_now_fix () - 24; + bytes_per_address = bfd_arch_bits_per_address (stdoutput) / 8; + + /* Issue the values of a) Proc Begin, b) Proc End, c) Unwind Record. */ + e.X_op = O_pseudo_fixup; + e.X_op_symbol = pseudo_func[FUNC_SEG_RELATIVE].u.sym; + e.X_add_number = 0; + e.X_add_symbol = unwind.proc_start; + ia64_cons_fix_new (frag_now, where, bytes_per_address, &e); + + e.X_op = O_pseudo_fixup; + e.X_op_symbol = pseudo_func[FUNC_SEG_RELATIVE].u.sym; + e.X_add_number = 0; + e.X_add_symbol = unwind.proc_end; + ia64_cons_fix_new (frag_now, where + bytes_per_address, + bytes_per_address, &e); + + if (unwind.info) + { + e.X_op = O_pseudo_fixup; + e.X_op_symbol = pseudo_func[FUNC_SEG_RELATIVE].u.sym; + e.X_add_number = 0; + e.X_add_symbol = unwind.info; + ia64_cons_fix_new (frag_now, where + (bytes_per_address * 2), + bytes_per_address, &e); + } + else + md_number_to_chars (ptr + (bytes_per_address * 2), 0, + bytes_per_address); + + } + subseg_set (saved_seg, saved_subseg); + unwind.proc_start = unwind.proc_end = unwind.info = 0; +} + +static void +dot_template (template) + int template; +{ + CURR_SLOT.user_template = template; +} + +static void +dot_regstk (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + int ins, locs, outs, rots; + + if (is_it_end_of_statement ()) + ins = locs = outs = rots = 0; + else + { + ins = get_absolute_expression (); + if (*input_line_pointer++ != ',') + goto err; + locs = get_absolute_expression (); + if (*input_line_pointer++ != ',') + goto err; + outs = get_absolute_expression (); + if (*input_line_pointer++ != ',') + goto err; + rots = get_absolute_expression (); + } + set_regstack (ins, locs, outs, rots); + return; + + err: + as_bad ("Comma expected"); + ignore_rest_of_line (); +} + +static void +dot_rot (type) + int type; +{ + unsigned num_regs, num_alloced = 0; + struct dynreg **drpp, *dr; + int ch, base_reg = 0; + char *name, *start; + size_t len; + + switch (type) + { + case DYNREG_GR: base_reg = REG_GR + 32; break; + case DYNREG_FR: base_reg = REG_FR + 32; break; + case DYNREG_PR: base_reg = REG_P + 16; break; + default: break; + } + + /* First, remove existing names from hash table. */ + for (dr = md.dynreg[type]; dr && dr->num_regs; dr = dr->next) + { + hash_delete (md.dynreg_hash, dr->name); + dr->num_regs = 0; + } + + drpp = &md.dynreg[type]; + while (1) + { + start = input_line_pointer; + ch = get_symbol_end (); + *input_line_pointer = ch; + len = (input_line_pointer - start); + + SKIP_WHITESPACE (); + if (*input_line_pointer != '[') + { + as_bad ("Expected '['"); + goto err; + } + ++input_line_pointer; /* skip '[' */ + + num_regs = get_absolute_expression (); + + if (*input_line_pointer++ != ']') + { + as_bad ("Expected ']'"); + goto err; + } + SKIP_WHITESPACE (); + + num_alloced += num_regs; + switch (type) + { + case DYNREG_GR: + if (num_alloced > md.rot.num_regs) + { + as_bad ("Used more than the declared %d rotating registers", + md.rot.num_regs); + goto err; + } + break; + case DYNREG_FR: + if (num_alloced > 96) + { + as_bad ("Used more than the available 96 rotating registers"); + goto err; + } + break; + case DYNREG_PR: + if (num_alloced > 48) + { + as_bad ("Used more than the available 48 rotating registers"); + goto err; + } + break; + + default: + break; + } + + name = obstack_alloc (¬es, len + 1); + memcpy (name, start, len); + name[len] = '\0'; + + if (!*drpp) + { + *drpp = obstack_alloc (¬es, sizeof (*dr)); + memset (*drpp, 0, sizeof (*dr)); + } + + dr = *drpp; + dr->name = name; + dr->num_regs = num_regs; + dr->base = base_reg; + drpp = &dr->next; + base_reg += num_regs; + + if (hash_insert (md.dynreg_hash, name, dr)) + { + as_bad ("Attempt to redefine register set `%s'", name); + goto err; + } + + if (*input_line_pointer != ',') + break; + ++input_line_pointer; /* skip comma */ + SKIP_WHITESPACE (); + } + demand_empty_rest_of_line (); + return; + + err: + ignore_rest_of_line (); +} + +static void +dot_byteorder (byteorder) + int byteorder; +{ + target_big_endian = byteorder; +} + +static void +dot_psr (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + char *option; + int ch; + + while (1) + { + option = input_line_pointer; + ch = get_symbol_end (); + if (strcmp (option, "lsb") == 0) + md.flags &= ~EF_IA_64_BE; + else if (strcmp (option, "msb") == 0) + md.flags |= EF_IA_64_BE; + else if (strcmp (option, "abi32") == 0) + md.flags &= ~EF_IA_64_ABI64; + else if (strcmp (option, "abi64") == 0) + md.flags |= EF_IA_64_ABI64; + else + as_bad ("Unknown psr option `%s'", option); + *input_line_pointer = ch; + + SKIP_WHITESPACE (); + if (*input_line_pointer != ',') + break; + + ++input_line_pointer; + SKIP_WHITESPACE (); + } + demand_empty_rest_of_line (); +} + +static void +dot_alias (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + as_bad (".alias not implemented yet"); +} + +static void +dot_ln (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + new_logical_line (0, get_absolute_expression ()); + demand_empty_rest_of_line (); +} + +static char * +parse_section_name () +{ + char *name; + int len; + + SKIP_WHITESPACE (); + if (*input_line_pointer != '"') + { + as_bad ("Missing section name"); + ignore_rest_of_line (); + return 0; + } + name = demand_copy_C_string (&len); + if (!name) + { + ignore_rest_of_line (); + return 0; + } + SKIP_WHITESPACE (); + if (*input_line_pointer != ',') + { + as_bad ("Comma expected after section name"); + ignore_rest_of_line (); + return 0; + } + ++input_line_pointer; /* skip comma */ + return name; +} + +static void +dot_xdata (size) + int size; +{ + char *name = parse_section_name (); + if (!name) + return; + + md.keep_pending_output = 1; + set_section (name); + cons (size); + obj_elf_previous (0); + md.keep_pending_output = 0; +} + +/* Why doesn't float_cons() call md_cons_align() the way cons() does? */ + +static void +stmt_float_cons (kind) + int kind; +{ + size_t size; + + switch (kind) + { + case 'd': size = 8; break; + case 'x': size = 10; break; + + case 'f': + default: + size = 4; + break; + } + ia64_do_align (size); + float_cons (kind); +} + +static void +stmt_cons_ua (size) + int size; +{ + int saved_auto_align = md.auto_align; + + md.auto_align = 0; + cons (size); + md.auto_align = saved_auto_align; +} + +static void +dot_xfloat_cons (kind) + int kind; +{ + char *name = parse_section_name (); + if (!name) + return; + + md.keep_pending_output = 1; + set_section (name); + stmt_float_cons (kind); + obj_elf_previous (0); + md.keep_pending_output = 0; +} + +static void +dot_xstringer (zero) + int zero; +{ + char *name = parse_section_name (); + if (!name) + return; + + md.keep_pending_output = 1; + set_section (name); + stringer (zero); + obj_elf_previous (0); + md.keep_pending_output = 0; +} + +static void +dot_xdata_ua (size) + int size; +{ + int saved_auto_align = md.auto_align; + char *name = parse_section_name (); + if (!name) + return; + + md.keep_pending_output = 1; + set_section (name); + md.auto_align = 0; + cons (size); + md.auto_align = saved_auto_align; + obj_elf_previous (0); + md.keep_pending_output = 0; +} + +static void +dot_xfloat_cons_ua (kind) + int kind; +{ + int saved_auto_align = md.auto_align; + char *name = parse_section_name (); + if (!name) + return; + + md.keep_pending_output = 1; + set_section (name); + md.auto_align = 0; + stmt_float_cons (kind); + md.auto_align = saved_auto_align; + obj_elf_previous (0); + md.keep_pending_output = 0; +} + +/* .reg.val <regname>,value */ + +static void +dot_reg_val (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS reg; + + expression (®); + if (reg.X_op != O_register) + { + as_bad (_("Register name expected")); + ignore_rest_of_line (); + } + else if (*input_line_pointer++ != ',') + { + as_bad (_("Comma expected")); + ignore_rest_of_line (); + } + else + { + valueT value = get_absolute_expression (); + int regno = reg.X_add_number; + if (regno < REG_GR || regno > REG_GR + 128) + as_warn (_("Register value annotation ignored")); + else + { + gr_values[regno - REG_GR].known = 1; + gr_values[regno - REG_GR].value = value; + gr_values[regno - REG_GR].path = md.path; + } + } + demand_empty_rest_of_line (); +} + +/* select dv checking mode + .auto + .explicit + .default + + A stop is inserted when changing modes + */ + +static void +dot_dv_mode (type) + int type; +{ + if (md.manual_bundling) + as_warn (_("Directive invalid within a bundle")); + + if (type == 'E' || type == 'A') + md.mode_explicitly_set = 0; + else + md.mode_explicitly_set = 1; + + md.detect_dv = 1; + switch (type) + { + case 'A': + case 'a': + if (md.explicit_mode) + insn_group_break (1, 0, 0); + md.explicit_mode = 0; + break; + case 'E': + case 'e': + if (!md.explicit_mode) + insn_group_break (1, 0, 0); + md.explicit_mode = 1; + break; + default: + case 'd': + if (md.explicit_mode != md.default_explicit_mode) + insn_group_break (1, 0, 0); + md.explicit_mode = md.default_explicit_mode; + md.mode_explicitly_set = 0; + break; + } +} + +static void +print_prmask (mask) + valueT mask; +{ + int regno; + char *comma = ""; + for (regno = 0; regno < 64; regno++) + { + if (mask & ((valueT) 1 << regno)) + { + fprintf (stderr, "%s p%d", comma, regno); + comma = ","; + } + } +} + +/* + .pred.rel.clear [p1 [,p2 [,...]]] (also .pred.rel "clear") + .pred.rel.imply p1, p2 (also .pred.rel "imply") + .pred.rel.mutex p1, p2 [,...] (also .pred.rel "mutex") + .pred.safe_across_calls p1 [, p2 [,...]] + */ + +static void +dot_pred_rel (type) + int type; +{ + valueT mask = 0; + int count = 0; + int p1 = -1, p2 = -1; + + if (type == 0) + { + if (*input_line_pointer != '"') + { + as_bad (_("Missing predicate relation type")); + ignore_rest_of_line (); + return; + } + else + { + int len; + char *form = demand_copy_C_string (&len); + if (strcmp (form, "mutex") == 0) + type = 'm'; + else if (strcmp (form, "clear") == 0) + type = 'c'; + else if (strcmp (form, "imply") == 0) + type = 'i'; + else + { + as_bad (_("Unrecognized predicate relation type")); + ignore_rest_of_line (); + return; + } + } + if (*input_line_pointer == ',') + ++input_line_pointer; + SKIP_WHITESPACE (); + } + + SKIP_WHITESPACE (); + while (1) + { + valueT bit = 1; + int regno; + + if (toupper (*input_line_pointer) != 'P' + || (regno = atoi (++input_line_pointer)) < 0 + || regno > 63) + { + as_bad (_("Predicate register expected")); + ignore_rest_of_line (); + return; + } + while (isdigit (*input_line_pointer)) + ++input_line_pointer; + if (p1 == -1) + p1 = regno; + else if (p2 == -1) + p2 = regno; + bit <<= regno; + if (mask & bit) + as_warn (_("Duplicate predicate register ignored")); + mask |= bit; + count++; + /* See if it's a range. */ + if (*input_line_pointer == '-') + { + valueT stop = 1; + ++input_line_pointer; + + if (toupper (*input_line_pointer) != 'P' + || (regno = atoi (++input_line_pointer)) < 0 + || regno > 63) + { + as_bad (_("Predicate register expected")); + ignore_rest_of_line (); + return; + } + while (isdigit (*input_line_pointer)) + ++input_line_pointer; + stop <<= regno; + if (bit >= stop) + { + as_bad (_("Bad register range")); + ignore_rest_of_line (); + return; + } + while (bit < stop) + { + bit <<= 1; + mask |= bit; + count++; + } + SKIP_WHITESPACE (); + } + if (*input_line_pointer != ',') + break; + ++input_line_pointer; + SKIP_WHITESPACE (); + } + + switch (type) + { + case 'c': + if (count == 0) + mask = ~(valueT) 0; + clear_qp_mutex (mask); + clear_qp_implies (mask, (valueT) 0); + break; + case 'i': + if (count != 2 || p1 == -1 || p2 == -1) + as_bad (_("Predicate source and target required")); + else if (p1 == 0 || p2 == 0) + as_bad (_("Use of p0 is not valid in this context")); + else + add_qp_imply (p1, p2); + break; + case 'm': + if (count < 2) + { + as_bad (_("At least two PR arguments expected")); + break; + } + else if (mask & 1) + { + as_bad (_("Use of p0 is not valid in this context")); + break; + } + add_qp_mutex (mask); + break; + case 's': + /* note that we don't override any existing relations */ + if (count == 0) + { + as_bad (_("At least one PR argument expected")); + break; + } + if (md.debug_dv) + { + fprintf (stderr, "Safe across calls: "); + print_prmask (mask); + fprintf (stderr, "\n"); + } + qp_safe_across_calls = mask; + break; + } + demand_empty_rest_of_line (); +} + +/* .entry label [, label [, ...]] + Hint to DV code that the given labels are to be considered entry points. + Otherwise, only global labels are considered entry points. */ + +static void +dot_entry (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + const char *err; + char *name; + int c; + symbolS *symbolP; + + do + { + name = input_line_pointer; + c = get_symbol_end (); + symbolP = symbol_find_or_make (name); + + err = hash_insert (md.entry_hash, S_GET_NAME (symbolP), (PTR) symbolP); + if (err) + as_fatal (_("Inserting \"%s\" into entry hint table failed: %s"), + name, err); + + *input_line_pointer = c; + SKIP_WHITESPACE (); + c = *input_line_pointer; + if (c == ',') + { + input_line_pointer++; + SKIP_WHITESPACE (); + if (*input_line_pointer == '\n') + c = '\n'; + } + } + while (c == ','); + + demand_empty_rest_of_line (); +} + +/* .mem.offset offset, base + "base" is used to distinguish between offsets from a different base. */ + +static void +dot_mem_offset (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + md.mem_offset.hint = 1; + md.mem_offset.offset = get_absolute_expression (); + if (*input_line_pointer != ',') + { + as_bad (_("Comma expected")); + ignore_rest_of_line (); + return; + } + ++input_line_pointer; + md.mem_offset.base = get_absolute_expression (); + demand_empty_rest_of_line (); +} + +/* ia64-specific pseudo-ops: */ +const pseudo_typeS md_pseudo_table[] = + { + { "radix", dot_radix, 0 }, + { "lcomm", s_lcomm_bytes, 1 }, + { "bss", dot_special_section, SPECIAL_SECTION_BSS }, + { "sbss", dot_special_section, SPECIAL_SECTION_SBSS }, + { "sdata", dot_special_section, SPECIAL_SECTION_SDATA }, + { "rodata", dot_special_section, SPECIAL_SECTION_RODATA }, + { "comment", dot_special_section, SPECIAL_SECTION_COMMENT }, + { "ia_64.unwind", dot_special_section, SPECIAL_SECTION_UNWIND }, + { "ia_64.unwind_info", dot_special_section, SPECIAL_SECTION_UNWIND_INFO }, + { "proc", dot_proc, 0 }, + { "body", dot_body, 0 }, + { "prologue", dot_prologue, 0 }, + { "endp", dot_endp, 0 }, + { "file", dwarf2_directive_file, 0 }, + { "loc", dwarf2_directive_loc, 0 }, + + { "fframe", dot_fframe, 0 }, + { "vframe", dot_vframe, 0 }, + { "vframesp", dot_vframesp, 0 }, + { "vframepsp", dot_vframepsp, 0 }, + { "save", dot_save, 0 }, + { "restore", dot_restore, 0 }, + { "restorereg", dot_restorereg, 0 }, + { "restorereg.p", dot_restorereg_p, 0 }, + { "handlerdata", dot_handlerdata, 0 }, + { "unwentry", dot_unwentry, 0 }, + { "altrp", dot_altrp, 0 }, + { "savesp", dot_savemem, 0 }, + { "savepsp", dot_savemem, 1 }, + { "save.g", dot_saveg, 0 }, + { "save.f", dot_savef, 0 }, + { "save.b", dot_saveb, 0 }, + { "save.gf", dot_savegf, 0 }, + { "spill", dot_spill, 0 }, + { "spillreg", dot_spillreg, 0 }, + { "spillsp", dot_spillmem, 0 }, + { "spillpsp", dot_spillmem, 1 }, + { "spillreg.p", dot_spillreg_p, 0 }, + { "spillsp.p", dot_spillmem_p, 0 }, + { "spillpsp.p", dot_spillmem_p, 1 }, + { "label_state", dot_label_state, 0 }, + { "copy_state", dot_copy_state, 0 }, + { "unwabi", dot_unwabi, 0 }, + { "personality", dot_personality, 0 }, +#if 0 + { "estate", dot_estate, 0 }, +#endif + { "mii", dot_template, 0x0 }, + { "mli", dot_template, 0x2 }, /* old format, for compatibility */ + { "mlx", dot_template, 0x2 }, + { "mmi", dot_template, 0x4 }, + { "mfi", dot_template, 0x6 }, + { "mmf", dot_template, 0x7 }, + { "mib", dot_template, 0x8 }, + { "mbb", dot_template, 0x9 }, + { "bbb", dot_template, 0xb }, + { "mmb", dot_template, 0xc }, + { "mfb", dot_template, 0xe }, +#if 0 + { "lb", dot_scope, 0 }, + { "le", dot_scope, 1 }, +#endif + { "align", s_align_bytes, 0 }, + { "regstk", dot_regstk, 0 }, + { "rotr", dot_rot, DYNREG_GR }, + { "rotf", dot_rot, DYNREG_FR }, + { "rotp", dot_rot, DYNREG_PR }, + { "lsb", dot_byteorder, 0 }, + { "msb", dot_byteorder, 1 }, + { "psr", dot_psr, 0 }, + { "alias", dot_alias, 0 }, + { "ln", dot_ln, 0 }, /* source line info (for debugging) */ + + { "xdata1", dot_xdata, 1 }, + { "xdata2", dot_xdata, 2 }, + { "xdata4", dot_xdata, 4 }, + { "xdata8", dot_xdata, 8 }, + { "xreal4", dot_xfloat_cons, 'f' }, + { "xreal8", dot_xfloat_cons, 'd' }, + { "xreal10", dot_xfloat_cons, 'x' }, + { "xstring", dot_xstringer, 0 }, + { "xstringz", dot_xstringer, 1 }, + + /* unaligned versions: */ + { "xdata2.ua", dot_xdata_ua, 2 }, + { "xdata4.ua", dot_xdata_ua, 4 }, + { "xdata8.ua", dot_xdata_ua, 8 }, + { "xreal4.ua", dot_xfloat_cons_ua, 'f' }, + { "xreal8.ua", dot_xfloat_cons_ua, 'd' }, + { "xreal10.ua", dot_xfloat_cons_ua, 'x' }, + + /* annotations/DV checking support */ + { "entry", dot_entry, 0 }, + { "mem.offset", dot_mem_offset, 0 }, + { "pred.rel", dot_pred_rel, 0 }, + { "pred.rel.clear", dot_pred_rel, 'c' }, + { "pred.rel.imply", dot_pred_rel, 'i' }, + { "pred.rel.mutex", dot_pred_rel, 'm' }, + { "pred.safe_across_calls", dot_pred_rel, 's' }, + { "reg.val", dot_reg_val, 0 }, + { "auto", dot_dv_mode, 'a' }, + { "explicit", dot_dv_mode, 'e' }, + { "default", dot_dv_mode, 'd' }, + + { NULL, 0, 0 } + }; + +static const struct pseudo_opcode + { + const char *name; + void (*handler) (int); + int arg; + } +pseudo_opcode[] = + { + /* these are more like pseudo-ops, but don't start with a dot */ + { "data1", cons, 1 }, + { "data2", cons, 2 }, + { "data4", cons, 4 }, + { "data8", cons, 8 }, + { "real4", stmt_float_cons, 'f' }, + { "real8", stmt_float_cons, 'd' }, + { "real10", stmt_float_cons, 'x' }, + { "string", stringer, 0 }, + { "stringz", stringer, 1 }, + + /* unaligned versions: */ + { "data2.ua", stmt_cons_ua, 2 }, + { "data4.ua", stmt_cons_ua, 4 }, + { "data8.ua", stmt_cons_ua, 8 }, + { "real4.ua", float_cons, 'f' }, + { "real8.ua", float_cons, 'd' }, + { "real10.ua", float_cons, 'x' }, + }; + +/* Declare a register by creating a symbol for it and entering it in + the symbol table. */ + +static symbolS * +declare_register (name, regnum) + const char *name; + int regnum; +{ + const char *err; + symbolS *sym; + + sym = symbol_new (name, reg_section, regnum, &zero_address_frag); + + err = hash_insert (md.reg_hash, S_GET_NAME (sym), (PTR) sym); + if (err) + as_fatal ("Inserting \"%s\" into register table failed: %s", + name, err); + + return sym; +} + +static void +declare_register_set (prefix, num_regs, base_regnum) + const char *prefix; + int num_regs; + int base_regnum; +{ + char name[8]; + int i; + + for (i = 0; i < num_regs; ++i) + { + sprintf (name, "%s%u", prefix, i); + declare_register (name, base_regnum + i); + } +} + +static unsigned int +operand_width (opnd) + enum ia64_opnd opnd; +{ + const struct ia64_operand *odesc = &elf64_ia64_operands[opnd]; + unsigned int bits = 0; + int i; + + bits = 0; + for (i = 0; i < NELEMS (odesc->field) && odesc->field[i].bits; ++i) + bits += odesc->field[i].bits; + + return bits; +} + +static enum operand_match_result +operand_match (idesc, index, e) + const struct ia64_opcode *idesc; + int index; + expressionS *e; +{ + enum ia64_opnd opnd = idesc->operands[index]; + int bits, relocatable = 0; + struct insn_fix *fix; + bfd_signed_vma val; + + switch (opnd) + { + /* constants: */ + + case IA64_OPND_AR_CCV: + if (e->X_op == O_register && e->X_add_number == REG_AR + 32) + return OPERAND_MATCH; + break; + + case IA64_OPND_AR_PFS: + if (e->X_op == O_register && e->X_add_number == REG_AR + 64) + return OPERAND_MATCH; + break; + + case IA64_OPND_GR0: + if (e->X_op == O_register && e->X_add_number == REG_GR + 0) + return OPERAND_MATCH; + break; + + case IA64_OPND_IP: + if (e->X_op == O_register && e->X_add_number == REG_IP) + return OPERAND_MATCH; + break; + + case IA64_OPND_PR: + if (e->X_op == O_register && e->X_add_number == REG_PR) + return OPERAND_MATCH; + break; + + case IA64_OPND_PR_ROT: + if (e->X_op == O_register && e->X_add_number == REG_PR_ROT) + return OPERAND_MATCH; + break; + + case IA64_OPND_PSR: + if (e->X_op == O_register && e->X_add_number == REG_PSR) + return OPERAND_MATCH; + break; + + case IA64_OPND_PSR_L: + if (e->X_op == O_register && e->X_add_number == REG_PSR_L) + return OPERAND_MATCH; + break; + + case IA64_OPND_PSR_UM: + if (e->X_op == O_register && e->X_add_number == REG_PSR_UM) + return OPERAND_MATCH; + break; + + case IA64_OPND_C1: + if (e->X_op == O_constant) + { + if (e->X_add_number == 1) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_C8: + if (e->X_op == O_constant) + { + if (e->X_add_number == 8) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_C16: + if (e->X_op == O_constant) + { + if (e->X_add_number == 16) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + break; + + /* register operands: */ + + case IA64_OPND_AR3: + if (e->X_op == O_register && e->X_add_number >= REG_AR + && e->X_add_number < REG_AR + 128) + return OPERAND_MATCH; + break; + + case IA64_OPND_B1: + case IA64_OPND_B2: + if (e->X_op == O_register && e->X_add_number >= REG_BR + && e->X_add_number < REG_BR + 8) + return OPERAND_MATCH; + break; + + case IA64_OPND_CR3: + if (e->X_op == O_register && e->X_add_number >= REG_CR + && e->X_add_number < REG_CR + 128) + return OPERAND_MATCH; + break; + + case IA64_OPND_F1: + case IA64_OPND_F2: + case IA64_OPND_F3: + case IA64_OPND_F4: + if (e->X_op == O_register && e->X_add_number >= REG_FR + && e->X_add_number < REG_FR + 128) + return OPERAND_MATCH; + break; + + case IA64_OPND_P1: + case IA64_OPND_P2: + if (e->X_op == O_register && e->X_add_number >= REG_P + && e->X_add_number < REG_P + 64) + return OPERAND_MATCH; + break; + + case IA64_OPND_R1: + case IA64_OPND_R2: + case IA64_OPND_R3: + if (e->X_op == O_register && e->X_add_number >= REG_GR + && e->X_add_number < REG_GR + 128) + return OPERAND_MATCH; + break; + + case IA64_OPND_R3_2: + if (e->X_op == O_register && e->X_add_number >= REG_GR) + { + if (e->X_add_number < REG_GR + 4) + return OPERAND_MATCH; + else if (e->X_add_number < REG_GR + 128) + return OPERAND_OUT_OF_RANGE; + } + break; + + /* indirect operands: */ + case IA64_OPND_CPUID_R3: + case IA64_OPND_DBR_R3: + case IA64_OPND_DTR_R3: + case IA64_OPND_ITR_R3: + case IA64_OPND_IBR_R3: + case IA64_OPND_MSR_R3: + case IA64_OPND_PKR_R3: + case IA64_OPND_PMC_R3: + case IA64_OPND_PMD_R3: + case IA64_OPND_RR_R3: + if (e->X_op == O_index && e->X_op_symbol + && (S_GET_VALUE (e->X_op_symbol) - IND_CPUID + == opnd - IA64_OPND_CPUID_R3)) + return OPERAND_MATCH; + break; + + case IA64_OPND_MR3: + if (e->X_op == O_index && !e->X_op_symbol) + return OPERAND_MATCH; + break; + + /* immediate operands: */ + case IA64_OPND_CNT2a: + case IA64_OPND_LEN4: + case IA64_OPND_LEN6: + bits = operand_width (idesc->operands[index]); + if (e->X_op == O_constant) + { + if ((bfd_vma) (e->X_add_number - 1) < ((bfd_vma) 1 << bits)) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_CNT2b: + if (e->X_op == O_constant) + { + if ((bfd_vma) (e->X_add_number - 1) < 3) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_CNT2c: + val = e->X_add_number; + if (e->X_op == O_constant) + { + if ((val == 0 || val == 7 || val == 15 || val == 16)) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_SOR: + /* SOR must be an integer multiple of 8 */ + if (e->X_op == O_constant && e->X_add_number & 0x7) + return OPERAND_OUT_OF_RANGE; + case IA64_OPND_SOF: + case IA64_OPND_SOL: + if (e->X_op == O_constant) + { + if ((bfd_vma) e->X_add_number <= 96) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_IMMU62: + if (e->X_op == O_constant) + { + if ((bfd_vma) e->X_add_number < ((bfd_vma) 1 << 62)) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + else + { + /* FIXME -- need 62-bit relocation type */ + as_bad (_("62-bit relocation not yet implemented")); + } + break; + + case IA64_OPND_IMMU64: + if (e->X_op == O_symbol || e->X_op == O_pseudo_fixup + || e->X_op == O_subtract) + { + fix = CURR_SLOT.fixup + CURR_SLOT.num_fixups; + fix->code = BFD_RELOC_IA64_IMM64; + if (e->X_op != O_subtract) + { + fix->code = ia64_gen_real_reloc_type (e->X_op_symbol, fix->code); + if (e->X_op == O_pseudo_fixup) + e->X_op = O_symbol; + } + + fix->opnd = idesc->operands[index]; + fix->expr = *e; + fix->is_pcrel = 0; + ++CURR_SLOT.num_fixups; + return OPERAND_MATCH; + } + else if (e->X_op == O_constant) + return OPERAND_MATCH; + break; + + case IA64_OPND_CCNT5: + case IA64_OPND_CNT5: + case IA64_OPND_CNT6: + case IA64_OPND_CPOS6a: + case IA64_OPND_CPOS6b: + case IA64_OPND_CPOS6c: + case IA64_OPND_IMMU2: + case IA64_OPND_IMMU7a: + case IA64_OPND_IMMU7b: + case IA64_OPND_IMMU21: + case IA64_OPND_IMMU24: + case IA64_OPND_MBTYPE4: + case IA64_OPND_MHTYPE8: + case IA64_OPND_POS6: + bits = operand_width (idesc->operands[index]); + if (e->X_op == O_constant) + { + if ((bfd_vma) e->X_add_number < ((bfd_vma) 1 << bits)) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_IMMU9: + bits = operand_width (idesc->operands[index]); + if (e->X_op == O_constant) + { + if ((bfd_vma) e->X_add_number < ((bfd_vma) 1 << bits)) + { + int lobits = e->X_add_number & 0x3; + if (((bfd_vma) e->X_add_number & 0x3C) != 0 && lobits == 0) + e->X_add_number |= (bfd_vma) 0x3; + return OPERAND_MATCH; + } + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_IMM44: + /* least 16 bits must be zero */ + if ((e->X_add_number & 0xffff) != 0) + /* XXX technically, this is wrong: we should not be issuing warning + messages until we're sure this instruction pattern is going to + be used! */ + as_warn (_("lower 16 bits of mask ignored")); + + if (e->X_op == O_constant) + { + if (((e->X_add_number >= 0 + && (bfd_vma) e->X_add_number < ((bfd_vma) 1 << 44)) + || (e->X_add_number < 0 + && (bfd_vma) -e->X_add_number <= ((bfd_vma) 1 << 44)))) + { + /* sign-extend */ + if (e->X_add_number >= 0 + && (e->X_add_number & ((bfd_vma) 1 << 43)) != 0) + { + e->X_add_number |= ~(((bfd_vma) 1 << 44) - 1); + } + return OPERAND_MATCH; + } + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_IMM17: + /* bit 0 is a don't care (pr0 is hardwired to 1) */ + if (e->X_op == O_constant) + { + if (((e->X_add_number >= 0 + && (bfd_vma) e->X_add_number < ((bfd_vma) 1 << 17)) + || (e->X_add_number < 0 + && (bfd_vma) -e->X_add_number <= ((bfd_vma) 1 << 17)))) + { + /* sign-extend */ + if (e->X_add_number >= 0 + && (e->X_add_number & ((bfd_vma) 1 << 16)) != 0) + { + e->X_add_number |= ~(((bfd_vma) 1 << 17) - 1); + } + return OPERAND_MATCH; + } + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_IMM14: + case IA64_OPND_IMM22: + relocatable = 1; + case IA64_OPND_IMM1: + case IA64_OPND_IMM8: + case IA64_OPND_IMM8U4: + case IA64_OPND_IMM8M1: + case IA64_OPND_IMM8M1U4: + case IA64_OPND_IMM8M1U8: + case IA64_OPND_IMM9a: + case IA64_OPND_IMM9b: + bits = operand_width (idesc->operands[index]); + if (relocatable && (e->X_op == O_symbol + || e->X_op == O_subtract + || e->X_op == O_pseudo_fixup)) + { + fix = CURR_SLOT.fixup + CURR_SLOT.num_fixups; + + if (idesc->operands[index] == IA64_OPND_IMM14) + fix->code = BFD_RELOC_IA64_IMM14; + else + fix->code = BFD_RELOC_IA64_IMM22; + + if (e->X_op != O_subtract) + { + fix->code = ia64_gen_real_reloc_type (e->X_op_symbol, fix->code); + if (e->X_op == O_pseudo_fixup) + e->X_op = O_symbol; + } + + fix->opnd = idesc->operands[index]; + fix->expr = *e; + fix->is_pcrel = 0; + ++CURR_SLOT.num_fixups; + return OPERAND_MATCH; + } + else if (e->X_op != O_constant + && ! (e->X_op == O_big && opnd == IA64_OPND_IMM8M1U8)) + return OPERAND_MISMATCH; + + if (opnd == IA64_OPND_IMM8M1U4) + { + /* Zero is not valid for unsigned compares that take an adjusted + constant immediate range. */ + if (e->X_add_number == 0) + return OPERAND_OUT_OF_RANGE; + + /* Sign-extend 32-bit unsigned numbers, so that the following range + checks will work. */ + val = e->X_add_number; + if (((val & (~(bfd_vma) 0 << 32)) == 0) + && ((val & ((bfd_vma) 1 << 31)) != 0)) + val = ((val << 32) >> 32); + + /* Check for 0x100000000. This is valid because + 0x100000000-1 is the same as ((uint32_t) -1). */ + if (val == ((bfd_signed_vma) 1 << 32)) + return OPERAND_MATCH; + + val = val - 1; + } + else if (opnd == IA64_OPND_IMM8M1U8) + { + /* Zero is not valid for unsigned compares that take an adjusted + constant immediate range. */ + if (e->X_add_number == 0) + return OPERAND_OUT_OF_RANGE; + + /* Check for 0x10000000000000000. */ + if (e->X_op == O_big) + { + if (generic_bignum[0] == 0 + && generic_bignum[1] == 0 + && generic_bignum[2] == 0 + && generic_bignum[3] == 0 + && generic_bignum[4] == 1) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + else + val = e->X_add_number - 1; + } + else if (opnd == IA64_OPND_IMM8M1) + val = e->X_add_number - 1; + else if (opnd == IA64_OPND_IMM8U4) + { + /* Sign-extend 32-bit unsigned numbers, so that the following range + checks will work. */ + val = e->X_add_number; + if (((val & (~(bfd_vma) 0 << 32)) == 0) + && ((val & ((bfd_vma) 1 << 31)) != 0)) + val = ((val << 32) >> 32); + } + else + val = e->X_add_number; + + if ((val >= 0 && (bfd_vma) val < ((bfd_vma) 1 << (bits - 1))) + || (val < 0 && (bfd_vma) -val <= ((bfd_vma) 1 << (bits - 1)))) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + + case IA64_OPND_INC3: + /* +/- 1, 4, 8, 16 */ + val = e->X_add_number; + if (val < 0) + val = -val; + if (e->X_op == O_constant) + { + if ((val == 1 || val == 4 || val == 8 || val == 16)) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_TGT25: + case IA64_OPND_TGT25b: + case IA64_OPND_TGT25c: + case IA64_OPND_TGT64: + if (e->X_op == O_symbol) + { + fix = CURR_SLOT.fixup + CURR_SLOT.num_fixups; + if (opnd == IA64_OPND_TGT25) + fix->code = BFD_RELOC_IA64_PCREL21F; + else if (opnd == IA64_OPND_TGT25b) + fix->code = BFD_RELOC_IA64_PCREL21M; + else if (opnd == IA64_OPND_TGT25c) + fix->code = BFD_RELOC_IA64_PCREL21B; + else if (opnd == IA64_OPND_TGT64) + fix->code = BFD_RELOC_IA64_PCREL60B; + else + abort (); + + fix->code = ia64_gen_real_reloc_type (e->X_op_symbol, fix->code); + fix->opnd = idesc->operands[index]; + fix->expr = *e; + fix->is_pcrel = 1; + ++CURR_SLOT.num_fixups; + return OPERAND_MATCH; + } + case IA64_OPND_TAG13: + case IA64_OPND_TAG13b: + switch (e->X_op) + { + case O_constant: + return OPERAND_MATCH; + + case O_symbol: + fix = CURR_SLOT.fixup + CURR_SLOT.num_fixups; + fix->code = ia64_gen_real_reloc_type (e->X_op_symbol, 0); + fix->opnd = idesc->operands[index]; + fix->expr = *e; + fix->is_pcrel = 1; + ++CURR_SLOT.num_fixups; + return OPERAND_MATCH; + + default: + break; + } + break; + + default: + break; + } + return OPERAND_MISMATCH; +} + +static int +parse_operand (e) + expressionS *e; +{ + int sep = '\0'; + + memset (e, 0, sizeof (*e)); + e->X_op = O_absent; + SKIP_WHITESPACE (); + if (*input_line_pointer != '}') + expression (e); + sep = *input_line_pointer++; + + if (sep == '}') + { + if (!md.manual_bundling) + as_warn ("Found '}' when manual bundling is off"); + else + CURR_SLOT.manual_bundling_off = 1; + md.manual_bundling = 0; + sep = '\0'; + } + return sep; +} + +/* Returns the next entry in the opcode table that matches the one in + IDESC, and frees the entry in IDESC. If no matching entry is + found, NULL is returned instead. */ + +static struct ia64_opcode * +get_next_opcode (struct ia64_opcode *idesc) +{ + struct ia64_opcode *next = ia64_find_next_opcode (idesc); + ia64_free_opcode (idesc); + return next; +} + +/* Parse the operands for the opcode and find the opcode variant that + matches the specified operands, or NULL if no match is possible. */ + +static struct ia64_opcode * +parse_operands (idesc) + struct ia64_opcode *idesc; +{ + int i = 0, highest_unmatched_operand, num_operands = 0, num_outputs = 0; + int error_pos, out_of_range_pos, curr_out_of_range_pos, sep = 0; + enum ia64_opnd expected_operand = IA64_OPND_NIL; + enum operand_match_result result; + char mnemonic[129]; + char *first_arg = 0, *end, *saved_input_pointer; + unsigned int sof; + + assert (strlen (idesc->name) <= 128); + + strcpy (mnemonic, idesc->name); + if (idesc->operands[2] == IA64_OPND_SOF) + { + /* To make the common idiom "alloc loc?=ar.pfs,0,1,0,0" work, we + can't parse the first operand until we have parsed the + remaining operands of the "alloc" instruction. */ + SKIP_WHITESPACE (); + first_arg = input_line_pointer; + end = strchr (input_line_pointer, '='); + if (!end) + { + as_bad ("Expected separator `='"); + return 0; + } + input_line_pointer = end + 1; + ++i; + ++num_outputs; + } + + for (; i < NELEMS (CURR_SLOT.opnd); ++i) + { + sep = parse_operand (CURR_SLOT.opnd + i); + if (CURR_SLOT.opnd[i].X_op == O_absent) + break; + + ++num_operands; + + if (sep != '=' && sep != ',') + break; + + if (sep == '=') + { + if (num_outputs > 0) + as_bad ("Duplicate equal sign (=) in instruction"); + else + num_outputs = i + 1; + } + } + if (sep != '\0') + { + as_bad ("Illegal operand separator `%c'", sep); + return 0; + } + + if (idesc->operands[2] == IA64_OPND_SOF) + { + /* map alloc r1=ar.pfs,i,l,o,r to alloc r1=ar.pfs,(i+l+o),(i+l),r */ + know (strcmp (idesc->name, "alloc") == 0); + if (num_operands == 5 /* first_arg not included in this count! */ + && CURR_SLOT.opnd[2].X_op == O_constant + && CURR_SLOT.opnd[3].X_op == O_constant + && CURR_SLOT.opnd[4].X_op == O_constant + && CURR_SLOT.opnd[5].X_op == O_constant) + { + sof = set_regstack (CURR_SLOT.opnd[2].X_add_number, + CURR_SLOT.opnd[3].X_add_number, + CURR_SLOT.opnd[4].X_add_number, + CURR_SLOT.opnd[5].X_add_number); + + /* now we can parse the first arg: */ + saved_input_pointer = input_line_pointer; + input_line_pointer = first_arg; + sep = parse_operand (CURR_SLOT.opnd + 0); + if (sep != '=') + --num_outputs; /* force error */ + input_line_pointer = saved_input_pointer; + + CURR_SLOT.opnd[2].X_add_number = sof; + CURR_SLOT.opnd[3].X_add_number + = sof - CURR_SLOT.opnd[4].X_add_number; + CURR_SLOT.opnd[4] = CURR_SLOT.opnd[5]; + } + } + + highest_unmatched_operand = 0; + curr_out_of_range_pos = -1; + error_pos = 0; + expected_operand = idesc->operands[0]; + for (; idesc; idesc = get_next_opcode (idesc)) + { + if (num_outputs != idesc->num_outputs) + continue; /* mismatch in # of outputs */ + + CURR_SLOT.num_fixups = 0; + + /* Try to match all operands. If we see an out-of-range operand, + then continue trying to match the rest of the operands, since if + the rest match, then this idesc will give the best error message. */ + + out_of_range_pos = -1; + for (i = 0; i < num_operands && idesc->operands[i]; ++i) + { + result = operand_match (idesc, i, CURR_SLOT.opnd + i); + if (result != OPERAND_MATCH) + { + if (result != OPERAND_OUT_OF_RANGE) + break; + if (out_of_range_pos < 0) + /* remember position of the first out-of-range operand: */ + out_of_range_pos = i; + } + } + + /* If we did not match all operands, or if at least one operand was + out-of-range, then this idesc does not match. Keep track of which + idesc matched the most operands before failing. If we have two + idescs that failed at the same position, and one had an out-of-range + operand, then prefer the out-of-range operand. Thus if we have + "add r0=0x1000000,r1" we get an error saying the constant is out + of range instead of an error saying that the constant should have been + a register. */ + + if (i != num_operands || out_of_range_pos >= 0) + { + if (i > highest_unmatched_operand + || (i == highest_unmatched_operand + && out_of_range_pos > curr_out_of_range_pos)) + { + highest_unmatched_operand = i; + if (out_of_range_pos >= 0) + { + expected_operand = idesc->operands[out_of_range_pos]; + error_pos = out_of_range_pos; + } + else + { + expected_operand = idesc->operands[i]; + error_pos = i; + } + curr_out_of_range_pos = out_of_range_pos; + } + continue; + } + + if (num_operands < NELEMS (idesc->operands) + && idesc->operands[num_operands]) + continue; /* mismatch in number of arguments */ + + break; + } + if (!idesc) + { + if (expected_operand) + as_bad ("Operand %u of `%s' should be %s", + error_pos + 1, mnemonic, + elf64_ia64_operands[expected_operand].desc); + else + as_bad ("Operand mismatch"); + return 0; + } + return idesc; +} + +/* Keep track of state necessary to determine whether a NOP is necessary + to avoid an erratum in A and B step Itanium chips, and return 1 if we + detect a case where additional NOPs may be necessary. */ +static int +errata_nop_necessary_p (slot, insn_unit) + struct slot *slot; + enum ia64_unit insn_unit; +{ + int i; + struct group *this_group = md.last_groups + md.group_idx; + struct group *prev_group = md.last_groups + (md.group_idx + 2) % 3; + struct ia64_opcode *idesc = slot->idesc; + + /* Test whether this could be the first insn in a problematic sequence. */ + if (insn_unit == IA64_UNIT_F) + { + for (i = 0; i < idesc->num_outputs; i++) + if (idesc->operands[i] == IA64_OPND_P1 + || idesc->operands[i] == IA64_OPND_P2) + { + int regno = slot->opnd[i].X_add_number - REG_P; + /* Ignore invalid operands; they generate errors elsewhere. */ + if (regno >= 64) + return 0; + this_group->p_reg_set[regno] = 1; + } + } + + /* Test whether this could be the second insn in a problematic sequence. */ + if (insn_unit == IA64_UNIT_M && slot->qp_regno > 0 + && prev_group->p_reg_set[slot->qp_regno]) + { + for (i = 0; i < idesc->num_outputs; i++) + if (idesc->operands[i] == IA64_OPND_R1 + || idesc->operands[i] == IA64_OPND_R2 + || idesc->operands[i] == IA64_OPND_R3) + { + int regno = slot->opnd[i].X_add_number - REG_GR; + /* Ignore invalid operands; they generate errors elsewhere. */ + if (regno >= 128) + return 0; + if (strncmp (idesc->name, "add", 3) != 0 + && strncmp (idesc->name, "sub", 3) != 0 + && strncmp (idesc->name, "shladd", 6) != 0 + && (idesc->flags & IA64_OPCODE_POSTINC) == 0) + this_group->g_reg_set_conditionally[regno] = 1; + } + } + + /* Test whether this could be the third insn in a problematic sequence. */ + for (i = 0; i < NELEMS (idesc->operands) && idesc->operands[i]; i++) + { + if (/* For fc, ptc, ptr, tak, thash, tpa, ttag, probe, ptr, ptc. */ + idesc->operands[i] == IA64_OPND_R3 + /* For mov indirect. */ + || idesc->operands[i] == IA64_OPND_RR_R3 + || idesc->operands[i] == IA64_OPND_DBR_R3 + || idesc->operands[i] == IA64_OPND_IBR_R3 + || idesc->operands[i] == IA64_OPND_PKR_R3 + || idesc->operands[i] == IA64_OPND_PMC_R3 + || idesc->operands[i] == IA64_OPND_PMD_R3 + || idesc->operands[i] == IA64_OPND_MSR_R3 + || idesc->operands[i] == IA64_OPND_CPUID_R3 + /* For itr. */ + || idesc->operands[i] == IA64_OPND_ITR_R3 + || idesc->operands[i] == IA64_OPND_DTR_R3 + /* Normal memory addresses (load, store, xchg, cmpxchg, etc.). */ + || idesc->operands[i] == IA64_OPND_MR3) + { + int regno = slot->opnd[i].X_add_number - REG_GR; + /* Ignore invalid operands; they generate errors elsewhere. */ + if (regno >= 128) + return 0; + if (idesc->operands[i] == IA64_OPND_R3) + { + if (strcmp (idesc->name, "fc") != 0 + && strcmp (idesc->name, "tak") != 0 + && strcmp (idesc->name, "thash") != 0 + && strcmp (idesc->name, "tpa") != 0 + && strcmp (idesc->name, "ttag") != 0 + && strncmp (idesc->name, "ptr", 3) != 0 + && strncmp (idesc->name, "ptc", 3) != 0 + && strncmp (idesc->name, "probe", 5) != 0) + return 0; + } + if (prev_group->g_reg_set_conditionally[regno]) + return 1; + } + } + return 0; +} + +static void +build_insn (slot, insnp) + struct slot *slot; + bfd_vma *insnp; +{ + const struct ia64_operand *odesc, *o2desc; + struct ia64_opcode *idesc = slot->idesc; + bfd_signed_vma insn, val; + const char *err; + int i; + + insn = idesc->opcode | slot->qp_regno; + + for (i = 0; i < NELEMS (idesc->operands) && idesc->operands[i]; ++i) + { + if (slot->opnd[i].X_op == O_register + || slot->opnd[i].X_op == O_constant + || slot->opnd[i].X_op == O_index) + val = slot->opnd[i].X_add_number; + else if (slot->opnd[i].X_op == O_big) + { + /* This must be the value 0x10000000000000000. */ + assert (idesc->operands[i] == IA64_OPND_IMM8M1U8); + val = 0; + } + else + val = 0; + + switch (idesc->operands[i]) + { + case IA64_OPND_IMMU64: + *insnp++ = (val >> 22) & 0x1ffffffffffLL; + insn |= (((val & 0x7f) << 13) | (((val >> 7) & 0x1ff) << 27) + | (((val >> 16) & 0x1f) << 22) | (((val >> 21) & 0x1) << 21) + | (((val >> 63) & 0x1) << 36)); + continue; + + case IA64_OPND_IMMU62: + val &= 0x3fffffffffffffffULL; + if (val != slot->opnd[i].X_add_number) + as_warn (_("Value truncated to 62 bits")); + *insnp++ = (val >> 21) & 0x1ffffffffffLL; + insn |= (((val & 0xfffff) << 6) | (((val >> 20) & 0x1) << 36)); + continue; + + case IA64_OPND_TGT64: + val >>= 4; + *insnp++ = ((val >> 20) & 0x7fffffffffLL) << 2; + insn |= ((((val >> 59) & 0x1) << 36) + | (((val >> 0) & 0xfffff) << 13)); + continue; + + case IA64_OPND_AR3: + val -= REG_AR; + break; + + case IA64_OPND_B1: + case IA64_OPND_B2: + val -= REG_BR; + break; + + case IA64_OPND_CR3: + val -= REG_CR; + break; + + case IA64_OPND_F1: + case IA64_OPND_F2: + case IA64_OPND_F3: + case IA64_OPND_F4: + val -= REG_FR; + break; + + case IA64_OPND_P1: + case IA64_OPND_P2: + val -= REG_P; + break; + + case IA64_OPND_R1: + case IA64_OPND_R2: + case IA64_OPND_R3: + case IA64_OPND_R3_2: + case IA64_OPND_CPUID_R3: + case IA64_OPND_DBR_R3: + case IA64_OPND_DTR_R3: + case IA64_OPND_ITR_R3: + case IA64_OPND_IBR_R3: + case IA64_OPND_MR3: + case IA64_OPND_MSR_R3: + case IA64_OPND_PKR_R3: + case IA64_OPND_PMC_R3: + case IA64_OPND_PMD_R3: + case IA64_OPND_RR_R3: + val -= REG_GR; + break; + + default: + break; + } + + odesc = elf64_ia64_operands + idesc->operands[i]; + err = (*odesc->insert) (odesc, val, &insn); + if (err) + as_bad_where (slot->src_file, slot->src_line, + "Bad operand value: %s", err); + if (idesc->flags & IA64_OPCODE_PSEUDO) + { + if ((idesc->flags & IA64_OPCODE_F2_EQ_F3) + && odesc == elf64_ia64_operands + IA64_OPND_F3) + { + o2desc = elf64_ia64_operands + IA64_OPND_F2; + (*o2desc->insert) (o2desc, val, &insn); + } + if ((idesc->flags & IA64_OPCODE_LEN_EQ_64MCNT) + && (odesc == elf64_ia64_operands + IA64_OPND_CPOS6a + || odesc == elf64_ia64_operands + IA64_OPND_POS6)) + { + o2desc = elf64_ia64_operands + IA64_OPND_LEN6; + (*o2desc->insert) (o2desc, 64 - val, &insn); + } + } + } + *insnp = insn; +} + +static void +emit_one_bundle () +{ + unsigned int manual_bundling_on = 0, manual_bundling_off = 0; + unsigned int manual_bundling = 0; + enum ia64_unit required_unit, insn_unit = 0; + enum ia64_insn_type type[3], insn_type; + unsigned int template, orig_template; + bfd_vma insn[3] = { -1, -1, -1 }; + struct ia64_opcode *idesc; + int end_of_insn_group = 0, user_template = -1; + int n, i, j, first, curr; + unw_rec_list *ptr; + bfd_vma t0 = 0, t1 = 0; + struct label_fix *lfix; + struct insn_fix *ifix; + char mnemonic[16]; + fixS *fix; + char *f; + + first = (md.curr_slot + NUM_SLOTS - md.num_slots_in_use) % NUM_SLOTS; + know (first >= 0 & first < NUM_SLOTS); + n = MIN (3, md.num_slots_in_use); + + /* Determine template: user user_template if specified, best match + otherwise: */ + + if (md.slot[first].user_template >= 0) + user_template = template = md.slot[first].user_template; + else + { + /* Auto select appropriate template. */ + memset (type, 0, sizeof (type)); + curr = first; + for (i = 0; i < n; ++i) + { + if (md.slot[curr].label_fixups && i != 0) + break; + type[i] = md.slot[curr].idesc->type; + curr = (curr + 1) % NUM_SLOTS; + } + template = best_template[type[0]][type[1]][type[2]]; + } + + /* initialize instructions with appropriate nops: */ + for (i = 0; i < 3; ++i) + insn[i] = nop[ia64_templ_desc[template].exec_unit[i]]; + + f = frag_more (16); + + /* now fill in slots with as many insns as possible: */ + curr = first; + idesc = md.slot[curr].idesc; + end_of_insn_group = 0; + for (i = 0; i < 3 && md.num_slots_in_use > 0; ++i) + { + /* Set the slot number for prologue/body records now as those + refer to the current point, not the point after the + instruction has been issued: */ + /* Don't try to delete prologue/body records here, as that will cause + them to also be deleted from the master list of unwind records. */ + for (ptr = md.slot[curr].unwind_record; ptr; ptr = ptr->next) + if (ptr->r.type == prologue || ptr->r.type == prologue_gr + || ptr->r.type == body) + { + ptr->slot_number = (unsigned long) f + i; + ptr->slot_frag = frag_now; + } + + if (idesc->flags & IA64_OPCODE_SLOT2) + { + if (manual_bundling && i != 2) + as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line, + "`%s' must be last in bundle", idesc->name); + else + i = 2; + } + if (idesc->flags & IA64_OPCODE_LAST) + { + int required_slot; + unsigned int required_template; + + /* If we need a stop bit after an M slot, our only choice is + template 5 (M;;MI). If we need a stop bit after a B + slot, our only choice is to place it at the end of the + bundle, because the only available templates are MIB, + MBB, BBB, MMB, and MFB. We don't handle anything other + than M and B slots because these are the only kind of + instructions that can have the IA64_OPCODE_LAST bit set. */ + required_template = template; + switch (idesc->type) + { + case IA64_TYPE_M: + required_slot = 0; + required_template = 5; + break; + + case IA64_TYPE_B: + required_slot = 2; + break; + + default: + as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line, + "Internal error: don't know how to force %s to end" + "of instruction group", idesc->name); + required_slot = i; + break; + } + if (manual_bundling && i != required_slot) + as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line, + "`%s' must be last in instruction group", + idesc->name); + if (required_slot < i) + /* Can't fit this instruction. */ + break; + + i = required_slot; + if (required_template != template) + { + /* If we switch the template, we need to reset the NOPs + after slot i. The slot-types of the instructions ahead + of i never change, so we don't need to worry about + changing NOPs in front of this slot. */ + for (j = i; j < 3; ++j) + insn[j] = nop[ia64_templ_desc[required_template].exec_unit[j]]; + } + template = required_template; + } + if (curr != first && md.slot[curr].label_fixups) + { + if (manual_bundling_on) + as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line, + "Label must be first in a bundle"); + /* This insn must go into the first slot of a bundle. */ + break; + } + + manual_bundling_on = md.slot[curr].manual_bundling_on; + manual_bundling_off = md.slot[curr].manual_bundling_off; + + if (manual_bundling_on) + { + if (curr == first) + manual_bundling = 1; + else + break; /* need to start a new bundle */ + } + + if (end_of_insn_group && md.num_slots_in_use >= 1) + { + /* We need an instruction group boundary in the middle of a + bundle. See if we can switch to an other template with + an appropriate boundary. */ + + orig_template = template; + if (i == 1 && (user_template == 4 + || (user_template < 0 + && (ia64_templ_desc[template].exec_unit[0] + == IA64_UNIT_M)))) + { + template = 5; + end_of_insn_group = 0; + } + else if (i == 2 && (user_template == 0 + || (user_template < 0 + && (ia64_templ_desc[template].exec_unit[1] + == IA64_UNIT_I))) + /* This test makes sure we don't switch the template if + the next instruction is one that needs to be first in + an instruction group. Since all those instructions are + in the M group, there is no way such an instruction can + fit in this bundle even if we switch the template. The + reason we have to check for this is that otherwise we + may end up generating "MI;;I M.." which has the deadly + effect that the second M instruction is no longer the + first in the bundle! --davidm 99/12/16 */ + && (idesc->flags & IA64_OPCODE_FIRST) == 0) + { + template = 1; + end_of_insn_group = 0; + } + else if (curr != first) + /* can't fit this insn */ + break; + + if (template != orig_template) + /* if we switch the template, we need to reset the NOPs + after slot i. The slot-types of the instructions ahead + of i never change, so we don't need to worry about + changing NOPs in front of this slot. */ + for (j = i; j < 3; ++j) + insn[j] = nop[ia64_templ_desc[template].exec_unit[j]]; + } + required_unit = ia64_templ_desc[template].exec_unit[i]; + + /* resolve dynamic opcodes such as "break" and "nop": */ + if (idesc->type == IA64_TYPE_DYN) + { + if ((strcmp (idesc->name, "nop") == 0) + || (strcmp (idesc->name, "break") == 0)) + insn_unit = required_unit; + else if (strcmp (idesc->name, "chk.s") == 0) + { + insn_unit = IA64_UNIT_M; + if (required_unit == IA64_UNIT_I) + insn_unit = IA64_UNIT_I; + } + else + as_fatal ("emit_one_bundle: unexpected dynamic op"); + + sprintf (mnemonic, "%s.%c", idesc->name, "?imbf??"[insn_unit]); + ia64_free_opcode (idesc); + md.slot[curr].idesc = idesc = ia64_find_opcode (mnemonic); +#if 0 + know (!idesc->next); /* no resolved dynamic ops have collisions */ +#endif + } + else + { + insn_type = idesc->type; + insn_unit = IA64_UNIT_NIL; + switch (insn_type) + { + case IA64_TYPE_A: + if (required_unit == IA64_UNIT_I || required_unit == IA64_UNIT_M) + insn_unit = required_unit; + break; + case IA64_TYPE_X: insn_unit = IA64_UNIT_L; break; + case IA64_TYPE_I: insn_unit = IA64_UNIT_I; break; + case IA64_TYPE_M: insn_unit = IA64_UNIT_M; break; + case IA64_TYPE_B: insn_unit = IA64_UNIT_B; break; + case IA64_TYPE_F: insn_unit = IA64_UNIT_F; break; + default: break; + } + } + + if (insn_unit != required_unit) + { + if (required_unit == IA64_UNIT_L + && insn_unit == IA64_UNIT_I + && !(idesc->flags & IA64_OPCODE_X_IN_MLX)) + { + /* we got ourselves an MLX template but the current + instruction isn't an X-unit, or an I-unit instruction + that can go into the X slot of an MLX template. Duh. */ + if (md.num_slots_in_use >= NUM_SLOTS) + { + as_bad_where (md.slot[curr].src_file, + md.slot[curr].src_line, + "`%s' can't go in X slot of " + "MLX template", idesc->name); + /* drop this insn so we don't livelock: */ + --md.num_slots_in_use; + } + break; + } + continue; /* try next slot */ + } + + { + bfd_vma addr; + + addr = frag_now->fr_address + frag_now_fix () - 16 + i; + dwarf2_gen_line_info (addr, &md.slot[curr].debug_line); + } + + if (errata_nop_necessary_p (md.slot + curr, insn_unit)) + as_warn (_("Additional NOP may be necessary to workaround Itanium processor A/B step errata")); + + build_insn (md.slot + curr, insn + i); + + /* Set slot counts for non prologue/body unwind records. */ + for (ptr = md.slot[curr].unwind_record; ptr; ptr = ptr->next) + if (ptr->r.type != prologue && ptr->r.type != prologue_gr + && ptr->r.type != body) + { + ptr->slot_number = (unsigned long) f + i; + ptr->slot_frag = frag_now; + } + md.slot[curr].unwind_record = NULL; + + if (required_unit == IA64_UNIT_L) + { + know (i == 1); + /* skip one slot for long/X-unit instructions */ + ++i; + } + --md.num_slots_in_use; + + /* now is a good time to fix up the labels for this insn: */ + for (lfix = md.slot[curr].label_fixups; lfix; lfix = lfix->next) + { + S_SET_VALUE (lfix->sym, frag_now_fix () - 16); + symbol_set_frag (lfix->sym, frag_now); + } + /* and fix up the tags also. */ + for (lfix = md.slot[curr].tag_fixups; lfix; lfix = lfix->next) + { + S_SET_VALUE (lfix->sym, frag_now_fix () - 16 + i); + symbol_set_frag (lfix->sym, frag_now); + } + + for (j = 0; j < md.slot[curr].num_fixups; ++j) + { + ifix = md.slot[curr].fixup + j; + fix = fix_new_exp (frag_now, frag_now_fix () - 16 + i, 8, + &ifix->expr, ifix->is_pcrel, ifix->code); + fix->tc_fix_data.opnd = ifix->opnd; + fix->fx_plt = (fix->fx_r_type == BFD_RELOC_IA64_PLTOFF22); + fix->fx_file = md.slot[curr].src_file; + fix->fx_line = md.slot[curr].src_line; + } + + end_of_insn_group = md.slot[curr].end_of_insn_group; + + if (end_of_insn_group) + { + md.group_idx = (md.group_idx + 1) % 3; + memset (md.last_groups + md.group_idx, 0, sizeof md.last_groups[0]); + } + + /* clear slot: */ + ia64_free_opcode (md.slot[curr].idesc); + memset (md.slot + curr, 0, sizeof (md.slot[curr])); + md.slot[curr].user_template = -1; + + if (manual_bundling_off) + { + manual_bundling = 0; + break; + } + curr = (curr + 1) % NUM_SLOTS; + idesc = md.slot[curr].idesc; + } + if (manual_bundling) + { + if (md.num_slots_in_use > 0) + as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line, + "`%s' does not fit into %s template", + idesc->name, ia64_templ_desc[template].name); + else + as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line, + "Missing '}' at end of file"); + } + know (md.num_slots_in_use < NUM_SLOTS); + + t0 = end_of_insn_group | (template << 1) | (insn[0] << 5) | (insn[1] << 46); + t1 = ((insn[1] >> 18) & 0x7fffff) | (insn[2] << 23); + + number_to_chars_littleendian (f + 0, t0, 8); + number_to_chars_littleendian (f + 8, t1, 8); + + unwind.next_slot_number = (unsigned long) f + 16; + unwind.next_slot_frag = frag_now; +} + +int +md_parse_option (c, arg) + int c; + char *arg; +{ + switch (c) + { + /* Switches from the Intel assembler. */ + case 'm': + if (strcmp (arg, "ilp64") == 0 + || strcmp (arg, "lp64") == 0 + || strcmp (arg, "p64") == 0) + { + md.flags |= EF_IA_64_ABI64; + } + else if (strcmp (arg, "ilp32") == 0) + { + md.flags &= ~EF_IA_64_ABI64; + } + else if (strcmp (arg, "le") == 0) + { + md.flags &= ~EF_IA_64_BE; + } + else if (strcmp (arg, "be") == 0) + { + md.flags |= EF_IA_64_BE; + } + else + return 0; + break; + + case 'N': + if (strcmp (arg, "so") == 0) + { + /* Suppress signon message. */ + } + else if (strcmp (arg, "pi") == 0) + { + /* Reject privileged instructions. FIXME */ + } + else if (strcmp (arg, "us") == 0) + { + /* Allow union of signed and unsigned range. FIXME */ + } + else if (strcmp (arg, "close_fcalls") == 0) + { + /* Do not resolve global function calls. */ + } + else + return 0; + break; + + case 'C': + /* temp[="prefix"] Insert temporary labels into the object file + symbol table prefixed by "prefix". + Default prefix is ":temp:". + */ + break; + + case 'a': + /* indirect=<tgt> Assume unannotated indirect branches behavior + according to <tgt> -- + exit: branch out from the current context (default) + labels: all labels in context may be branch targets + */ + if (strncmp (arg, "indirect=", 9) != 0) + return 0; + break; + + case 'x': + /* -X conflicts with an ignored option, use -x instead */ + md.detect_dv = 1; + if (!arg || strcmp (arg, "explicit") == 0) + { + /* set default mode to explicit */ + md.default_explicit_mode = 1; + break; + } + else if (strcmp (arg, "auto") == 0) + { + md.default_explicit_mode = 0; + } + else if (strcmp (arg, "debug") == 0) + { + md.debug_dv = 1; + } + else if (strcmp (arg, "debugx") == 0) + { + md.default_explicit_mode = 1; + md.debug_dv = 1; + } + else + { + as_bad (_("Unrecognized option '-x%s'"), arg); + } + break; + + case 'S': + /* nops Print nops statistics. */ + break; + + /* GNU specific switches for gcc. */ + case OPTION_MCONSTANT_GP: + md.flags |= EF_IA_64_CONS_GP; + break; + + case OPTION_MAUTO_PIC: + md.flags |= EF_IA_64_NOFUNCDESC_CONS_GP; + break; + + default: + return 0; + } + + return 1; +} + +void +md_show_usage (stream) + FILE *stream; +{ + fputs (_("\ +IA-64 options:\n\ + -milp32|-milp64|-mlp64|-mp64 select data model (default -mlp64)\n\ + -mle | -mbe select little- or big-endian byte order (default -mle)\n\ + -x | -xexplicit turn on dependency violation checking (default)\n\ + -xauto automagically remove dependency violations\n\ + -xdebug debug dependency violation checker\n"), + stream); +} + +/* Return true if TYPE fits in TEMPL at SLOT. */ + +static int +match (int templ, int type, int slot) +{ + enum ia64_unit unit; + int result; + + unit = ia64_templ_desc[templ].exec_unit[slot]; + switch (type) + { + case IA64_TYPE_DYN: result = 1; break; /* for nop and break */ + case IA64_TYPE_A: + result = (unit == IA64_UNIT_I || unit == IA64_UNIT_M); + break; + case IA64_TYPE_X: result = (unit == IA64_UNIT_L); break; + case IA64_TYPE_I: result = (unit == IA64_UNIT_I); break; + case IA64_TYPE_M: result = (unit == IA64_UNIT_M); break; + case IA64_TYPE_B: result = (unit == IA64_UNIT_B); break; + case IA64_TYPE_F: result = (unit == IA64_UNIT_F); break; + default: result = 0; break; + } + return result; +} + +/* Add a bit of extra goodness if a nop of type F or B would fit + in TEMPL at SLOT. */ + +static inline int +extra_goodness (int templ, int slot) +{ + if (slot == 1 && match (templ, IA64_TYPE_F, slot)) + return 2; + if (slot == 2 && match (templ, IA64_TYPE_B, slot)) + return 1; + return 0; +} + +/* This function is called once, at assembler startup time. It sets + up all the tables, etc. that the MD part of the assembler will need + that can be determined before arguments are parsed. */ +void +md_begin () +{ + int i, j, k, t, total, ar_base, cr_base, goodness, best, regnum, ok; + const char *err; + char name[8]; + + md.auto_align = 1; + md.explicit_mode = md.default_explicit_mode; + + bfd_set_section_alignment (stdoutput, text_section, 4); + + target_big_endian = TARGET_BYTES_BIG_ENDIAN; + pseudo_func[FUNC_FPTR_RELATIVE].u.sym = + symbol_new (".<fptr>", undefined_section, FUNC_FPTR_RELATIVE, + &zero_address_frag); + + pseudo_func[FUNC_GP_RELATIVE].u.sym = + symbol_new (".<gprel>", undefined_section, FUNC_GP_RELATIVE, + &zero_address_frag); + + pseudo_func[FUNC_LT_RELATIVE].u.sym = + symbol_new (".<ltoff>", undefined_section, FUNC_LT_RELATIVE, + &zero_address_frag); + + pseudo_func[FUNC_PC_RELATIVE].u.sym = + symbol_new (".<pcrel>", undefined_section, FUNC_PC_RELATIVE, + &zero_address_frag); + + pseudo_func[FUNC_PLT_RELATIVE].u.sym = + symbol_new (".<pltoff>", undefined_section, FUNC_PLT_RELATIVE, + &zero_address_frag); + + pseudo_func[FUNC_SEC_RELATIVE].u.sym = + symbol_new (".<secrel>", undefined_section, FUNC_SEC_RELATIVE, + &zero_address_frag); + + pseudo_func[FUNC_SEG_RELATIVE].u.sym = + symbol_new (".<segrel>", undefined_section, FUNC_SEG_RELATIVE, + &zero_address_frag); + + pseudo_func[FUNC_LTV_RELATIVE].u.sym = + symbol_new (".<ltv>", undefined_section, FUNC_LTV_RELATIVE, + &zero_address_frag); + + pseudo_func[FUNC_LT_FPTR_RELATIVE].u.sym = + symbol_new (".<ltoff.fptr>", undefined_section, FUNC_LT_FPTR_RELATIVE, + &zero_address_frag); + + /* Compute the table of best templates. We compute goodness as a + base 4 value, in which each match counts for 3, each F counts + for 2, each B counts for 1. This should maximize the number of + F and B nops in the chosen bundles, which is good because these + pipelines are least likely to be overcommitted. */ + for (i = 0; i < IA64_NUM_TYPES; ++i) + for (j = 0; j < IA64_NUM_TYPES; ++j) + for (k = 0; k < IA64_NUM_TYPES; ++k) + { + best = 0; + for (t = 0; t < NELEMS (ia64_templ_desc); ++t) + { + goodness = 0; + if (match (t, i, 0)) + { + if (match (t, j, 1)) + { + if (match (t, k, 2)) + goodness = 3 + 3 + 3; + else + goodness = 3 + 3 + extra_goodness (t, 2); + } + else if (match (t, j, 2)) + goodness = 3 + 3 + extra_goodness (t, 1); + else + { + goodness = 3; + goodness += extra_goodness (t, 1); + goodness += extra_goodness (t, 2); + } + } + else if (match (t, i, 1)) + { + if (match (t, j, 2)) + goodness = 3 + 3; + else + goodness = 3 + extra_goodness (t, 2); + } + else if (match (t, i, 2)) + goodness = 3 + extra_goodness (t, 1); + + if (goodness > best) + { + best = goodness; + best_template[i][j][k] = t; + } + } + } + + for (i = 0; i < NUM_SLOTS; ++i) + md.slot[i].user_template = -1; + + md.pseudo_hash = hash_new (); + for (i = 0; i < NELEMS (pseudo_opcode); ++i) + { + err = hash_insert (md.pseudo_hash, pseudo_opcode[i].name, + (void *) (pseudo_opcode + i)); + if (err) + as_fatal ("ia64.md_begin: can't hash `%s': %s", + pseudo_opcode[i].name, err); + } + + md.reg_hash = hash_new (); + md.dynreg_hash = hash_new (); + md.const_hash = hash_new (); + md.entry_hash = hash_new (); + + /* general registers: */ + + total = 128; + for (i = 0; i < total; ++i) + { + sprintf (name, "r%d", i - REG_GR); + md.regsym[i] = declare_register (name, i); + } + + /* floating point registers: */ + total += 128; + for (; i < total; ++i) + { + sprintf (name, "f%d", i - REG_FR); + md.regsym[i] = declare_register (name, i); + } + + /* application registers: */ + total += 128; + ar_base = i; + for (; i < total; ++i) + { + sprintf (name, "ar%d", i - REG_AR); + md.regsym[i] = declare_register (name, i); + } + + /* control registers: */ + total += 128; + cr_base = i; + for (; i < total; ++i) + { + sprintf (name, "cr%d", i - REG_CR); + md.regsym[i] = declare_register (name, i); + } + + /* predicate registers: */ + total += 64; + for (; i < total; ++i) + { + sprintf (name, "p%d", i - REG_P); + md.regsym[i] = declare_register (name, i); + } + + /* branch registers: */ + total += 8; + for (; i < total; ++i) + { + sprintf (name, "b%d", i - REG_BR); + md.regsym[i] = declare_register (name, i); + } + + md.regsym[REG_IP] = declare_register ("ip", REG_IP); + md.regsym[REG_CFM] = declare_register ("cfm", REG_CFM); + md.regsym[REG_PR] = declare_register ("pr", REG_PR); + md.regsym[REG_PR_ROT] = declare_register ("pr.rot", REG_PR_ROT); + md.regsym[REG_PSR] = declare_register ("psr", REG_PSR); + md.regsym[REG_PSR_L] = declare_register ("psr.l", REG_PSR_L); + md.regsym[REG_PSR_UM] = declare_register ("psr.um", REG_PSR_UM); + + for (i = 0; i < NELEMS (indirect_reg); ++i) + { + regnum = indirect_reg[i].regnum; + md.regsym[regnum] = declare_register (indirect_reg[i].name, regnum); + } + + /* define synonyms for application registers: */ + for (i = REG_AR; i < REG_AR + NELEMS (ar); ++i) + md.regsym[i] = declare_register (ar[i - REG_AR].name, + REG_AR + ar[i - REG_AR].regnum); + + /* define synonyms for control registers: */ + for (i = REG_CR; i < REG_CR + NELEMS (cr); ++i) + md.regsym[i] = declare_register (cr[i - REG_CR].name, + REG_CR + cr[i - REG_CR].regnum); + + declare_register ("gp", REG_GR + 1); + declare_register ("sp", REG_GR + 12); + declare_register ("rp", REG_BR + 0); + + /* pseudo-registers used to specify unwind info: */ + declare_register ("psp", REG_PSP); + + declare_register_set ("ret", 4, REG_GR + 8); + declare_register_set ("farg", 8, REG_FR + 8); + declare_register_set ("fret", 8, REG_FR + 8); + + for (i = 0; i < NELEMS (const_bits); ++i) + { + err = hash_insert (md.const_hash, const_bits[i].name, + (PTR) (const_bits + i)); + if (err) + as_fatal ("Inserting \"%s\" into constant hash table failed: %s", + name, err); + } + + /* Set the architecture and machine depending on defaults and command line + options. */ + if (md.flags & EF_IA_64_ABI64) + ok = bfd_set_arch_mach (stdoutput, bfd_arch_ia64, bfd_mach_ia64_elf64); + else + ok = bfd_set_arch_mach (stdoutput, bfd_arch_ia64, bfd_mach_ia64_elf32); + + if (! ok) + as_warn (_("Could not set architecture and machine")); + + md.mem_offset.hint = 0; + md.path = 0; + md.maxpaths = 0; + md.entry_labels = NULL; +} + +/* Set the elf type to 64 bit ABI by default. Cannot do this in md_begin + because that is called after md_parse_option which is where we do the + dynamic changing of md.flags based on -mlp64 or -milp32. Also, set the + default endianness. */ + +void +ia64_init (argc, argv) + int argc ATTRIBUTE_UNUSED; + char **argv ATTRIBUTE_UNUSED; +{ + md.flags = EF_IA_64_ABI64; + if (TARGET_BYTES_BIG_ENDIAN) + md.flags |= EF_IA_64_BE; +} + +/* Return a string for the target object file format. */ + +const char * +ia64_target_format () +{ + if (OUTPUT_FLAVOR == bfd_target_elf_flavour) + { + if (md.flags & EF_IA_64_BE) + { + if (md.flags & EF_IA_64_ABI64) + return "elf64-ia64-big"; + else + return "elf32-ia64-big"; + } + else + { + if (md.flags & EF_IA_64_ABI64) + return "elf64-ia64-little"; + else + return "elf32-ia64-little"; + } + } + else + return "unknown-format"; +} + +void +ia64_end_of_source () +{ + /* terminate insn group upon reaching end of file: */ + insn_group_break (1, 0, 0); + + /* emits slots we haven't written yet: */ + ia64_flush_insns (); + + bfd_set_private_flags (stdoutput, md.flags); + + md.mem_offset.hint = 0; +} + +void +ia64_start_line () +{ + if (md.qp.X_op == O_register) + as_bad ("qualifying predicate not followed by instruction"); + md.qp.X_op = O_absent; + + if (ignore_input ()) + return; + + if (input_line_pointer[0] == ';' && input_line_pointer[-1] == ';') + { + if (md.detect_dv && !md.explicit_mode) + as_warn (_("Explicit stops are ignored in auto mode")); + else + insn_group_break (1, 0, 0); + } +} + +/* This is a hook for ia64_frob_label, so that it can distinguish tags from + labels. */ +static int defining_tag = 0; + +int +ia64_unrecognized_line (ch) + int ch; +{ + switch (ch) + { + case '(': + expression (&md.qp); + if (*input_line_pointer++ != ')') + { + as_bad ("Expected ')'"); + return 0; + } + if (md.qp.X_op != O_register) + { + as_bad ("Qualifying predicate expected"); + return 0; + } + if (md.qp.X_add_number < REG_P || md.qp.X_add_number >= REG_P + 64) + { + as_bad ("Predicate register expected"); + return 0; + } + return 1; + + case '{': + if (md.manual_bundling) + as_warn ("Found '{' when manual bundling is already turned on"); + else + CURR_SLOT.manual_bundling_on = 1; + md.manual_bundling = 1; + + /* Bundling is only acceptable in explicit mode + or when in default automatic mode. */ + if (md.detect_dv && !md.explicit_mode) + { + if (!md.mode_explicitly_set + && !md.default_explicit_mode) + dot_dv_mode ('E'); + else + as_warn (_("Found '{' after explicit switch to automatic mode")); + } + return 1; + + case '}': + if (!md.manual_bundling) + as_warn ("Found '}' when manual bundling is off"); + else + PREV_SLOT.manual_bundling_off = 1; + md.manual_bundling = 0; + + /* switch back to automatic mode, if applicable */ + if (md.detect_dv + && md.explicit_mode + && !md.mode_explicitly_set + && !md.default_explicit_mode) + dot_dv_mode ('A'); + + /* Allow '{' to follow on the same line. We also allow ";;", but that + happens automatically because ';' is an end of line marker. */ + SKIP_WHITESPACE (); + if (input_line_pointer[0] == '{') + { + input_line_pointer++; + return ia64_unrecognized_line ('{'); + } + + demand_empty_rest_of_line (); + return 1; + + case '[': + { + char *s; + char c; + symbolS *tag; + int temp; + + if (md.qp.X_op == O_register) + { + as_bad ("Tag must come before qualifying predicate."); + return 0; + } + + /* This implements just enough of read_a_source_file in read.c to + recognize labels. */ + if (is_name_beginner (*input_line_pointer)) + { + s = input_line_pointer; + c = get_symbol_end (); + } + else if (LOCAL_LABELS_FB + && isdigit ((unsigned char) *input_line_pointer)) + { + temp = 0; + while (isdigit ((unsigned char) *input_line_pointer)) + temp = (temp * 10) + *input_line_pointer++ - '0'; + fb_label_instance_inc (temp); + s = fb_label_name (temp, 0); + c = *input_line_pointer; + } + else + { + s = NULL; + c = '\0'; + } + if (c != ':') + { + /* Put ':' back for error messages' sake. */ + *input_line_pointer++ = ':'; + as_bad ("Expected ':'"); + return 0; + } + + defining_tag = 1; + tag = colon (s); + defining_tag = 0; + /* Put ':' back for error messages' sake. */ + *input_line_pointer++ = ':'; + if (*input_line_pointer++ != ']') + { + as_bad ("Expected ']'"); + return 0; + } + if (! tag) + { + as_bad ("Tag name expected"); + return 0; + } + return 1; + } + + default: + break; + } + + /* Not a valid line. */ + return 0; +} + +void +ia64_frob_label (sym) + struct symbol *sym; +{ + struct label_fix *fix; + + /* Tags need special handling since they are not bundle breaks like + labels. */ + if (defining_tag) + { + fix = obstack_alloc (¬es, sizeof (*fix)); + fix->sym = sym; + fix->next = CURR_SLOT.tag_fixups; + CURR_SLOT.tag_fixups = fix; + + return; + } + + if (bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) + { + md.last_text_seg = now_seg; + fix = obstack_alloc (¬es, sizeof (*fix)); + fix->sym = sym; + fix->next = CURR_SLOT.label_fixups; + CURR_SLOT.label_fixups = fix; + + /* Keep track of how many code entry points we've seen. */ + if (md.path == md.maxpaths) + { + md.maxpaths += 20; + md.entry_labels = (const char **) + xrealloc ((void *) md.entry_labels, + md.maxpaths * sizeof (char *)); + } + md.entry_labels[md.path++] = S_GET_NAME (sym); + } +} + +void +ia64_flush_pending_output () +{ + if (!md.keep_pending_output + && bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) + { + /* ??? This causes many unnecessary stop bits to be emitted. + Unfortunately, it isn't clear if it is safe to remove this. */ + insn_group_break (1, 0, 0); + ia64_flush_insns (); + } +} + +/* Do ia64-specific expression optimization. All that's done here is + to transform index expressions that are either due to the indexing + of rotating registers or due to the indexing of indirect register + sets. */ +int +ia64_optimize_expr (l, op, r) + expressionS *l; + operatorT op; + expressionS *r; +{ + unsigned num_regs; + + if (op == O_index) + { + if (l->X_op == O_register && r->X_op == O_constant) + { + num_regs = (l->X_add_number >> 16); + if ((unsigned) r->X_add_number >= num_regs) + { + if (!num_regs) + as_bad ("No current frame"); + else + as_bad ("Index out of range 0..%u", num_regs - 1); + r->X_add_number = 0; + } + l->X_add_number = (l->X_add_number & 0xffff) + r->X_add_number; + return 1; + } + else if (l->X_op == O_register && r->X_op == O_register) + { + if (l->X_add_number < IND_CPUID || l->X_add_number > IND_RR + || l->X_add_number == IND_MEM) + { + as_bad ("Indirect register set name expected"); + l->X_add_number = IND_CPUID; + } + l->X_op = O_index; + l->X_op_symbol = md.regsym[l->X_add_number]; + l->X_add_number = r->X_add_number; + return 1; + } + } + return 0; +} + +int +ia64_parse_name (name, e) + char *name; + expressionS *e; +{ + struct const_desc *cdesc; + struct dynreg *dr = 0; + unsigned int regnum; + struct symbol *sym; + char *end; + + /* first see if NAME is a known register name: */ + sym = hash_find (md.reg_hash, name); + if (sym) + { + e->X_op = O_register; + e->X_add_number = S_GET_VALUE (sym); + return 1; + } + + cdesc = hash_find (md.const_hash, name); + if (cdesc) + { + e->X_op = O_constant; + e->X_add_number = cdesc->value; + return 1; + } + + /* check for inN, locN, or outN: */ + switch (name[0]) + { + case 'i': + if (name[1] == 'n' && isdigit (name[2])) + { + dr = &md.in; + name += 2; + } + break; + + case 'l': + if (name[1] == 'o' && name[2] == 'c' && isdigit (name[3])) + { + dr = &md.loc; + name += 3; + } + break; + + case 'o': + if (name[1] == 'u' && name[2] == 't' && isdigit (name[3])) + { + dr = &md.out; + name += 3; + } + break; + + default: + break; + } + + if (dr) + { + /* The name is inN, locN, or outN; parse the register number. */ + regnum = strtoul (name, &end, 10); + if (end > name && *end == '\0') + { + if ((unsigned) regnum >= dr->num_regs) + { + if (!dr->num_regs) + as_bad ("No current frame"); + else + as_bad ("Register number out of range 0..%u", + dr->num_regs - 1); + regnum = 0; + } + e->X_op = O_register; + e->X_add_number = dr->base + regnum; + return 1; + } + } + + if ((dr = hash_find (md.dynreg_hash, name))) + { + /* We've got ourselves the name of a rotating register set. + Store the base register number in the low 16 bits of + X_add_number and the size of the register set in the top 16 + bits. */ + e->X_op = O_register; + e->X_add_number = dr->base | (dr->num_regs << 16); + return 1; + } + return 0; +} + +/* Remove the '#' suffix that indicates a symbol as opposed to a register. */ + +char * +ia64_canonicalize_symbol_name (name) + char *name; +{ + size_t len = strlen (name); + if (len > 1 && name[len - 1] == '#') + name[len - 1] = '\0'; + return name; +} + +/* Return true if idesc is a conditional branch instruction. */ + +static int +is_conditional_branch (idesc) + struct ia64_opcode *idesc; +{ + /* br is a conditional branch. Everything that starts with br. except + br.ia is a conditional branch. Everything that starts with brl is a + conditional branch. */ + return (idesc->name[0] == 'b' && idesc->name[1] == 'r' + && (idesc->name[2] == '\0' + || (idesc->name[2] == '.' && idesc->name[3] != 'i') + || idesc->name[2] == 'l')); +} + +/* Return whether the given opcode is a taken branch. If there's any doubt, + returns zero. */ + +static int +is_taken_branch (idesc) + struct ia64_opcode *idesc; +{ + return ((is_conditional_branch (idesc) && CURR_SLOT.qp_regno == 0) + || strncmp (idesc->name, "br.ia", 5) == 0); +} + +/* Return whether the given opcode is an interruption or rfi. If there's any + doubt, returns zero. */ + +static int +is_interruption_or_rfi (idesc) + struct ia64_opcode *idesc; +{ + if (strcmp (idesc->name, "rfi") == 0) + return 1; + return 0; +} + +/* Returns the index of the given dependency in the opcode's list of chks, or + -1 if there is no dependency. */ + +static int +depends_on (depind, idesc) + int depind; + struct ia64_opcode *idesc; +{ + int i; + const struct ia64_opcode_dependency *dep = idesc->dependencies; + for (i = 0; i < dep->nchks; i++) + { + if (depind == DEP (dep->chks[i])) + return i; + } + return -1; +} + +/* Determine a set of specific resources used for a particular resource + class. Returns the number of specific resources identified For those + cases which are not determinable statically, the resource returned is + marked nonspecific. + + Meanings of value in 'NOTE': + 1) only read/write when the register number is explicitly encoded in the + insn. + 2) only read CFM when accessing a rotating GR, FR, or PR. mov pr only + accesses CFM when qualifying predicate is in the rotating region. + 3) general register value is used to specify an indirect register; not + determinable statically. + 4) only read the given resource when bits 7:0 of the indirect index + register value does not match the register number of the resource; not + determinable statically. + 5) all rules are implementation specific. + 6) only when both the index specified by the reader and the index specified + by the writer have the same value in bits 63:61; not determinable + statically. + 7) only access the specified resource when the corresponding mask bit is + set + 8) PSR.dfh is only read when these insns reference FR32-127. PSR.dfl is + only read when these insns reference FR2-31 + 9) PSR.mfl is only written when these insns write FR2-31. PSR.mfh is only + written when these insns write FR32-127 + 10) The PSR.bn bit is only accessed when one of GR16-31 is specified in the + instruction + 11) The target predicates are written independently of PR[qp], but source + registers are only read if PR[qp] is true. Since the state of PR[qp] + cannot statically be determined, all source registers are marked used. + 12) This insn only reads the specified predicate register when that + register is the PR[qp]. + 13) This reference to ld-c only applies to teh GR whose value is loaded + with data returned from memory, not the post-incremented address register. + 14) The RSE resource includes the implementation-specific RSE internal + state resources. At least one (and possibly more) of these resources are + read by each instruction listed in IC:rse-readers. At least one (and + possibly more) of these resources are written by each insn listed in + IC:rse-writers. + 15+16) Represents reserved instructions, which the assembler does not + generate. + + Memory resources (i.e. locations in memory) are *not* marked or tracked by + this code; there are no dependency violations based on memory access. +*/ + +#define MAX_SPECS 256 +#define DV_CHK 1 +#define DV_REG 0 + +static int +specify_resource (dep, idesc, type, specs, note, path) + const struct ia64_dependency *dep; + struct ia64_opcode *idesc; + int type; /* is this a DV chk or a DV reg? */ + struct rsrc specs[MAX_SPECS]; /* returned specific resources */ + int note; /* resource note for this insn's usage */ + int path; /* which execution path to examine */ +{ + int count = 0; + int i; + int rsrc_write = 0; + struct rsrc tmpl; + + if (dep->mode == IA64_DV_WAW + || (dep->mode == IA64_DV_RAW && type == DV_REG) + || (dep->mode == IA64_DV_WAR && type == DV_CHK)) + rsrc_write = 1; + + /* template for any resources we identify */ + tmpl.dependency = dep; + tmpl.note = note; + tmpl.insn_srlz = tmpl.data_srlz = 0; + tmpl.qp_regno = CURR_SLOT.qp_regno; + tmpl.link_to_qp_branch = 1; + tmpl.mem_offset.hint = 0; + tmpl.specific = 1; + tmpl.index = 0; + tmpl.cmp_type = CMP_NONE; + +#define UNHANDLED \ +as_warn (_("Unhandled dependency %s for %s (%s), note %d"), \ +dep->name, idesc->name, (rsrc_write?"write":"read"), note) +#define KNOWN(REG) (gr_values[REG].known && gr_values[REG].path >= path) + + /* we don't need to track these */ + if (dep->semantics == IA64_DVS_NONE) + return 0; + + switch (dep->specifier) + { + case IA64_RS_AR_K: + if (note == 1) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_AR3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_AR; + if (regno >= 0 && regno <= 7) + { + specs[count] = tmpl; + specs[count++].index = regno; + } + } + } + else if (note == 0) + { + for (i = 0; i < 8; i++) + { + specs[count] = tmpl; + specs[count++].index = i; + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_AR_UNAT: + /* This is a mov =AR or mov AR= instruction. */ + if (idesc->operands[!rsrc_write] == IA64_OPND_AR3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_AR; + if (regno == AR_UNAT) + { + specs[count++] = tmpl; + } + } + else + { + /* This is a spill/fill, or other instruction that modifies the + unat register. */ + + /* Unless we can determine the specific bits used, mark the whole + thing; bits 8:3 of the memory address indicate the bit used in + UNAT. The .mem.offset hint may be used to eliminate a small + subset of conflicts. */ + specs[count] = tmpl; + if (md.mem_offset.hint) + { + if (md.debug_dv) + fprintf (stderr, " Using hint for spill/fill\n"); + /* The index isn't actually used, just set it to something + approximating the bit index. */ + specs[count].index = (md.mem_offset.offset >> 3) & 0x3F; + specs[count].mem_offset.hint = 1; + specs[count].mem_offset.offset = md.mem_offset.offset; + specs[count++].mem_offset.base = md.mem_offset.base; + } + else + { + specs[count++].specific = 0; + } + } + break; + + case IA64_RS_AR: + if (note == 1) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_AR3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_AR; + if ((regno >= 8 && regno <= 15) + || (regno >= 20 && regno <= 23) + || (regno >= 31 && regno <= 39) + || (regno >= 41 && regno <= 47) + || (regno >= 67 && regno <= 111)) + { + specs[count] = tmpl; + specs[count++].index = regno; + } + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_ARb: + if (note == 1) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_AR3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_AR; + if ((regno >= 48 && regno <= 63) + || (regno >= 112 && regno <= 127)) + { + specs[count] = tmpl; + specs[count++].index = regno; + } + } + } + else if (note == 0) + { + for (i = 48; i < 64; i++) + { + specs[count] = tmpl; + specs[count++].index = i; + } + for (i = 112; i < 128; i++) + { + specs[count] = tmpl; + specs[count++].index = i; + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_BR: + if (note != 1) + { + UNHANDLED; + } + else + { + if (rsrc_write) + { + for (i = 0; i < idesc->num_outputs; i++) + if (idesc->operands[i] == IA64_OPND_B1 + || idesc->operands[i] == IA64_OPND_B2) + { + specs[count] = tmpl; + specs[count++].index = + CURR_SLOT.opnd[i].X_add_number - REG_BR; + } + } + else + { + for (i = idesc->num_outputs;i < NELEMS (idesc->operands); i++) + if (idesc->operands[i] == IA64_OPND_B1 + || idesc->operands[i] == IA64_OPND_B2) + { + specs[count] = tmpl; + specs[count++].index = + CURR_SLOT.opnd[i].X_add_number - REG_BR; + } + } + } + break; + + case IA64_RS_CPUID: /* four or more registers */ + if (note == 3) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_CPUID_R3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_GR; + if (regno >= 0 && regno < NELEMS (gr_values) + && KNOWN (regno)) + { + specs[count] = tmpl; + specs[count++].index = gr_values[regno].value & 0xFF; + } + else + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_DBR: /* four or more registers */ + if (note == 3) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_DBR_R3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_GR; + if (regno >= 0 && regno < NELEMS (gr_values) + && KNOWN (regno)) + { + specs[count] = tmpl; + specs[count++].index = gr_values[regno].value & 0xFF; + } + else + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + } + else if (note == 0 && !rsrc_write) + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_IBR: /* four or more registers */ + if (note == 3) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_IBR_R3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_GR; + if (regno >= 0 && regno < NELEMS (gr_values) + && KNOWN (regno)) + { + specs[count] = tmpl; + specs[count++].index = gr_values[regno].value & 0xFF; + } + else + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_MSR: + if (note == 5) + { + /* These are implementation specific. Force all references to + conflict with all other references. */ + specs[count] = tmpl; + specs[count++].specific = 0; + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_PKR: /* 16 or more registers */ + if (note == 3 || note == 4) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_PKR_R3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_GR; + if (regno >= 0 && regno < NELEMS (gr_values) + && KNOWN (regno)) + { + if (note == 3) + { + specs[count] = tmpl; + specs[count++].index = gr_values[regno].value & 0xFF; + } + else + for (i = 0; i < NELEMS (gr_values); i++) + { + /* Uses all registers *except* the one in R3. */ + if ((unsigned)i != (gr_values[regno].value & 0xFF)) + { + specs[count] = tmpl; + specs[count++].index = i; + } + } + } + else + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + } + else if (note == 0) + { + /* probe et al. */ + specs[count] = tmpl; + specs[count++].specific = 0; + } + break; + + case IA64_RS_PMC: /* four or more registers */ + if (note == 3) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_PMC_R3 + || (!rsrc_write && idesc->operands[1] == IA64_OPND_PMD_R3)) + + { + int index = ((idesc->operands[1] == IA64_OPND_R3 && !rsrc_write) + ? 1 : !rsrc_write); + int regno = CURR_SLOT.opnd[index].X_add_number - REG_GR; + if (regno >= 0 && regno < NELEMS (gr_values) + && KNOWN (regno)) + { + specs[count] = tmpl; + specs[count++].index = gr_values[regno].value & 0xFF; + } + else + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_PMD: /* four or more registers */ + if (note == 3) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_PMD_R3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_GR; + if (regno >= 0 && regno < NELEMS (gr_values) + && KNOWN (regno)) + { + specs[count] = tmpl; + specs[count++].index = gr_values[regno].value & 0xFF; + } + else + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_RR: /* eight registers */ + if (note == 6) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_RR_R3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_GR; + if (regno >= 0 && regno < NELEMS (gr_values) + && KNOWN (regno)) + { + specs[count] = tmpl; + specs[count++].index = (gr_values[regno].value >> 61) & 0x7; + } + else + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + } + else if (note == 0 && !rsrc_write) + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_CR_IRR: + if (note == 0) + { + /* handle mov-from-CR-IVR; it's a read that writes CR[IRR] */ + int regno = CURR_SLOT.opnd[1].X_add_number - REG_CR; + if (rsrc_write + && idesc->operands[1] == IA64_OPND_CR3 + && regno == CR_IVR) + { + for (i = 0; i < 4; i++) + { + specs[count] = tmpl; + specs[count++].index = CR_IRR0 + i; + } + } + } + else if (note == 1) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_CR; + if (idesc->operands[!rsrc_write] == IA64_OPND_CR3 + && regno >= CR_IRR0 + && regno <= CR_IRR3) + { + specs[count] = tmpl; + specs[count++].index = regno; + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_CR_LRR: + if (note != 1) + { + UNHANDLED; + } + else + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_CR; + if (idesc->operands[!rsrc_write] == IA64_OPND_CR3 + && (regno == CR_LRR0 || regno == CR_LRR1)) + { + specs[count] = tmpl; + specs[count++].index = regno; + } + } + break; + + case IA64_RS_CR: + if (note == 1) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_CR3) + { + specs[count] = tmpl; + specs[count++].index = + CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_CR; + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_FR: + case IA64_RS_FRb: + if (note != 1) + { + UNHANDLED; + } + else if (rsrc_write) + { + if (dep->specifier == IA64_RS_FRb + && idesc->operands[0] == IA64_OPND_F1) + { + specs[count] = tmpl; + specs[count++].index = CURR_SLOT.opnd[0].X_add_number - REG_FR; + } + } + else + { + for (i = idesc->num_outputs; i < NELEMS (idesc->operands); i++) + { + if (idesc->operands[i] == IA64_OPND_F2 + || idesc->operands[i] == IA64_OPND_F3 + || idesc->operands[i] == IA64_OPND_F4) + { + specs[count] = tmpl; + specs[count++].index = + CURR_SLOT.opnd[i].X_add_number - REG_FR; + } + } + } + break; + + case IA64_RS_GR: + if (note == 13) + { + /* This reference applies only to the GR whose value is loaded with + data returned from memory. */ + specs[count] = tmpl; + specs[count++].index = CURR_SLOT.opnd[0].X_add_number - REG_GR; + } + else if (note == 1) + { + if (rsrc_write) + { + for (i = 0; i < idesc->num_outputs; i++) + if (idesc->operands[i] == IA64_OPND_R1 + || idesc->operands[i] == IA64_OPND_R2 + || idesc->operands[i] == IA64_OPND_R3) + { + specs[count] = tmpl; + specs[count++].index = + CURR_SLOT.opnd[i].X_add_number - REG_GR; + } + if (idesc->flags & IA64_OPCODE_POSTINC) + for (i = 0; i < NELEMS (idesc->operands); i++) + if (idesc->operands[i] == IA64_OPND_MR3) + { + specs[count] = tmpl; + specs[count++].index = + CURR_SLOT.opnd[i].X_add_number - REG_GR; + } + } + else + { + /* Look for anything that reads a GR. */ + for (i = 0; i < NELEMS (idesc->operands); i++) + { + if (idesc->operands[i] == IA64_OPND_MR3 + || idesc->operands[i] == IA64_OPND_CPUID_R3 + || idesc->operands[i] == IA64_OPND_DBR_R3 + || idesc->operands[i] == IA64_OPND_IBR_R3 + || idesc->operands[i] == IA64_OPND_MSR_R3 + || idesc->operands[i] == IA64_OPND_PKR_R3 + || idesc->operands[i] == IA64_OPND_PMC_R3 + || idesc->operands[i] == IA64_OPND_PMD_R3 + || idesc->operands[i] == IA64_OPND_RR_R3 + || ((i >= idesc->num_outputs) + && (idesc->operands[i] == IA64_OPND_R1 + || idesc->operands[i] == IA64_OPND_R2 + || idesc->operands[i] == IA64_OPND_R3 + /* addl source register. */ + || idesc->operands[i] == IA64_OPND_R3_2))) + { + specs[count] = tmpl; + specs[count++].index = + CURR_SLOT.opnd[i].X_add_number - REG_GR; + } + } + } + } + else + { + UNHANDLED; + } + break; + + /* This is the same as IA64_RS_PRr, except that the register range is + from 1 - 15, and there are no rotating register reads/writes here. */ + case IA64_RS_PR: + if (note == 0) + { + for (i = 1; i < 16; i++) + { + specs[count] = tmpl; + specs[count++].index = i; + } + } + else if (note == 7) + { + valueT mask = 0; + /* Mark only those registers indicated by the mask. */ + if (rsrc_write) + { + mask = CURR_SLOT.opnd[2].X_add_number; + for (i = 1; i < 16; i++) + if (mask & ((valueT) 1 << i)) + { + specs[count] = tmpl; + specs[count++].index = i; + } + } + else + { + UNHANDLED; + } + } + else if (note == 11) /* note 11 implies note 1 as well */ + { + if (rsrc_write) + { + for (i = 0; i < idesc->num_outputs; i++) + { + if (idesc->operands[i] == IA64_OPND_P1 + || idesc->operands[i] == IA64_OPND_P2) + { + int regno = CURR_SLOT.opnd[i].X_add_number - REG_P; + if (regno >= 1 && regno < 16) + { + specs[count] = tmpl; + specs[count++].index = regno; + } + } + } + } + else + { + UNHANDLED; + } + } + else if (note == 12) + { + if (CURR_SLOT.qp_regno >= 1 && CURR_SLOT.qp_regno < 16) + { + specs[count] = tmpl; + specs[count++].index = CURR_SLOT.qp_regno; + } + } + else if (note == 1) + { + if (rsrc_write) + { + int p1 = CURR_SLOT.opnd[0].X_add_number - REG_P; + int p2 = CURR_SLOT.opnd[1].X_add_number - REG_P; + int or_andcm = strstr(idesc->name, "or.andcm") != NULL; + int and_orcm = strstr(idesc->name, "and.orcm") != NULL; + + if ((idesc->operands[0] == IA64_OPND_P1 + || idesc->operands[0] == IA64_OPND_P2) + && p1 >= 1 && p1 < 16) + { + specs[count] = tmpl; + specs[count].cmp_type = + (or_andcm ? CMP_OR : (and_orcm ? CMP_AND : CMP_NONE)); + specs[count++].index = p1; + } + if ((idesc->operands[1] == IA64_OPND_P1 + || idesc->operands[1] == IA64_OPND_P2) + && p2 >= 1 && p2 < 16) + { + specs[count] = tmpl; + specs[count].cmp_type = + (or_andcm ? CMP_AND : (and_orcm ? CMP_OR : CMP_NONE)); + specs[count++].index = p2; + } + } + else + { + if (CURR_SLOT.qp_regno >= 1 && CURR_SLOT.qp_regno < 16) + { + specs[count] = tmpl; + specs[count++].index = CURR_SLOT.qp_regno; + } + if (idesc->operands[1] == IA64_OPND_PR) + { + for (i = 1; i < 16; i++) + { + specs[count] = tmpl; + specs[count++].index = i; + } + } + } + } + else + { + UNHANDLED; + } + break; + + /* This is the general case for PRs. IA64_RS_PR and IA64_RS_PR63 are + simplified cases of this. */ + case IA64_RS_PRr: + if (note == 0) + { + for (i = 16; i < 63; i++) + { + specs[count] = tmpl; + specs[count++].index = i; + } + } + else if (note == 7) + { + valueT mask = 0; + /* Mark only those registers indicated by the mask. */ + if (rsrc_write + && idesc->operands[0] == IA64_OPND_PR) + { + mask = CURR_SLOT.opnd[2].X_add_number; + if (mask & ((valueT) 1<<16)) + for (i = 16; i < 63; i++) + { + specs[count] = tmpl; + specs[count++].index = i; + } + } + else if (rsrc_write + && idesc->operands[0] == IA64_OPND_PR_ROT) + { + for (i = 16; i < 63; i++) + { + specs[count] = tmpl; + specs[count++].index = i; + } + } + else + { + UNHANDLED; + } + } + else if (note == 11) /* note 11 implies note 1 as well */ + { + if (rsrc_write) + { + for (i = 0; i < idesc->num_outputs; i++) + { + if (idesc->operands[i] == IA64_OPND_P1 + || idesc->operands[i] == IA64_OPND_P2) + { + int regno = CURR_SLOT.opnd[i].X_add_number - REG_P; + if (regno >= 16 && regno < 63) + { + specs[count] = tmpl; + specs[count++].index = regno; + } + } + } + } + else + { + UNHANDLED; + } + } + else if (note == 12) + { + if (CURR_SLOT.qp_regno >= 16 && CURR_SLOT.qp_regno < 63) + { + specs[count] = tmpl; + specs[count++].index = CURR_SLOT.qp_regno; + } + } + else if (note == 1) + { + if (rsrc_write) + { + int p1 = CURR_SLOT.opnd[0].X_add_number - REG_P; + int p2 = CURR_SLOT.opnd[1].X_add_number - REG_P; + int or_andcm = strstr(idesc->name, "or.andcm") != NULL; + int and_orcm = strstr(idesc->name, "and.orcm") != NULL; + + if ((idesc->operands[0] == IA64_OPND_P1 + || idesc->operands[0] == IA64_OPND_P2) + && p1 >= 16 && p1 < 63) + { + specs[count] = tmpl; + specs[count].cmp_type = + (or_andcm ? CMP_OR : (and_orcm ? CMP_AND : CMP_NONE)); + specs[count++].index = p1; + } + if ((idesc->operands[1] == IA64_OPND_P1 + || idesc->operands[1] == IA64_OPND_P2) + && p2 >= 16 && p2 < 63) + { + specs[count] = tmpl; + specs[count].cmp_type = + (or_andcm ? CMP_AND : (and_orcm ? CMP_OR : CMP_NONE)); + specs[count++].index = p2; + } + } + else + { + if (CURR_SLOT.qp_regno >= 16 && CURR_SLOT.qp_regno < 63) + { + specs[count] = tmpl; + specs[count++].index = CURR_SLOT.qp_regno; + } + if (idesc->operands[1] == IA64_OPND_PR) + { + for (i = 16; i < 63; i++) + { + specs[count] = tmpl; + specs[count++].index = i; + } + } + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_PSR: + /* Verify that the instruction is using the PSR bit indicated in + dep->regindex. */ + if (note == 0) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_PSR_UM) + { + if (dep->regindex < 6) + { + specs[count++] = tmpl; + } + } + else if (idesc->operands[!rsrc_write] == IA64_OPND_PSR) + { + if (dep->regindex < 32 + || dep->regindex == 35 + || dep->regindex == 36 + || (!rsrc_write && dep->regindex == PSR_CPL)) + { + specs[count++] = tmpl; + } + } + else if (idesc->operands[!rsrc_write] == IA64_OPND_PSR_L) + { + if (dep->regindex < 32 + || dep->regindex == 35 + || dep->regindex == 36 + || (rsrc_write && dep->regindex == PSR_CPL)) + { + specs[count++] = tmpl; + } + } + else + { + /* Several PSR bits have very specific dependencies. */ + switch (dep->regindex) + { + default: + specs[count++] = tmpl; + break; + case PSR_IC: + if (rsrc_write) + { + specs[count++] = tmpl; + } + else + { + /* Only certain CR accesses use PSR.ic */ + if (idesc->operands[0] == IA64_OPND_CR3 + || idesc->operands[1] == IA64_OPND_CR3) + { + int index = + ((idesc->operands[0] == IA64_OPND_CR3) + ? 0 : 1); + int regno = + CURR_SLOT.opnd[index].X_add_number - REG_CR; + + switch (regno) + { + default: + break; + case CR_ITIR: + case CR_IFS: + case CR_IIM: + case CR_IIP: + case CR_IPSR: + case CR_ISR: + case CR_IFA: + case CR_IHA: + case CR_IIPA: + specs[count++] = tmpl; + break; + } + } + } + break; + case PSR_CPL: + if (rsrc_write) + { + specs[count++] = tmpl; + } + else + { + /* Only some AR accesses use cpl */ + if (idesc->operands[0] == IA64_OPND_AR3 + || idesc->operands[1] == IA64_OPND_AR3) + { + int index = + ((idesc->operands[0] == IA64_OPND_AR3) + ? 0 : 1); + int regno = + CURR_SLOT.opnd[index].X_add_number - REG_AR; + + if (regno == AR_ITC + || (index == 0 + && (regno == AR_ITC + || regno == AR_RSC + || (regno >= AR_K0 + && regno <= AR_K7)))) + { + specs[count++] = tmpl; + } + } + else + { + specs[count++] = tmpl; + } + break; + } + } + } + } + else if (note == 7) + { + valueT mask = 0; + if (idesc->operands[0] == IA64_OPND_IMMU24) + { + mask = CURR_SLOT.opnd[0].X_add_number; + } + else + { + UNHANDLED; + } + if (mask & ((valueT) 1 << dep->regindex)) + { + specs[count++] = tmpl; + } + } + else if (note == 8) + { + int min = dep->regindex == PSR_DFL ? 2 : 32; + int max = dep->regindex == PSR_DFL ? 31 : 127; + /* dfh is read on FR32-127; dfl is read on FR2-31 */ + for (i = 0; i < NELEMS (idesc->operands); i++) + { + if (idesc->operands[i] == IA64_OPND_F1 + || idesc->operands[i] == IA64_OPND_F2 + || idesc->operands[i] == IA64_OPND_F3 + || idesc->operands[i] == IA64_OPND_F4) + { + int reg = CURR_SLOT.opnd[i].X_add_number - REG_FR; + if (reg >= min && reg <= max) + { + specs[count++] = tmpl; + } + } + } + } + else if (note == 9) + { + int min = dep->regindex == PSR_MFL ? 2 : 32; + int max = dep->regindex == PSR_MFL ? 31 : 127; + /* mfh is read on writes to FR32-127; mfl is read on writes to + FR2-31 */ + for (i = 0; i < idesc->num_outputs; i++) + { + if (idesc->operands[i] == IA64_OPND_F1) + { + int reg = CURR_SLOT.opnd[i].X_add_number - REG_FR; + if (reg >= min && reg <= max) + { + specs[count++] = tmpl; + } + } + } + } + else if (note == 10) + { + for (i = 0; i < NELEMS (idesc->operands); i++) + { + if (idesc->operands[i] == IA64_OPND_R1 + || idesc->operands[i] == IA64_OPND_R2 + || idesc->operands[i] == IA64_OPND_R3) + { + int regno = CURR_SLOT.opnd[i].X_add_number - REG_GR; + if (regno >= 16 && regno <= 31) + { + specs[count++] = tmpl; + } + } + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_AR_FPSR: + if (idesc->operands[!rsrc_write] == IA64_OPND_AR3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_AR; + if (regno == AR_FPSR) + { + specs[count++] = tmpl; + } + } + else + { + specs[count++] = tmpl; + } + break; + + case IA64_RS_ARX: + /* Handle all AR[REG] resources */ + if (note == 0 || note == 1) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_AR; + if (idesc->operands[!rsrc_write] == IA64_OPND_AR3 + && regno == dep->regindex) + { + specs[count++] = tmpl; + } + /* other AR[REG] resources may be affected by AR accesses */ + else if (idesc->operands[0] == IA64_OPND_AR3) + { + /* AR[] writes */ + regno = CURR_SLOT.opnd[0].X_add_number - REG_AR; + switch (dep->regindex) + { + default: + break; + case AR_BSP: + case AR_RNAT: + if (regno == AR_BSPSTORE) + { + specs[count++] = tmpl; + } + case AR_RSC: + if (!rsrc_write && + (regno == AR_BSPSTORE + || regno == AR_RNAT)) + { + specs[count++] = tmpl; + } + break; + } + } + else if (idesc->operands[1] == IA64_OPND_AR3) + { + /* AR[] reads */ + regno = CURR_SLOT.opnd[1].X_add_number - REG_AR; + switch (dep->regindex) + { + default: + break; + case AR_RSC: + if (regno == AR_BSPSTORE || regno == AR_RNAT) + { + specs[count++] = tmpl; + } + break; + } + } + else + { + specs[count++] = tmpl; + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_CRX: + /* Handle all CR[REG] resources */ + if (note == 0 || note == 1) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_CR3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_CR; + if (regno == dep->regindex) + { + specs[count++] = tmpl; + } + else if (!rsrc_write) + { + /* Reads from CR[IVR] affect other resources. */ + if (regno == CR_IVR) + { + if ((dep->regindex >= CR_IRR0 + && dep->regindex <= CR_IRR3) + || dep->regindex == CR_TPR) + { + specs[count++] = tmpl; + } + } + } + } + else + { + specs[count++] = tmpl; + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_INSERVICE: + /* look for write of EOI (67) or read of IVR (65) */ + if ((idesc->operands[0] == IA64_OPND_CR3 + && CURR_SLOT.opnd[0].X_add_number - REG_CR == CR_EOI) + || (idesc->operands[1] == IA64_OPND_CR3 + && CURR_SLOT.opnd[1].X_add_number - REG_CR == CR_IVR)) + { + specs[count++] = tmpl; + } + break; + + case IA64_RS_GR0: + if (note == 1) + { + specs[count++] = tmpl; + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_CFM: + if (note != 2) + { + specs[count++] = tmpl; + } + else + { + /* Check if any of the registers accessed are in the rotating region. + mov to/from pr accesses CFM only when qp_regno is in the rotating + region */ + for (i = 0; i < NELEMS (idesc->operands); i++) + { + if (idesc->operands[i] == IA64_OPND_R1 + || idesc->operands[i] == IA64_OPND_R2 + || idesc->operands[i] == IA64_OPND_R3) + { + int num = CURR_SLOT.opnd[i].X_add_number - REG_GR; + /* Assumes that md.rot.num_regs is always valid */ + if (md.rot.num_regs > 0 + && num > 31 + && num < 31 + md.rot.num_regs) + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + else if (idesc->operands[i] == IA64_OPND_F1 + || idesc->operands[i] == IA64_OPND_F2 + || idesc->operands[i] == IA64_OPND_F3 + || idesc->operands[i] == IA64_OPND_F4) + { + int num = CURR_SLOT.opnd[i].X_add_number - REG_FR; + if (num > 31) + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + else if (idesc->operands[i] == IA64_OPND_P1 + || idesc->operands[i] == IA64_OPND_P2) + { + int num = CURR_SLOT.opnd[i].X_add_number - REG_P; + if (num > 15) + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + } + if (CURR_SLOT.qp_regno > 15) + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + break; + + /* This is the same as IA64_RS_PRr, except simplified to account for + the fact that there is only one register. */ + case IA64_RS_PR63: + if (note == 0) + { + specs[count++] = tmpl; + } + else if (note == 7) + { + valueT mask = 0; + if (idesc->operands[2] == IA64_OPND_IMM17) + mask = CURR_SLOT.opnd[2].X_add_number; + if (mask & ((valueT) 1 << 63)) + specs[count++] = tmpl; + } + else if (note == 11) + { + if ((idesc->operands[0] == IA64_OPND_P1 + && CURR_SLOT.opnd[0].X_add_number - REG_P == 63) + || (idesc->operands[1] == IA64_OPND_P2 + && CURR_SLOT.opnd[1].X_add_number - REG_P == 63)) + { + specs[count++] = tmpl; + } + } + else if (note == 12) + { + if (CURR_SLOT.qp_regno == 63) + { + specs[count++] = tmpl; + } + } + else if (note == 1) + { + if (rsrc_write) + { + int p1 = CURR_SLOT.opnd[0].X_add_number - REG_P; + int p2 = CURR_SLOT.opnd[1].X_add_number - REG_P; + int or_andcm = strstr(idesc->name, "or.andcm") != NULL; + int and_orcm = strstr(idesc->name, "and.orcm") != NULL; + + if (p1 == 63 + && (idesc->operands[0] == IA64_OPND_P1 + || idesc->operands[0] == IA64_OPND_P2)) + { + specs[count] = tmpl; + specs[count++].cmp_type = + (or_andcm ? CMP_OR : (and_orcm ? CMP_AND : CMP_NONE)); + } + if (p2 == 63 + && (idesc->operands[1] == IA64_OPND_P1 + || idesc->operands[1] == IA64_OPND_P2)) + { + specs[count] = tmpl; + specs[count++].cmp_type = + (or_andcm ? CMP_AND : (and_orcm ? CMP_OR : CMP_NONE)); + } + } + else + { + if (CURR_SLOT.qp_regno == 63) + { + specs[count++] = tmpl; + } + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_RSE: + /* FIXME we can identify some individual RSE written resources, but RSE + read resources have not yet been completely identified, so for now + treat RSE as a single resource */ + if (strncmp (idesc->name, "mov", 3) == 0) + { + if (rsrc_write) + { + if (idesc->operands[0] == IA64_OPND_AR3 + && CURR_SLOT.opnd[0].X_add_number - REG_AR == AR_BSPSTORE) + { + specs[count] = tmpl; + specs[count++].index = 0; /* IA64_RSE_BSPLOAD/RNATBITINDEX */ + } + } + else + { + if (idesc->operands[0] == IA64_OPND_AR3) + { + if (CURR_SLOT.opnd[0].X_add_number - REG_AR == AR_BSPSTORE + || CURR_SLOT.opnd[0].X_add_number - REG_AR == AR_RNAT) + { + specs[count++] = tmpl; + } + } + else if (idesc->operands[1] == IA64_OPND_AR3) + { + if (CURR_SLOT.opnd[1].X_add_number - REG_AR == AR_BSP + || CURR_SLOT.opnd[1].X_add_number - REG_AR == AR_BSPSTORE + || CURR_SLOT.opnd[1].X_add_number - REG_AR == AR_RNAT) + { + specs[count++] = tmpl; + } + } + } + } + else + { + specs[count++] = tmpl; + } + break; + + case IA64_RS_ANY: + /* FIXME -- do any of these need to be non-specific? */ + specs[count++] = tmpl; + break; + + default: + as_bad (_("Unrecognized dependency specifier %d\n"), dep->specifier); + break; + } + + return count; +} + +/* Clear branch flags on marked resources. This breaks the link between the + QP of the marking instruction and a subsequent branch on the same QP. */ + +static void +clear_qp_branch_flag (mask) + valueT mask; +{ + int i; + for (i = 0; i < regdepslen; i++) + { + valueT bit = ((valueT) 1 << regdeps[i].qp_regno); + if ((bit & mask) != 0) + { + regdeps[i].link_to_qp_branch = 0; + } + } +} + +/* Remove any mutexes which contain any of the PRs indicated in the mask. + + Any changes to a PR clears the mutex relations which include that PR. */ + +static void +clear_qp_mutex (mask) + valueT mask; +{ + int i; + + i = 0; + while (i < qp_mutexeslen) + { + if ((qp_mutexes[i].prmask & mask) != 0) + { + if (md.debug_dv) + { + fprintf (stderr, " Clearing mutex relation"); + print_prmask (qp_mutexes[i].prmask); + fprintf (stderr, "\n"); + } + qp_mutexes[i] = qp_mutexes[--qp_mutexeslen]; + } + else + ++i; + } +} + +/* Clear implies relations which contain PRs in the given masks. + P1_MASK indicates the source of the implies relation, while P2_MASK + indicates the implied PR. */ + +static void +clear_qp_implies (p1_mask, p2_mask) + valueT p1_mask; + valueT p2_mask; +{ + int i; + + i = 0; + while (i < qp_implieslen) + { + if ((((valueT) 1 << qp_implies[i].p1) & p1_mask) != 0 + || (((valueT) 1 << qp_implies[i].p2) & p2_mask) != 0) + { + if (md.debug_dv) + fprintf (stderr, "Clearing implied relation PR%d->PR%d\n", + qp_implies[i].p1, qp_implies[i].p2); + qp_implies[i] = qp_implies[--qp_implieslen]; + } + else + ++i; + } +} + +/* Add the PRs specified to the list of implied relations. */ + +static void +add_qp_imply (p1, p2) + int p1, p2; +{ + valueT mask; + valueT bit; + int i; + + /* p0 is not meaningful here. */ + if (p1 == 0 || p2 == 0) + abort (); + + if (p1 == p2) + return; + + /* If it exists already, ignore it. */ + for (i = 0; i < qp_implieslen; i++) + { + if (qp_implies[i].p1 == p1 + && qp_implies[i].p2 == p2 + && qp_implies[i].path == md.path + && !qp_implies[i].p2_branched) + return; + } + + if (qp_implieslen == qp_impliestotlen) + { + qp_impliestotlen += 20; + qp_implies = (struct qp_imply *) + xrealloc ((void *) qp_implies, + qp_impliestotlen * sizeof (struct qp_imply)); + } + if (md.debug_dv) + fprintf (stderr, " Registering PR%d implies PR%d\n", p1, p2); + qp_implies[qp_implieslen].p1 = p1; + qp_implies[qp_implieslen].p2 = p2; + qp_implies[qp_implieslen].path = md.path; + qp_implies[qp_implieslen++].p2_branched = 0; + + /* Add in the implied transitive relations; for everything that p2 implies, + make p1 imply that, too; for everything that implies p1, make it imply p2 + as well. */ + for (i = 0; i < qp_implieslen; i++) + { + if (qp_implies[i].p1 == p2) + add_qp_imply (p1, qp_implies[i].p2); + if (qp_implies[i].p2 == p1) + add_qp_imply (qp_implies[i].p1, p2); + } + /* Add in mutex relations implied by this implies relation; for each mutex + relation containing p2, duplicate it and replace p2 with p1. */ + bit = (valueT) 1 << p1; + mask = (valueT) 1 << p2; + for (i = 0; i < qp_mutexeslen; i++) + { + if (qp_mutexes[i].prmask & mask) + add_qp_mutex ((qp_mutexes[i].prmask & ~mask) | bit); + } +} + +/* Add the PRs specified in the mask to the mutex list; this means that only + one of the PRs can be true at any time. PR0 should never be included in + the mask. */ + +static void +add_qp_mutex (mask) + valueT mask; +{ + if (mask & 0x1) + abort (); + + if (qp_mutexeslen == qp_mutexestotlen) + { + qp_mutexestotlen += 20; + qp_mutexes = (struct qpmutex *) + xrealloc ((void *) qp_mutexes, + qp_mutexestotlen * sizeof (struct qpmutex)); + } + if (md.debug_dv) + { + fprintf (stderr, " Registering mutex on"); + print_prmask (mask); + fprintf (stderr, "\n"); + } + qp_mutexes[qp_mutexeslen].path = md.path; + qp_mutexes[qp_mutexeslen++].prmask = mask; +} + +static void +clear_register_values () +{ + int i; + if (md.debug_dv) + fprintf (stderr, " Clearing register values\n"); + for (i = 1; i < NELEMS (gr_values); i++) + gr_values[i].known = 0; +} + +/* Keep track of register values/changes which affect DV tracking. + + optimization note: should add a flag to classes of insns where otherwise we + have to examine a group of strings to identify them. */ + +static void +note_register_values (idesc) + struct ia64_opcode *idesc; +{ + valueT qp_changemask = 0; + int i; + + /* Invalidate values for registers being written to. */ + for (i = 0; i < idesc->num_outputs; i++) + { + if (idesc->operands[i] == IA64_OPND_R1 + || idesc->operands[i] == IA64_OPND_R2 + || idesc->operands[i] == IA64_OPND_R3) + { + int regno = CURR_SLOT.opnd[i].X_add_number - REG_GR; + if (regno > 0 && regno < NELEMS (gr_values)) + gr_values[regno].known = 0; + } + else if (idesc->operands[i] == IA64_OPND_R3_2) + { + int regno = CURR_SLOT.opnd[i].X_add_number - REG_GR; + if (regno > 0 && regno < 4) + gr_values[regno].known = 0; + } + else if (idesc->operands[i] == IA64_OPND_P1 + || idesc->operands[i] == IA64_OPND_P2) + { + int regno = CURR_SLOT.opnd[i].X_add_number - REG_P; + qp_changemask |= (valueT) 1 << regno; + } + else if (idesc->operands[i] == IA64_OPND_PR) + { + if (idesc->operands[2] & (valueT) 0x10000) + qp_changemask = ~(valueT) 0x1FFFF | idesc->operands[2]; + else + qp_changemask = idesc->operands[2]; + break; + } + else if (idesc->operands[i] == IA64_OPND_PR_ROT) + { + if (idesc->operands[1] & ((valueT) 1 << 43)) + qp_changemask = ~(valueT) 0xFFFFFFFFFFF | idesc->operands[1]; + else + qp_changemask = idesc->operands[1]; + qp_changemask &= ~(valueT) 0xFFFF; + break; + } + } + + /* Always clear qp branch flags on any PR change. */ + /* FIXME there may be exceptions for certain compares. */ + clear_qp_branch_flag (qp_changemask); + + /* Invalidate rotating registers on insns which affect RRBs in CFM. */ + if (idesc->flags & IA64_OPCODE_MOD_RRBS) + { + qp_changemask |= ~(valueT) 0xFFFF; + if (strcmp (idesc->name, "clrrrb.pr") != 0) + { + for (i = 32; i < 32 + md.rot.num_regs; i++) + gr_values[i].known = 0; + } + clear_qp_mutex (qp_changemask); + clear_qp_implies (qp_changemask, qp_changemask); + } + /* After a call, all register values are undefined, except those marked + as "safe". */ + else if (strncmp (idesc->name, "br.call", 6) == 0 + || strncmp (idesc->name, "brl.call", 7) == 0) + { + /* FIXME keep GR values which are marked as "safe_across_calls" */ + clear_register_values (); + clear_qp_mutex (~qp_safe_across_calls); + clear_qp_implies (~qp_safe_across_calls, ~qp_safe_across_calls); + clear_qp_branch_flag (~qp_safe_across_calls); + } + else if (is_interruption_or_rfi (idesc) + || is_taken_branch (idesc)) + { + clear_register_values (); + clear_qp_mutex (~(valueT) 0); + clear_qp_implies (~(valueT) 0, ~(valueT) 0); + } + /* Look for mutex and implies relations. */ + else if ((idesc->operands[0] == IA64_OPND_P1 + || idesc->operands[0] == IA64_OPND_P2) + && (idesc->operands[1] == IA64_OPND_P1 + || idesc->operands[1] == IA64_OPND_P2)) + { + int p1 = CURR_SLOT.opnd[0].X_add_number - REG_P; + int p2 = CURR_SLOT.opnd[1].X_add_number - REG_P; + valueT p1mask = (valueT) 1 << p1; + valueT p2mask = (valueT) 1 << p2; + + /* If one of the PRs is PR0, we can't really do anything. */ + if (p1 == 0 || p2 == 0) + { + if (md.debug_dv) + fprintf (stderr, " Ignoring PRs due to inclusion of p0\n"); + } + /* In general, clear mutexes and implies which include P1 or P2, + with the following exceptions. */ + else if (strstr (idesc->name, ".or.andcm") != NULL) + { + add_qp_mutex (p1mask | p2mask); + clear_qp_implies (p2mask, p1mask); + } + else if (strstr (idesc->name, ".and.orcm") != NULL) + { + add_qp_mutex (p1mask | p2mask); + clear_qp_implies (p1mask, p2mask); + } + else if (strstr (idesc->name, ".and") != NULL) + { + clear_qp_implies (0, p1mask | p2mask); + } + else if (strstr (idesc->name, ".or") != NULL) + { + clear_qp_mutex (p1mask | p2mask); + clear_qp_implies (p1mask | p2mask, 0); + } + else + { + clear_qp_implies (p1mask | p2mask, p1mask | p2mask); + if (strstr (idesc->name, ".unc") != NULL) + { + add_qp_mutex (p1mask | p2mask); + if (CURR_SLOT.qp_regno != 0) + { + add_qp_imply (CURR_SLOT.opnd[0].X_add_number - REG_P, + CURR_SLOT.qp_regno); + add_qp_imply (CURR_SLOT.opnd[1].X_add_number - REG_P, + CURR_SLOT.qp_regno); + } + } + else if (CURR_SLOT.qp_regno == 0) + { + add_qp_mutex (p1mask | p2mask); + } + else + { + clear_qp_mutex (p1mask | p2mask); + } + } + } + /* Look for mov imm insns into GRs. */ + else if (idesc->operands[0] == IA64_OPND_R1 + && (idesc->operands[1] == IA64_OPND_IMM22 + || idesc->operands[1] == IA64_OPND_IMMU64) + && (strcmp (idesc->name, "mov") == 0 + || strcmp (idesc->name, "movl") == 0)) + { + int regno = CURR_SLOT.opnd[0].X_add_number - REG_GR; + if (regno > 0 && regno < NELEMS (gr_values)) + { + gr_values[regno].known = 1; + gr_values[regno].value = CURR_SLOT.opnd[1].X_add_number; + gr_values[regno].path = md.path; + if (md.debug_dv) + { + fprintf (stderr, " Know gr%d = ", regno); + fprintf_vma (stderr, gr_values[regno].value); + fputs ("\n", stderr); + } + } + } + else + { + clear_qp_mutex (qp_changemask); + clear_qp_implies (qp_changemask, qp_changemask); + } +} + +/* Return whether the given predicate registers are currently mutex. */ + +static int +qp_mutex (p1, p2, path) + int p1; + int p2; + int path; +{ + int i; + valueT mask; + + if (p1 != p2) + { + mask = ((valueT) 1 << p1) | (valueT) 1 << p2; + for (i = 0; i < qp_mutexeslen; i++) + { + if (qp_mutexes[i].path >= path + && (qp_mutexes[i].prmask & mask) == mask) + return 1; + } + } + return 0; +} + +/* Return whether the given resource is in the given insn's list of chks + Return 1 if the conflict is absolutely determined, 2 if it's a potential + conflict. */ + +static int +resources_match (rs, idesc, note, qp_regno, path) + struct rsrc *rs; + struct ia64_opcode *idesc; + int note; + int qp_regno; + int path; +{ + struct rsrc specs[MAX_SPECS]; + int count; + + /* If the marked resource's qp_regno and the given qp_regno are mutex, + we don't need to check. One exception is note 11, which indicates that + target predicates are written regardless of PR[qp]. */ + if (qp_mutex (rs->qp_regno, qp_regno, path) + && note != 11) + return 0; + + count = specify_resource (rs->dependency, idesc, DV_CHK, specs, note, path); + while (count-- > 0) + { + /* UNAT checking is a bit more specific than other resources */ + if (rs->dependency->specifier == IA64_RS_AR_UNAT + && specs[count].mem_offset.hint + && rs->mem_offset.hint) + { + if (rs->mem_offset.base == specs[count].mem_offset.base) + { + if (((rs->mem_offset.offset >> 3) & 0x3F) == + ((specs[count].mem_offset.offset >> 3) & 0x3F)) + return 1; + else + continue; + } + } + + /* Skip apparent PR write conflicts where both writes are an AND or both + writes are an OR. */ + if (rs->dependency->specifier == IA64_RS_PR + || rs->dependency->specifier == IA64_RS_PRr + || rs->dependency->specifier == IA64_RS_PR63) + { + if (specs[count].cmp_type != CMP_NONE + && specs[count].cmp_type == rs->cmp_type) + { + if (md.debug_dv) + fprintf (stderr, " %s on parallel compare allowed (PR%d)\n", + dv_mode[rs->dependency->mode], + rs->dependency->specifier != IA64_RS_PR63 ? + specs[count].index : 63); + continue; + } + if (md.debug_dv) + fprintf (stderr, + " %s on parallel compare conflict %s vs %s on PR%d\n", + dv_mode[rs->dependency->mode], + dv_cmp_type[rs->cmp_type], + dv_cmp_type[specs[count].cmp_type], + rs->dependency->specifier != IA64_RS_PR63 ? + specs[count].index : 63); + + } + + /* If either resource is not specific, conservatively assume a conflict + */ + if (!specs[count].specific || !rs->specific) + return 2; + else if (specs[count].index == rs->index) + return 1; + } +#if 0 + if (md.debug_dv) + fprintf (stderr, " No %s conflicts\n", rs->dependency->name); +#endif + + return 0; +} + +/* Indicate an instruction group break; if INSERT_STOP is non-zero, then + insert a stop to create the break. Update all resource dependencies + appropriately. If QP_REGNO is non-zero, only apply the break to resources + which use the same QP_REGNO and have the link_to_qp_branch flag set. + If SAVE_CURRENT is non-zero, don't affect resources marked by the current + instruction. */ + +static void +insn_group_break (insert_stop, qp_regno, save_current) + int insert_stop; + int qp_regno; + int save_current; +{ + int i; + + if (insert_stop && md.num_slots_in_use > 0) + PREV_SLOT.end_of_insn_group = 1; + + if (md.debug_dv) + { + fprintf (stderr, " Insn group break%s", + (insert_stop ? " (w/stop)" : "")); + if (qp_regno != 0) + fprintf (stderr, " effective for QP=%d", qp_regno); + fprintf (stderr, "\n"); + } + + i = 0; + while (i < regdepslen) + { + const struct ia64_dependency *dep = regdeps[i].dependency; + + if (qp_regno != 0 + && regdeps[i].qp_regno != qp_regno) + { + ++i; + continue; + } + + if (save_current + && CURR_SLOT.src_file == regdeps[i].file + && CURR_SLOT.src_line == regdeps[i].line) + { + ++i; + continue; + } + + /* clear dependencies which are automatically cleared by a stop, or + those that have reached the appropriate state of insn serialization */ + if (dep->semantics == IA64_DVS_IMPLIED + || dep->semantics == IA64_DVS_IMPLIEDF + || regdeps[i].insn_srlz == STATE_SRLZ) + { + print_dependency ("Removing", i); + regdeps[i] = regdeps[--regdepslen]; + } + else + { + if (dep->semantics == IA64_DVS_DATA + || dep->semantics == IA64_DVS_INSTR + || dep->semantics == IA64_DVS_SPECIFIC) + { + if (regdeps[i].insn_srlz == STATE_NONE) + regdeps[i].insn_srlz = STATE_STOP; + if (regdeps[i].data_srlz == STATE_NONE) + regdeps[i].data_srlz = STATE_STOP; + } + ++i; + } + } +} + +/* Add the given resource usage spec to the list of active dependencies. */ + +static void +mark_resource (idesc, dep, spec, depind, path) + struct ia64_opcode *idesc ATTRIBUTE_UNUSED; + const struct ia64_dependency *dep ATTRIBUTE_UNUSED; + struct rsrc *spec; + int depind; + int path; +{ + if (regdepslen == regdepstotlen) + { + regdepstotlen += 20; + regdeps = (struct rsrc *) + xrealloc ((void *) regdeps, + regdepstotlen * sizeof (struct rsrc)); + } + + regdeps[regdepslen] = *spec; + regdeps[regdepslen].depind = depind; + regdeps[regdepslen].path = path; + regdeps[regdepslen].file = CURR_SLOT.src_file; + regdeps[regdepslen].line = CURR_SLOT.src_line; + + print_dependency ("Adding", regdepslen); + + ++regdepslen; +} + +static void +print_dependency (action, depind) + const char *action; + int depind; +{ + if (md.debug_dv) + { + fprintf (stderr, " %s %s '%s'", + action, dv_mode[(regdeps[depind].dependency)->mode], + (regdeps[depind].dependency)->name); + if (regdeps[depind].specific && regdeps[depind].index != 0) + fprintf (stderr, " (%d)", regdeps[depind].index); + if (regdeps[depind].mem_offset.hint) + { + fputs (" ", stderr); + fprintf_vma (stderr, regdeps[depind].mem_offset.base); + fputs ("+", stderr); + fprintf_vma (stderr, regdeps[depind].mem_offset.offset); + } + fprintf (stderr, "\n"); + } +} + +static void +instruction_serialization () +{ + int i; + if (md.debug_dv) + fprintf (stderr, " Instruction serialization\n"); + for (i = 0; i < regdepslen; i++) + if (regdeps[i].insn_srlz == STATE_STOP) + regdeps[i].insn_srlz = STATE_SRLZ; +} + +static void +data_serialization () +{ + int i = 0; + if (md.debug_dv) + fprintf (stderr, " Data serialization\n"); + while (i < regdepslen) + { + if (regdeps[i].data_srlz == STATE_STOP + /* Note: as of 991210, all "other" dependencies are cleared by a + data serialization. This might change with new tables */ + || (regdeps[i].dependency)->semantics == IA64_DVS_OTHER) + { + print_dependency ("Removing", i); + regdeps[i] = regdeps[--regdepslen]; + } + else + ++i; + } +} + +/* Insert stops and serializations as needed to avoid DVs. */ + +static void +remove_marked_resource (rs) + struct rsrc *rs; +{ + switch (rs->dependency->semantics) + { + case IA64_DVS_SPECIFIC: + if (md.debug_dv) + fprintf (stderr, "Implementation-specific, assume worst case...\n"); + /* ...fall through... */ + case IA64_DVS_INSTR: + if (md.debug_dv) + fprintf (stderr, "Inserting instr serialization\n"); + if (rs->insn_srlz < STATE_STOP) + insn_group_break (1, 0, 0); + if (rs->insn_srlz < STATE_SRLZ) + { + int oldqp = CURR_SLOT.qp_regno; + struct ia64_opcode *oldidesc = CURR_SLOT.idesc; + /* Manually jam a srlz.i insn into the stream */ + CURR_SLOT.qp_regno = 0; + CURR_SLOT.idesc = ia64_find_opcode ("srlz.i"); + instruction_serialization (); + md.curr_slot = (md.curr_slot + 1) % NUM_SLOTS; + if (++md.num_slots_in_use >= NUM_SLOTS) + emit_one_bundle (); + CURR_SLOT.qp_regno = oldqp; + CURR_SLOT.idesc = oldidesc; + } + insn_group_break (1, 0, 0); + break; + case IA64_DVS_OTHER: /* as of rev2 (991220) of the DV tables, all + "other" types of DV are eliminated + by a data serialization */ + case IA64_DVS_DATA: + if (md.debug_dv) + fprintf (stderr, "Inserting data serialization\n"); + if (rs->data_srlz < STATE_STOP) + insn_group_break (1, 0, 0); + { + int oldqp = CURR_SLOT.qp_regno; + struct ia64_opcode *oldidesc = CURR_SLOT.idesc; + /* Manually jam a srlz.d insn into the stream */ + CURR_SLOT.qp_regno = 0; + CURR_SLOT.idesc = ia64_find_opcode ("srlz.d"); + data_serialization (); + md.curr_slot = (md.curr_slot + 1) % NUM_SLOTS; + if (++md.num_slots_in_use >= NUM_SLOTS) + emit_one_bundle (); + CURR_SLOT.qp_regno = oldqp; + CURR_SLOT.idesc = oldidesc; + } + break; + case IA64_DVS_IMPLIED: + case IA64_DVS_IMPLIEDF: + if (md.debug_dv) + fprintf (stderr, "Inserting stop\n"); + insn_group_break (1, 0, 0); + break; + default: + break; + } +} + +/* Check the resources used by the given opcode against the current dependency + list. + + The check is run once for each execution path encountered. In this case, + a unique execution path is the sequence of instructions following a code + entry point, e.g. the following has three execution paths, one starting + at L0, one at L1, and one at L2. + + L0: nop + L1: add + L2: add + br.ret +*/ + +static void +check_dependencies (idesc) + struct ia64_opcode *idesc; +{ + const struct ia64_opcode_dependency *opdeps = idesc->dependencies; + int path; + int i; + + /* Note that the number of marked resources may change within the + loop if in auto mode. */ + i = 0; + while (i < regdepslen) + { + struct rsrc *rs = ®deps[i]; + const struct ia64_dependency *dep = rs->dependency; + int chkind; + int note; + int start_over = 0; + + if (dep->semantics == IA64_DVS_NONE + || (chkind = depends_on (rs->depind, idesc)) == -1) + { + ++i; + continue; + } + + note = NOTE (opdeps->chks[chkind]); + + /* Check this resource against each execution path seen thus far. */ + for (path = 0; path <= md.path; path++) + { + int matchtype; + + /* If the dependency wasn't on the path being checked, ignore it. */ + if (rs->path < path) + continue; + + /* If the QP for this insn implies a QP which has branched, don't + bother checking. Ed. NOTE: I don't think this check is terribly + useful; what's the point of generating code which will only be + reached if its QP is zero? + This code was specifically inserted to handle the following code, + based on notes from Intel's DV checking code, where p1 implies p2. + + mov r4 = 2 + (p2) br.cond L + (p1) mov r4 = 7 + */ + if (CURR_SLOT.qp_regno != 0) + { + int skip = 0; + int implies; + for (implies = 0; implies < qp_implieslen; implies++) + { + if (qp_implies[implies].path >= path + && qp_implies[implies].p1 == CURR_SLOT.qp_regno + && qp_implies[implies].p2_branched) + { + skip = 1; + break; + } + } + if (skip) + continue; + } + + if ((matchtype = resources_match (rs, idesc, note, + CURR_SLOT.qp_regno, path)) != 0) + { + char msg[1024]; + char pathmsg[256] = ""; + char indexmsg[256] = ""; + int certain = (matchtype == 1 && CURR_SLOT.qp_regno == 0); + + if (path != 0) + sprintf (pathmsg, " when entry is at label '%s'", + md.entry_labels[path - 1]); + if (rs->specific && rs->index != 0) + sprintf (indexmsg, ", specific resource number is %d", + rs->index); + sprintf (msg, "Use of '%s' %s %s dependency '%s' (%s)%s%s", + idesc->name, + (certain ? "violates" : "may violate"), + dv_mode[dep->mode], dep->name, + dv_sem[dep->semantics], + pathmsg, indexmsg); + + if (md.explicit_mode) + { + as_warn ("%s", msg); + if (path < md.path) + as_warn (_("Only the first path encountering the conflict " + "is reported")); + as_warn_where (rs->file, rs->line, + _("This is the location of the " + "conflicting usage")); + /* Don't bother checking other paths, to avoid duplicating + the same warning */ + break; + } + else + { + if (md.debug_dv) + fprintf (stderr, "%s @ %s:%d\n", msg, rs->file, rs->line); + + remove_marked_resource (rs); + + /* since the set of dependencies has changed, start over */ + /* FIXME -- since we're removing dvs as we go, we + probably don't really need to start over... */ + start_over = 1; + break; + } + } + } + if (start_over) + i = 0; + else + ++i; + } +} + +/* Register new dependencies based on the given opcode. */ + +static void +mark_resources (idesc) + struct ia64_opcode *idesc; +{ + int i; + const struct ia64_opcode_dependency *opdeps = idesc->dependencies; + int add_only_qp_reads = 0; + + /* A conditional branch only uses its resources if it is taken; if it is + taken, we stop following that path. The other branch types effectively + *always* write their resources. If it's not taken, register only QP + reads. */ + if (is_conditional_branch (idesc) || is_interruption_or_rfi (idesc)) + { + add_only_qp_reads = 1; + } + + if (md.debug_dv) + fprintf (stderr, "Registering '%s' resource usage\n", idesc->name); + + for (i = 0; i < opdeps->nregs; i++) + { + const struct ia64_dependency *dep; + struct rsrc specs[MAX_SPECS]; + int note; + int path; + int count; + + dep = ia64_find_dependency (opdeps->regs[i]); + note = NOTE (opdeps->regs[i]); + + if (add_only_qp_reads + && !(dep->mode == IA64_DV_WAR + && (dep->specifier == IA64_RS_PR + || dep->specifier == IA64_RS_PRr + || dep->specifier == IA64_RS_PR63))) + continue; + + count = specify_resource (dep, idesc, DV_REG, specs, note, md.path); + +#if 0 + if (md.debug_dv && !count) + fprintf (stderr, " No %s %s usage found (path %d)\n", + dv_mode[dep->mode], dep->name, md.path); +#endif + + while (count-- > 0) + { + mark_resource (idesc, dep, &specs[count], + DEP (opdeps->regs[i]), md.path); + } + + /* The execution path may affect register values, which may in turn + affect which indirect-access resources are accessed. */ + switch (dep->specifier) + { + default: + break; + case IA64_RS_CPUID: + case IA64_RS_DBR: + case IA64_RS_IBR: + case IA64_RS_MSR: + case IA64_RS_PKR: + case IA64_RS_PMC: + case IA64_RS_PMD: + case IA64_RS_RR: + for (path = 0; path < md.path; path++) + { + count = specify_resource (dep, idesc, DV_REG, specs, note, path); + while (count-- > 0) + mark_resource (idesc, dep, &specs[count], + DEP (opdeps->regs[i]), path); + } + break; + } + } +} + +/* Remove dependencies when they no longer apply. */ + +static void +update_dependencies (idesc) + struct ia64_opcode *idesc; +{ + int i; + + if (strcmp (idesc->name, "srlz.i") == 0) + { + instruction_serialization (); + } + else if (strcmp (idesc->name, "srlz.d") == 0) + { + data_serialization (); + } + else if (is_interruption_or_rfi (idesc) + || is_taken_branch (idesc)) + { + /* Although technically the taken branch doesn't clear dependencies + which require a srlz.[id], we don't follow the branch; the next + instruction is assumed to start with a clean slate. */ + regdepslen = 0; + md.path = 0; + } + else if (is_conditional_branch (idesc) + && CURR_SLOT.qp_regno != 0) + { + int is_call = strstr (idesc->name, ".call") != NULL; + + for (i = 0; i < qp_implieslen; i++) + { + /* If the conditional branch's predicate is implied by the predicate + in an existing dependency, remove that dependency. */ + if (qp_implies[i].p2 == CURR_SLOT.qp_regno) + { + int depind = 0; + /* Note that this implied predicate takes a branch so that if + a later insn generates a DV but its predicate implies this + one, we can avoid the false DV warning. */ + qp_implies[i].p2_branched = 1; + while (depind < regdepslen) + { + if (regdeps[depind].qp_regno == qp_implies[i].p1) + { + print_dependency ("Removing", depind); + regdeps[depind] = regdeps[--regdepslen]; + } + else + ++depind; + } + } + } + /* Any marked resources which have this same predicate should be + cleared, provided that the QP hasn't been modified between the + marking instruction and the branch. */ + if (is_call) + { + insn_group_break (0, CURR_SLOT.qp_regno, 1); + } + else + { + i = 0; + while (i < regdepslen) + { + if (regdeps[i].qp_regno == CURR_SLOT.qp_regno + && regdeps[i].link_to_qp_branch + && (regdeps[i].file != CURR_SLOT.src_file + || regdeps[i].line != CURR_SLOT.src_line)) + { + /* Treat like a taken branch */ + print_dependency ("Removing", i); + regdeps[i] = regdeps[--regdepslen]; + } + else + ++i; + } + } + } +} + +/* Examine the current instruction for dependency violations. */ + +static int +check_dv (idesc) + struct ia64_opcode *idesc; +{ + if (md.debug_dv) + { + fprintf (stderr, "Checking %s for violations (line %d, %d/%d)\n", + idesc->name, CURR_SLOT.src_line, + idesc->dependencies->nchks, + idesc->dependencies->nregs); + } + + /* Look through the list of currently marked resources; if the current + instruction has the dependency in its chks list which uses that resource, + check against the specific resources used. */ + check_dependencies (idesc); + + /* Look up the instruction's regdeps (RAW writes, WAW writes, and WAR reads), + then add them to the list of marked resources. */ + mark_resources (idesc); + + /* There are several types of dependency semantics, and each has its own + requirements for being cleared + + Instruction serialization (insns separated by interruption, rfi, or + writer + srlz.i + reader, all in separate groups) clears DVS_INSTR. + + Data serialization (instruction serialization, or writer + srlz.d + + reader, where writer and srlz.d are in separate groups) clears + DVS_DATA. (This also clears DVS_OTHER, but that is not guaranteed to + always be the case). + + Instruction group break (groups separated by stop, taken branch, + interruption or rfi) clears DVS_IMPLIED and DVS_IMPLIEDF. + */ + update_dependencies (idesc); + + /* Sometimes, knowing a register value allows us to avoid giving a false DV + warning. Keep track of as many as possible that are useful. */ + note_register_values (idesc); + + /* We don't need or want this anymore. */ + md.mem_offset.hint = 0; + + return 0; +} + +/* Translate one line of assembly. Pseudo ops and labels do not show + here. */ +void +md_assemble (str) + char *str; +{ + char *saved_input_line_pointer, *mnemonic; + const struct pseudo_opcode *pdesc; + struct ia64_opcode *idesc; + unsigned char qp_regno; + unsigned int flags; + int ch; + + saved_input_line_pointer = input_line_pointer; + input_line_pointer = str; + + /* extract the opcode (mnemonic): */ + + mnemonic = input_line_pointer; + ch = get_symbol_end (); + pdesc = (struct pseudo_opcode *) hash_find (md.pseudo_hash, mnemonic); + if (pdesc) + { + *input_line_pointer = ch; + (*pdesc->handler) (pdesc->arg); + goto done; + } + + /* Find the instruction descriptor matching the arguments. */ + + idesc = ia64_find_opcode (mnemonic); + *input_line_pointer = ch; + if (!idesc) + { + as_bad ("Unknown opcode `%s'", mnemonic); + goto done; + } + + idesc = parse_operands (idesc); + if (!idesc) + goto done; + + /* Handle the dynamic ops we can handle now: */ + if (idesc->type == IA64_TYPE_DYN) + { + if (strcmp (idesc->name, "add") == 0) + { + if (CURR_SLOT.opnd[2].X_op == O_register + && CURR_SLOT.opnd[2].X_add_number < 4) + mnemonic = "addl"; + else + mnemonic = "adds"; + ia64_free_opcode (idesc); + idesc = ia64_find_opcode (mnemonic); +#if 0 + know (!idesc->next); +#endif + } + else if (strcmp (idesc->name, "mov") == 0) + { + enum ia64_opnd opnd1, opnd2; + int rop; + + opnd1 = idesc->operands[0]; + opnd2 = idesc->operands[1]; + if (opnd1 == IA64_OPND_AR3) + rop = 0; + else if (opnd2 == IA64_OPND_AR3) + rop = 1; + else + abort (); + if (CURR_SLOT.opnd[rop].X_op == O_register + && ar_is_in_integer_unit (CURR_SLOT.opnd[rop].X_add_number)) + mnemonic = "mov.i"; + else + mnemonic = "mov.m"; + ia64_free_opcode (idesc); + idesc = ia64_find_opcode (mnemonic); + while (idesc != NULL + && (idesc->operands[0] != opnd1 + || idesc->operands[1] != opnd2)) + idesc = get_next_opcode (idesc); + } + } + + qp_regno = 0; + if (md.qp.X_op == O_register) + { + qp_regno = md.qp.X_add_number - REG_P; + md.qp.X_op = O_absent; + } + + flags = idesc->flags; + + if ((flags & IA64_OPCODE_FIRST) != 0) + insn_group_break (1, 0, 0); + + if ((flags & IA64_OPCODE_NO_PRED) != 0 && qp_regno != 0) + { + as_bad ("`%s' cannot be predicated", idesc->name); + goto done; + } + + /* Build the instruction. */ + CURR_SLOT.qp_regno = qp_regno; + CURR_SLOT.idesc = idesc; + as_where (&CURR_SLOT.src_file, &CURR_SLOT.src_line); + dwarf2_where (&CURR_SLOT.debug_line); + + /* Add unwind entry, if there is one. */ + if (unwind.current_entry) + { + CURR_SLOT.unwind_record = unwind.current_entry; + unwind.current_entry = NULL; + } + + /* Check for dependency violations. */ + if (md.detect_dv) + check_dv (idesc); + + md.curr_slot = (md.curr_slot + 1) % NUM_SLOTS; + if (++md.num_slots_in_use >= NUM_SLOTS) + emit_one_bundle (); + + if ((flags & IA64_OPCODE_LAST) != 0) + insn_group_break (1, 0, 0); + + md.last_text_seg = now_seg; + + done: + input_line_pointer = saved_input_line_pointer; +} + +/* Called when symbol NAME cannot be found in the symbol table. + Should be used for dynamic valued symbols only. */ + +symbolS * +md_undefined_symbol (name) + char *name ATTRIBUTE_UNUSED; +{ + return 0; +} + +/* Called for any expression that can not be recognized. When the + function is called, `input_line_pointer' will point to the start of + the expression. */ + +void +md_operand (e) + expressionS *e; +{ + enum pseudo_type pseudo_type; + const char *name; + size_t len; + int ch, i; + + switch (*input_line_pointer) + { + case '@': + /* Find what relocation pseudo-function we're dealing with. */ + pseudo_type = 0; + ch = *++input_line_pointer; + for (i = 0; i < NELEMS (pseudo_func); ++i) + if (pseudo_func[i].name && pseudo_func[i].name[0] == ch) + { + len = strlen (pseudo_func[i].name); + if (strncmp (pseudo_func[i].name + 1, + input_line_pointer + 1, len - 1) == 0 + && !is_part_of_name (input_line_pointer[len])) + { + input_line_pointer += len; + pseudo_type = pseudo_func[i].type; + break; + } + } + switch (pseudo_type) + { + case PSEUDO_FUNC_RELOC: + SKIP_WHITESPACE (); + if (*input_line_pointer != '(') + { + as_bad ("Expected '('"); + goto err; + } + /* Skip '('. */ + ++input_line_pointer; + expression (e); + if (*input_line_pointer++ != ')') + { + as_bad ("Missing ')'"); + goto err; + } + if (e->X_op != O_symbol) + { + if (e->X_op != O_pseudo_fixup) + { + as_bad ("Not a symbolic expression"); + goto err; + } + if (S_GET_VALUE (e->X_op_symbol) == FUNC_FPTR_RELATIVE + && i == FUNC_LT_RELATIVE) + i = FUNC_LT_FPTR_RELATIVE; + else + { + as_bad ("Illegal combination of relocation functions"); + goto err; + } + } + /* Make sure gas doesn't get rid of local symbols that are used + in relocs. */ + e->X_op = O_pseudo_fixup; + e->X_op_symbol = pseudo_func[i].u.sym; + break; + + case PSEUDO_FUNC_CONST: + e->X_op = O_constant; + e->X_add_number = pseudo_func[i].u.ival; + break; + + case PSEUDO_FUNC_REG: + e->X_op = O_register; + e->X_add_number = pseudo_func[i].u.ival; + break; + + default: + name = input_line_pointer - 1; + get_symbol_end (); + as_bad ("Unknown pseudo function `%s'", name); + goto err; + } + break; + + case '[': + ++input_line_pointer; + expression (e); + if (*input_line_pointer != ']') + { + as_bad ("Closing bracket misssing"); + goto err; + } + else + { + if (e->X_op != O_register) + as_bad ("Register expected as index"); + + ++input_line_pointer; + e->X_op = O_index; + } + break; + + default: + break; + } + return; + + err: + ignore_rest_of_line (); +} + +/* Return 1 if it's OK to adjust a reloc by replacing the symbol with + a section symbol plus some offset. For relocs involving @fptr(), + directives we don't want such adjustments since we need to have the + original symbol's name in the reloc. */ +int +ia64_fix_adjustable (fix) + fixS *fix; +{ + /* Prevent all adjustments to global symbols */ + if (S_IS_EXTERN (fix->fx_addsy) || S_IS_WEAK (fix->fx_addsy)) + return 0; + + switch (fix->fx_r_type) + { + case BFD_RELOC_IA64_FPTR64I: + case BFD_RELOC_IA64_FPTR32MSB: + case BFD_RELOC_IA64_FPTR32LSB: + case BFD_RELOC_IA64_FPTR64MSB: + case BFD_RELOC_IA64_FPTR64LSB: + case BFD_RELOC_IA64_LTOFF_FPTR22: + case BFD_RELOC_IA64_LTOFF_FPTR64I: + return 0; + default: + break; + } + + return 1; +} + +int +ia64_force_relocation (fix) + fixS *fix; +{ + switch (fix->fx_r_type) + { + case BFD_RELOC_IA64_FPTR64I: + case BFD_RELOC_IA64_FPTR32MSB: + case BFD_RELOC_IA64_FPTR32LSB: + case BFD_RELOC_IA64_FPTR64MSB: + case BFD_RELOC_IA64_FPTR64LSB: + + case BFD_RELOC_IA64_LTOFF22: + case BFD_RELOC_IA64_LTOFF64I: + case BFD_RELOC_IA64_LTOFF_FPTR22: + case BFD_RELOC_IA64_LTOFF_FPTR64I: + case BFD_RELOC_IA64_PLTOFF22: + case BFD_RELOC_IA64_PLTOFF64I: + case BFD_RELOC_IA64_PLTOFF64MSB: + case BFD_RELOC_IA64_PLTOFF64LSB: + return 1; + + default: + return 0; + } + return 0; +} + +/* Decide from what point a pc-relative relocation is relative to, + relative to the pc-relative fixup. Er, relatively speaking. */ +long +ia64_pcrel_from_section (fix, sec) + fixS *fix; + segT sec; +{ + unsigned long off = fix->fx_frag->fr_address + fix->fx_where; + + if (bfd_get_section_flags (stdoutput, sec) & SEC_CODE) + off &= ~0xfUL; + + return off; +} + +/* This is called whenever some data item (not an instruction) needs a + fixup. We pick the right reloc code depending on the byteorder + currently in effect. */ +void +ia64_cons_fix_new (f, where, nbytes, exp) + fragS *f; + int where; + int nbytes; + expressionS *exp; +{ + bfd_reloc_code_real_type code; + fixS *fix; + + switch (nbytes) + { + /* There are no reloc for 8 and 16 bit quantities, but we allow + them here since they will work fine as long as the expression + is fully defined at the end of the pass over the source file. */ + case 1: code = BFD_RELOC_8; break; + case 2: code = BFD_RELOC_16; break; + case 4: + if (target_big_endian) + code = BFD_RELOC_IA64_DIR32MSB; + else + code = BFD_RELOC_IA64_DIR32LSB; + break; + + case 8: + if (target_big_endian) + code = BFD_RELOC_IA64_DIR64MSB; + else + code = BFD_RELOC_IA64_DIR64LSB; + break; + + default: + as_bad ("Unsupported fixup size %d", nbytes); + ignore_rest_of_line (); + return; + } + if (exp->X_op == O_pseudo_fixup) + { + /* ??? */ + exp->X_op = O_symbol; + code = ia64_gen_real_reloc_type (exp->X_op_symbol, code); + } + fix = fix_new_exp (f, where, nbytes, exp, 0, code); + /* We need to store the byte order in effect in case we're going + to fix an 8 or 16 bit relocation (for which there no real + relocs available). See md_apply_fix(). */ + fix->tc_fix_data.bigendian = target_big_endian; +} + +/* Return the actual relocation we wish to associate with the pseudo + reloc described by SYM and R_TYPE. SYM should be one of the + symbols in the pseudo_func array, or NULL. */ + +static bfd_reloc_code_real_type +ia64_gen_real_reloc_type (sym, r_type) + struct symbol *sym; + bfd_reloc_code_real_type r_type; +{ + bfd_reloc_code_real_type new = 0; + + if (sym == NULL) + { + return r_type; + } + + switch (S_GET_VALUE (sym)) + { + case FUNC_FPTR_RELATIVE: + switch (r_type) + { + case BFD_RELOC_IA64_IMM64: new = BFD_RELOC_IA64_FPTR64I; break; + case BFD_RELOC_IA64_DIR32MSB: new = BFD_RELOC_IA64_FPTR32MSB; break; + case BFD_RELOC_IA64_DIR32LSB: new = BFD_RELOC_IA64_FPTR32LSB; break; + case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_FPTR64MSB; break; + case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_FPTR64LSB; break; + default: break; + } + break; + + case FUNC_GP_RELATIVE: + switch (r_type) + { + case BFD_RELOC_IA64_IMM22: new = BFD_RELOC_IA64_GPREL22; break; + case BFD_RELOC_IA64_IMM64: new = BFD_RELOC_IA64_GPREL64I; break; + case BFD_RELOC_IA64_DIR32MSB: new = BFD_RELOC_IA64_GPREL32MSB; break; + case BFD_RELOC_IA64_DIR32LSB: new = BFD_RELOC_IA64_GPREL32LSB; break; + case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_GPREL64MSB; break; + case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_GPREL64LSB; break; + default: break; + } + break; + + case FUNC_LT_RELATIVE: + switch (r_type) + { + case BFD_RELOC_IA64_IMM22: new = BFD_RELOC_IA64_LTOFF22; break; + case BFD_RELOC_IA64_IMM64: new = BFD_RELOC_IA64_LTOFF64I; break; + default: break; + } + break; + + case FUNC_PC_RELATIVE: + switch (r_type) + { + case BFD_RELOC_IA64_IMM22: new = BFD_RELOC_IA64_PCREL22; break; + case BFD_RELOC_IA64_IMM64: new = BFD_RELOC_IA64_PCREL64I; break; + case BFD_RELOC_IA64_DIR32MSB: new = BFD_RELOC_IA64_PCREL32MSB; break; + case BFD_RELOC_IA64_DIR32LSB: new = BFD_RELOC_IA64_PCREL32LSB; break; + case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_PCREL64MSB; break; + case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_PCREL64LSB; break; + default: break; + } + break; + + case FUNC_PLT_RELATIVE: + switch (r_type) + { + case BFD_RELOC_IA64_IMM22: new = BFD_RELOC_IA64_PLTOFF22; break; + case BFD_RELOC_IA64_IMM64: new = BFD_RELOC_IA64_PLTOFF64I; break; + case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_PLTOFF64MSB;break; + case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_PLTOFF64LSB;break; + default: break; + } + break; + + case FUNC_SEC_RELATIVE: + switch (r_type) + { + case BFD_RELOC_IA64_DIR32MSB: new = BFD_RELOC_IA64_SECREL32MSB;break; + case BFD_RELOC_IA64_DIR32LSB: new = BFD_RELOC_IA64_SECREL32LSB;break; + case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_SECREL64MSB;break; + case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_SECREL64LSB;break; + default: break; + } + break; + + case FUNC_SEG_RELATIVE: + switch (r_type) + { + case BFD_RELOC_IA64_DIR32MSB: new = BFD_RELOC_IA64_SEGREL32MSB;break; + case BFD_RELOC_IA64_DIR32LSB: new = BFD_RELOC_IA64_SEGREL32LSB;break; + case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_SEGREL64MSB;break; + case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_SEGREL64LSB;break; + default: break; + } + break; + + case FUNC_LTV_RELATIVE: + switch (r_type) + { + case BFD_RELOC_IA64_DIR32MSB: new = BFD_RELOC_IA64_LTV32MSB; break; + case BFD_RELOC_IA64_DIR32LSB: new = BFD_RELOC_IA64_LTV32LSB; break; + case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_LTV64MSB; break; + case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_LTV64LSB; break; + default: break; + } + break; + + case FUNC_LT_FPTR_RELATIVE: + switch (r_type) + { + case BFD_RELOC_IA64_IMM22: + new = BFD_RELOC_IA64_LTOFF_FPTR22; break; + case BFD_RELOC_IA64_IMM64: + new = BFD_RELOC_IA64_LTOFF_FPTR64I; break; + default: + break; + } + break; + default: + abort (); + } + /* Hmmmm. Should this ever occur? */ + if (new) + return new; + else + return r_type; +} + +/* Here is where generate the appropriate reloc for pseudo relocation + functions. */ +void +ia64_validate_fix (fix) + fixS *fix; +{ + switch (fix->fx_r_type) + { + case BFD_RELOC_IA64_FPTR64I: + case BFD_RELOC_IA64_FPTR32MSB: + case BFD_RELOC_IA64_FPTR64LSB: + case BFD_RELOC_IA64_LTOFF_FPTR22: + case BFD_RELOC_IA64_LTOFF_FPTR64I: + if (fix->fx_offset != 0) + as_bad_where (fix->fx_file, fix->fx_line, + "No addend allowed in @fptr() relocation"); + break; + default: + break; + } + + return; +} + +static void +fix_insn (fix, odesc, value) + fixS *fix; + const struct ia64_operand *odesc; + valueT value; +{ + bfd_vma insn[3], t0, t1, control_bits; + const char *err; + char *fixpos; + long slot; + + slot = fix->fx_where & 0x3; + fixpos = fix->fx_frag->fr_literal + (fix->fx_where - slot); + + /* Bundles are always in little-endian byte order */ + t0 = bfd_getl64 (fixpos); + t1 = bfd_getl64 (fixpos + 8); + control_bits = t0 & 0x1f; + insn[0] = (t0 >> 5) & 0x1ffffffffffLL; + insn[1] = ((t0 >> 46) & 0x3ffff) | ((t1 & 0x7fffff) << 18); + insn[2] = (t1 >> 23) & 0x1ffffffffffLL; + + err = NULL; + if (odesc - elf64_ia64_operands == IA64_OPND_IMMU64) + { + insn[1] = (value >> 22) & 0x1ffffffffffLL; + insn[2] |= (((value & 0x7f) << 13) + | (((value >> 7) & 0x1ff) << 27) + | (((value >> 16) & 0x1f) << 22) + | (((value >> 21) & 0x1) << 21) + | (((value >> 63) & 0x1) << 36)); + } + else if (odesc - elf64_ia64_operands == IA64_OPND_IMMU62) + { + if (value & ~0x3fffffffffffffffULL) + err = "integer operand out of range"; + insn[1] = (value >> 21) & 0x1ffffffffffLL; + insn[2] |= (((value & 0xfffff) << 6) | (((value >> 20) & 0x1) << 36)); + } + else if (odesc - elf64_ia64_operands == IA64_OPND_TGT64) + { + value >>= 4; + insn[1] = ((value >> 20) & 0x7fffffffffLL) << 2; + insn[2] |= ((((value >> 59) & 0x1) << 36) + | (((value >> 0) & 0xfffff) << 13)); + } + else + err = (*odesc->insert) (odesc, value, insn + slot); + + if (err) + as_bad_where (fix->fx_file, fix->fx_line, err); + + t0 = control_bits | (insn[0] << 5) | (insn[1] << 46); + t1 = ((insn[1] >> 18) & 0x7fffff) | (insn[2] << 23); + number_to_chars_littleendian (fixpos + 0, t0, 8); + number_to_chars_littleendian (fixpos + 8, t1, 8); +} + +/* Attempt to simplify or even eliminate a fixup. The return value is + ignored; perhaps it was once meaningful, but now it is historical. + To indicate that a fixup has been eliminated, set FIXP->FX_DONE. + + If fixp->fx_addsy is non-NULL, we'll have to generate a reloc entry + (if possible). */ +int +md_apply_fix3 (fix, valuep, seg) + fixS *fix; + valueT *valuep; + segT seg ATTRIBUTE_UNUSED; +{ + char *fixpos; + valueT value = *valuep; + int adjust = 0; + + fixpos = fix->fx_frag->fr_literal + fix->fx_where; + + if (fix->fx_pcrel) + { + switch (fix->fx_r_type) + { + case BFD_RELOC_IA64_DIR32MSB: + fix->fx_r_type = BFD_RELOC_IA64_PCREL32MSB; + adjust = 1; + break; + + case BFD_RELOC_IA64_DIR32LSB: + fix->fx_r_type = BFD_RELOC_IA64_PCREL32LSB; + adjust = 1; + break; + + case BFD_RELOC_IA64_DIR64MSB: + fix->fx_r_type = BFD_RELOC_IA64_PCREL64MSB; + adjust = 1; + break; + + case BFD_RELOC_IA64_DIR64LSB: + fix->fx_r_type = BFD_RELOC_IA64_PCREL64LSB; + adjust = 1; + break; + + default: + break; + } + } + if (fix->fx_addsy) + { + switch (fix->fx_r_type) + { + case 0: + as_bad_where (fix->fx_file, fix->fx_line, + "%s must have a constant value", + elf64_ia64_operands[fix->tc_fix_data.opnd].desc); + break; + + default: + break; + } + + /* ??? This is a hack copied from tc-i386.c to make PCREL relocs + work. There should be a better way to handle this. */ + if (adjust) + fix->fx_offset += fix->fx_where + fix->fx_frag->fr_address; + } + else if (fix->tc_fix_data.opnd == IA64_OPND_NIL) + { + if (fix->tc_fix_data.bigendian) + number_to_chars_bigendian (fixpos, value, fix->fx_size); + else + number_to_chars_littleendian (fixpos, value, fix->fx_size); + fix->fx_done = 1; + return 1; + } + else + { + fix_insn (fix, elf64_ia64_operands + fix->tc_fix_data.opnd, value); + fix->fx_done = 1; + return 1; + } + return 1; +} + +/* Generate the BFD reloc to be stuck in the object file from the + fixup used internally in the assembler. */ + +arelent * +tc_gen_reloc (sec, fixp) + asection *sec ATTRIBUTE_UNUSED; + fixS *fixp; +{ + arelent *reloc; + + reloc = xmalloc (sizeof (*reloc)); + reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); + reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; + reloc->addend = fixp->fx_offset; + reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type); + + if (!reloc->howto) + { + as_bad_where (fixp->fx_file, fixp->fx_line, + "Cannot represent %s relocation in object file", + bfd_get_reloc_code_name (fixp->fx_r_type)); + } + return reloc; +} + +/* Turn a string in input_line_pointer into a floating point constant + of type TYPE, and store the appropriate bytes in *LIT. The number + of LITTLENUMS emitted is stored in *SIZE. An error message is + returned, or NULL on OK. */ + +#define MAX_LITTLENUMS 5 + +char * +md_atof (type, lit, size) + int type; + char *lit; + int *size; +{ + LITTLENUM_TYPE words[MAX_LITTLENUMS]; + LITTLENUM_TYPE *word; + char *t; + int prec; + + switch (type) + { + /* IEEE floats */ + case 'f': + case 'F': + case 's': + case 'S': + prec = 2; + break; + + case 'd': + case 'D': + case 'r': + case 'R': + prec = 4; + break; + + case 'x': + case 'X': + case 'p': + case 'P': + prec = 5; + break; + + default: + *size = 0; + return "Bad call to MD_ATOF()"; + } + t = atof_ieee (input_line_pointer, type, words); + if (t) + input_line_pointer = t; + *size = prec * sizeof (LITTLENUM_TYPE); + + for (word = words + prec - 1; prec--;) + { + md_number_to_chars (lit, (long) (*word--), sizeof (LITTLENUM_TYPE)); + lit += sizeof (LITTLENUM_TYPE); + } + return 0; +} + +/* Round up a section's size to the appropriate boundary. */ +valueT +md_section_align (seg, size) + segT seg; + valueT size; +{ + int align = bfd_get_section_alignment (stdoutput, seg); + valueT mask = ((valueT) 1 << align) - 1; + + return (size + mask) & ~mask; +} + +/* Handle ia64 specific semantics of the align directive. */ + +void +ia64_md_do_align (n, fill, len, max) + int n ATTRIBUTE_UNUSED; + const char *fill ATTRIBUTE_UNUSED; + int len ATTRIBUTE_UNUSED; + int max ATTRIBUTE_UNUSED; +{ + if (subseg_text_p (now_seg)) + ia64_flush_insns (); +} + +/* This is called from HANDLE_ALIGN in write.c. Fill in the contents + of an rs_align_code fragment. */ + +void +ia64_handle_align (fragp) + fragS *fragp; +{ + /* Use mfi bundle of nops with no stop bits. */ + static const unsigned char be_nop[] + = { 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c}; + static const unsigned char le_nop[] + = { 0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00}; + + int bytes; + char *p; + + if (fragp->fr_type != rs_align_code) + return; + + bytes = fragp->fr_next->fr_address - fragp->fr_address - fragp->fr_fix; + p = fragp->fr_literal + fragp->fr_fix; + + /* Make sure we are on a 16-byte boundary, in case someone has been + putting data into a text section. */ + if (bytes & 15) + { + int fix = bytes & 15; + memset (p, 0, fix); + p += fix; + bytes -= fix; + fragp->fr_fix += fix; + } + + memcpy (p, (target_big_endian ? be_nop : le_nop), 16); + fragp->fr_var = 16; +} diff --git a/contrib/binutils/gas/config/tc-ia64.h b/contrib/binutils/gas/config/tc-ia64.h new file mode 100644 index 0000000..12ae411 --- /dev/null +++ b/contrib/binutils/gas/config/tc-ia64.h @@ -0,0 +1,261 @@ +/* tc-ia64.h -- Header file for tc-ia64.c. + Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + This file is part of GAS, the GNU Assembler. + + GAS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GAS is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GAS; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include <opcode/ia64.h> +#include <elf/ia64.h> + +#define TC_IA64 + +/* Linux is little endian by default. HPUX is big endian by default. */ +#ifdef TE_HPUX +#define md_number_to_chars number_to_chars_bigendian +#define TARGET_BYTES_BIG_ENDIAN 1 +#else +#define md_number_to_chars number_to_chars_littleendian +#define TARGET_BYTES_BIG_ENDIAN 0 +#endif /* TE_HPUX */ + +/* We need to set the default object file format in ia64_init and not in + md_begin. This is because parse_args is called before md_begin, and we + do not want md_begin to wipe out the flag settings set by options parsed in + md_parse_args. */ + +#define HOST_SPECIAL_INIT ia64_init +extern void ia64_init PARAMS ((int, char **)); + +#define TARGET_FORMAT ia64_target_format() +extern const char *ia64_target_format PARAMS ((void)); + +#define TARGET_ARCH bfd_arch_ia64 +#define DOUBLESLASH_LINE_COMMENTS /* allow //-style comments */ +#define TC_HANDLES_FX_DONE + +#define NEED_LITERAL_POOL /* need gp literal pool */ +#define RELOC_REQUIRES_SYMBOL +#define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs */ +#define NEED_INDEX_OPERATOR /* [ ] is index operator */ + +#define QUOTES_IN_INSN /* allow `string "foo;bar"' */ +#define LEX_AT LEX_NAME /* allow `@' inside name */ +#define LEX_QM LEX_NAME /* allow `?' inside name */ +#define LEX_HASH LEX_END_NAME /* allow `#' ending a name */ + +struct ia64_fix + { + int bigendian; /* byte order at fix location */ + enum ia64_opnd opnd; + }; + +extern void ia64_do_align PARAMS((int n)); +extern void ia64_end_of_source PARAMS((void)); +extern void ia64_start_line PARAMS((void)); +extern int ia64_unrecognized_line PARAMS((int ch)); +extern void ia64_frob_label PARAMS((struct symbol *sym)); +extern void ia64_flush_pending_output PARAMS((void)); +extern int ia64_parse_name (char *name, expressionS *e); +extern int ia64_optimize_expr PARAMS((expressionS *l, operatorT op, + expressionS *r)); +extern void ia64_cons_align PARAMS((int)); +extern void ia64_flush_insns PARAMS((void)); +extern int ia64_fix_adjustable PARAMS((struct fix *fix)); +extern int ia64_force_relocation PARAMS((struct fix *)); +extern void ia64_cons_fix_new PARAMS ((fragS *f, int where, int nbytes, + expressionS *exp)); +extern void ia64_validate_fix PARAMS ((struct fix *fix)); +extern char * ia64_canonicalize_symbol_name PARAMS ((char *)); +extern flagword ia64_elf_section_flags PARAMS ((flagword, int, int)); +extern int ia64_elf_section_type PARAMS ((const char *, size_t len)); +extern long ia64_pcrel_from_section PARAMS ((struct fix *fix, segT sec)); +extern void ia64_md_do_align PARAMS ((int, const char *, int, int)); +extern void ia64_handle_align PARAMS ((fragS *f)); + +#define md_end() ia64_end_of_source () +#define md_start_line_hook() ia64_start_line () +#define tc_unrecognized_line(ch) ia64_unrecognized_line (ch) +#define tc_frob_label(s) ia64_frob_label (s) +#define md_flush_pending_output() ia64_flush_pending_output () +#define md_parse_name(s,e) ia64_parse_name (s, e) +#define tc_canonicalize_symbol_name(s) ia64_canonicalize_symbol_name (s) +#define md_optimize_expr(l,o,r) ia64_optimize_expr (l, o, r) +#define md_cons_align(n) ia64_cons_align (n) +#define TC_FORCE_RELOCATION(f) ia64_force_relocation (f) +#define tc_fix_adjustable(f) ia64_fix_adjustable (f) +#define md_convert_frag(b,s,f) as_fatal ("ia64_convert_frag") +#define md_create_long_jump(p,f,t,fr,s) as_fatal("ia64_create_long_jump") +#define md_create_short_jump(p,f,t,fr,s) \ + as_fatal("ia64_create_short_jump") +#define md_estimate_size_before_relax(f,s) \ + (as_fatal ("ia64_estimate_size_before_relax"), 1) +#define md_elf_section_flags ia64_elf_section_flags +#define TC_FIX_TYPE struct ia64_fix +#define TC_INIT_FIX_DATA(f) { f->tc_fix_data.opnd = 0; } +#define TC_CONS_FIX_NEW(f,o,l,e) ia64_cons_fix_new (f, o, l, e) +#define TC_VALIDATE_FIX(fix,seg,skip) ia64_validate_fix (fix) +#define MD_PCREL_FROM_SECTION(fix,sec) ia64_pcrel_from_section (fix, sec) +#define md_do_align(n,f,l,m,j) ia64_md_do_align (n,f,l,m) +#define HANDLE_ALIGN(f) ia64_handle_align (f) +#define md_elf_section_type(str,len) ia64_elf_section_type (str, len) + +#define MAX_MEM_FOR_RS_ALIGN_CODE (15 + 16) + +/* Call md_apply_fix3 with segment instead of md_apply_fix. */ +#define MD_APPLY_FIX3 + +#define WORKING_DOT_WORD /* don't do broken word processing for now */ + +#define ELF_TC_SPECIAL_SECTIONS \ +{ ".sbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT }, \ +{ ".sdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT }, + +#define DWARF2_LINE_MIN_INSN_LENGTH 1 /* so slot-multipliers can be 1 */ + +/* This is the information required for unwind records in an ia64 + object file. This is required by GAS and the compiler runtime. */ + +/* These are the starting point masks for the various types of + unwind records. To create a record of type R3 for instance, one + starts by using the value UNW_R3 and or-ing in any other required values. + These values are also unique (in context), so they can be used to identify + the various record types as well. UNW_Bx and some UNW_Px do have the + same value, but Px can only occur in a prologue context, and Bx in + a body context. */ + +#define UNW_R1 0x00 +#define UNW_R2 0x40 +#define UNW_R3 0x60 +#define UNW_P1 0x80 +#define UNW_P2 0xA0 +#define UNW_P3 0xB0 +#define UNW_P4 0xB8 +#define UNW_P5 0xB9 +#define UNW_P6 0xC0 +#define UNW_P7 0xE0 +#define UNW_P8 0xF0 +#define UNW_P9 0xF1 +#define UNW_P10 0xFF +#define UNW_X1 0xF9 +#define UNW_X2 0xFA +#define UNW_X3 0xFB +#define UNW_X4 0xFC +#define UNW_B1 0x80 +#define UNW_B2 0xC0 +#define UNW_B3 0xE0 +#define UNW_B4 0xF0 + +/* These are all the various types of unwind records. */ + +typedef enum +{ + prologue, prologue_gr, body, mem_stack_f, mem_stack_v, psp_gr, psp_sprel, + rp_when, rp_gr, rp_br, rp_psprel, rp_sprel, pfs_when, pfs_gr, pfs_psprel, + pfs_sprel, preds_when, preds_gr, preds_psprel, preds_sprel, + fr_mem, frgr_mem, gr_gr, gr_mem, br_mem, br_gr, spill_base, spill_mask, + unat_when, unat_gr, unat_psprel, unat_sprel, lc_when, lc_gr, lc_psprel, + lc_sprel, fpsr_when, fpsr_gr, fpsr_psprel, fpsr_sprel, + priunat_when_gr, priunat_when_mem, priunat_gr, priunat_psprel, + priunat_sprel, bsp_when, bsp_gr, bsp_psprel, bsp_sprel, bspstore_when, + bspstore_gr, bspstore_psprel, bspstore_sprel, rnat_when, rnat_gr, + rnat_psprel, rnat_sprel, epilogue, label_state, copy_state, + spill_psprel, spill_sprel, spill_reg, spill_psprel_p, spill_sprel_p, + spill_reg_p, unwabi +} unw_record_type; + +/* These structures declare the fields that can be used in each of the + 4 record formats, R, P, B and X. */ + +typedef struct unw_r_record +{ + unsigned long rlen; + unsigned short grmask; + unsigned short grsave; + /* masks to represent the union of save.g, save.f, save.b, and + save.gf: */ + unsigned long imask_size; + struct + { + unsigned char *i; + unsigned long fr_mem; + unsigned char gr_mem; + unsigned char br_mem; + } mask; +} unw_r_record; + +typedef struct unw_p_record +{ + void *imask; + unsigned long t; + unsigned long size; + unsigned long spoff; + unsigned long br; + unsigned long pspoff; + unsigned short gr; + unsigned short rmask; + unsigned short grmask; + unsigned long frmask; + unsigned short brmask; + unsigned char abi; + unsigned char context; +} unw_p_record; + +typedef struct unw_b_record +{ + unsigned long t; + unsigned long label; + unsigned short ecount; +} unw_b_record; + +typedef struct unw_x_record +{ + unsigned long t; + unsigned long spoff; + unsigned long pspoff; + unsigned short reg; + unsigned short treg; + unsigned short qp; + unsigned short ab; /* Value of the AB field.. */ + unsigned short xy; /* Value of the XY field.. */ +} unw_x_record; + +/* This structure is used to determine the specific record type and + its fields. */ +typedef struct unwind_record +{ + unw_record_type type; + union { + unw_r_record r; + unw_p_record p; + unw_b_record b; + unw_x_record x; + } record; +} unwind_record; + +/* This expression evaluates to false if the relocation is for a local + object for which we still want to do the relocation at runtime. + True if we are willing to perform this relocation while building + the .o file. This is only used for pcrel relocations. */ + +#define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \ + ((FIX)->fx_addsy == NULL \ + || (FIX)->fx_r_type == 0 \ + || (! S_IS_EXTERNAL ((FIX)->fx_addsy) \ + && ! S_IS_WEAK ((FIX)->fx_addsy) \ + && S_IS_DEFINED ((FIX)->fx_addsy) \ + && ! S_IS_COMMON ((FIX)->fx_addsy))) diff --git a/contrib/binutils/include/coff/ia64.h b/contrib/binutils/include/coff/ia64.h new file mode 100644 index 0000000..496a877 --- /dev/null +++ b/contrib/binutils/include/coff/ia64.h @@ -0,0 +1,238 @@ +/* coff information for HP/Intel IA-64. + + Copyright 2001 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + + +/********************** FILE HEADER **********************/ + +struct external_filehdr { + char f_magic[2]; /* magic number */ + char f_nscns[2]; /* number of sections */ + char f_timdat[4]; /* time & date stamp */ + char f_symptr[4]; /* file pointer to symtab */ + char f_nsyms[4]; /* number of symtab entries */ + char f_opthdr[2]; /* sizeof(optional hdr) */ + char f_flags[2]; /* flags */ +}; + +#define IA64MAGIC 0x200 + +#define IA64BADMAG(x) (((x).f_magic != IA64MAGIC)) + +/* Bits for f_flags: + * F_RELFLG relocation info stripped from file + * F_EXEC file is executable (no unresolved external references) + * F_LNNO line numbers stripped from file + * F_LSYMS local symbols stripped from file + * F_AR32WR file has byte ordering of an AR32WR machine (e.g. vax) + */ + +#define F_RELFLG (0x0001) +#define F_EXEC (0x0002) +#define F_LNNO (0x0004) +#define F_LSYMS (0x0008) + + +#define FILHDR struct external_filehdr +#define FILHSZ 20 + + +/********************** AOUT "OPTIONAL HEADER" **********************/ + + +typedef struct +{ + char magic[2]; /* type of file */ + char vstamp[2]; /* version stamp */ + char tsize[4]; /* text size in bytes, padded to FW bdry*/ + char dsize[4]; /* initialized data " " */ + char bsize[4]; /* uninitialized data " " */ + char entry[4]; /* entry pt. */ + char text_start[4]; /* base of text used for this file */ +#ifndef BFD64 + char data_start[4]; /* base of data used for this file */ +#endif +} +AOUTHDR; + +#define PE32MAGIC 0x10b /* 32-bit image */ +#define PE32PMAGIC 0x20b /* 32-bit image inside 64-bit address space */ + +#define PE32PBADMAG(x) (((x).f_magic != PE32PMAGIC)) + +#define AOUTSZ 108 +#define AOUTHDRSZ 108 + +#define OMAGIC 0404 /* object files, eg as output */ +#define ZMAGIC 0413 /* demand load format, eg normal ld output */ +#define STMAGIC 0401 /* target shlib */ +#define SHMAGIC 0443 /* host shlib */ + + +/* define some NT default values */ +/* #define NT_IMAGE_BASE 0x400000 moved to internal.h */ +#define NT_SECTION_ALIGNMENT 0x1000 +#define NT_FILE_ALIGNMENT 0x200 +#define NT_DEF_RESERVE 0x100000 +#define NT_DEF_COMMIT 0x1000 + +/********************** SECTION HEADER **********************/ + + +struct external_scnhdr { + char s_name[8]; /* section name */ + char s_paddr[4]; /* physical address, aliased s_nlib */ + char s_vaddr[4]; /* virtual address */ + char s_size[4]; /* section size */ + char s_scnptr[4]; /* file ptr to raw data for section */ + char s_relptr[4]; /* file ptr to relocation */ + char s_lnnoptr[4]; /* file ptr to line numbers */ + char s_nreloc[2]; /* number of relocation entries */ + char s_nlnno[2]; /* number of line number entries*/ + char s_flags[4]; /* flags */ +}; + +#define SCNHDR struct external_scnhdr +#define SCNHSZ 40 + +/* + * names of "special" sections + */ +#define _TEXT ".text" +#define _DATA ".data" +#define _BSS ".bss" +#define _COMMENT ".comment" +#define _LIB ".lib" + +/********************** LINE NUMBERS **********************/ + +/* 1 line number entry for every "breakpointable" source line in a section. + * Line numbers are grouped on a per function basis; first entry in a function + * grouping will have l_lnno = 0 and in place of physical address will be the + * symbol table index of the function name. + */ +struct external_lineno { + union { + char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/ + char l_paddr[4]; /* (physical) address of line number */ + } l_addr; + char l_lnno[2]; /* line number */ +}; + + +#define LINENO struct external_lineno +#define LINESZ 6 + + +/********************** SYMBOLS **********************/ + +#define E_SYMNMLEN 8 /* # characters in a symbol name */ +#define E_FILNMLEN 14 /* # characters in a file name */ +#define E_DIMNUM 4 /* # array dimensions in auxiliary entry */ + +struct external_syment +{ + union { + char e_name[E_SYMNMLEN]; + struct { + char e_zeroes[4]; + char e_offset[4]; + } e; + } e; + char e_value[4]; + char e_scnum[2]; + char e_type[2]; + char e_sclass[1]; + char e_numaux[1]; +}; + +#define N_BTMASK (0xf) +#define N_TMASK (0x30) +#define N_BTSHFT (4) +#define N_TSHIFT (2) + +union external_auxent { + struct { + char x_tagndx[4]; /* str, un, or enum tag indx */ + union { + struct { + char x_lnno[2]; /* declaration line number */ + char x_size[2]; /* str/union/array size */ + } x_lnsz; + char x_fsize[4]; /* size of function */ + } x_misc; + union { + struct { /* if ISFCN, tag, or .bb */ + char x_lnnoptr[4]; /* ptr to fcn line # */ + char x_endndx[4]; /* entry ndx past block end */ + } x_fcn; + struct { /* if ISARY, up to 4 dimen. */ + char x_dimen[E_DIMNUM][2]; + } x_ary; + } x_fcnary; + char x_tvndx[2]; /* tv index */ + } x_sym; + + union { + char x_fname[E_FILNMLEN]; + struct { + char x_zeroes[4]; + char x_offset[4]; + } x_n; + } x_file; + + struct { + char x_scnlen[4]; /* section length */ + char x_nreloc[2]; /* # relocation entries */ + char x_nlinno[2]; /* # line numbers */ + char x_checksum[4]; /* section COMDAT checksum */ + char x_associated[2]; /* COMDAT associated section index */ + char x_comdat[1]; /* COMDAT selection number */ + } x_scn; + + struct { + char x_tvfill[4]; /* tv fill value */ + char x_tvlen[2]; /* length of .tv */ + char x_tvran[2][2]; /* tv range */ + } x_tv; /* info about .tv section (in auxent of symbol .tv)) */ + + +}; + +#define SYMENT struct external_syment +#define SYMESZ 18 +#define AUXENT union external_auxent +#define AUXESZ 18 + + +# define _ETEXT "etext" + + +/********************** RELOCATION DIRECTIVES **********************/ + + + +struct external_reloc { + char r_vaddr[4]; + char r_symndx[4]; + char r_type[2]; +}; + + +#define RELOC struct external_reloc +#define RELSZ 10 + diff --git a/contrib/binutils/include/coff/rs6000.h b/contrib/binutils/include/coff/rs6000.h new file mode 100644 index 0000000..0def1d9 --- /dev/null +++ b/contrib/binutils/include/coff/rs6000.h @@ -0,0 +1,243 @@ +/* IBM RS/6000 "XCOFF" file definitions for BFD. + Copyright (C) 1990, 1991 Free Software Foundation, Inc. + FIXME: Can someone provide a transliteration of this name into ASCII? + Using the following chars caused a compiler warning on HIUX (so I replaced + them with octal escapes), and isn't useful without an understanding of what + character set it is. + Written by Mimi Ph\373\364ng-Th\345o V\365 of IBM + and John Gilmore of Cygnus Support. */ + +/********************** FILE HEADER **********************/ + +struct external_filehdr { + char f_magic[2]; /* magic number */ + char f_nscns[2]; /* number of sections */ + char f_timdat[4]; /* time & date stamp */ + char f_symptr[4]; /* file pointer to symtab */ + char f_nsyms[4]; /* number of symtab entries */ + char f_opthdr[2]; /* sizeof(optional hdr) */ + char f_flags[2]; /* flags */ +}; + + /* IBM RS/6000 */ +#define U802WRMAGIC 0730 /* writeable text segments **chh** */ +#define U802ROMAGIC 0735 /* readonly sharable text segments */ +#define U802TOCMAGIC 0737 /* readonly text segments and TOC */ + +#define BADMAG(x) \ + ((x).f_magic != U802ROMAGIC && (x).f_magic != U802WRMAGIC && \ + (x).f_magic != U802TOCMAGIC) + +#define FILHDR struct external_filehdr +#define FILHSZ 20 + + +/********************** AOUT "OPTIONAL HEADER" **********************/ + + +typedef struct +{ + unsigned char magic[2]; /* type of file */ + unsigned char vstamp[2]; /* version stamp */ + unsigned char tsize[4]; /* text size in bytes, padded to FW bdry */ + unsigned char dsize[4]; /* initialized data " " */ + unsigned char bsize[4]; /* uninitialized data " " */ + unsigned char entry[4]; /* entry pt. */ + unsigned char text_start[4]; /* base of text used for this file */ + unsigned char data_start[4]; /* base of data used for this file */ + unsigned char o_toc[4]; /* address of TOC */ + unsigned char o_snentry[2]; /* section number of entry point */ + unsigned char o_sntext[2]; /* section number of .text section */ + unsigned char o_sndata[2]; /* section number of .data section */ + unsigned char o_sntoc[2]; /* section number of TOC */ + unsigned char o_snloader[2]; /* section number of .loader section */ + unsigned char o_snbss[2]; /* section number of .bss section */ + unsigned char o_algntext[2]; /* .text alignment */ + unsigned char o_algndata[2]; /* .data alignment */ + unsigned char o_modtype[2]; /* module type (??) */ + unsigned char o_cputype[2]; /* cpu type */ + unsigned char o_maxstack[4]; /* max stack size (??) */ + unsigned char o_maxdata[4]; /* max data size (??) */ + unsigned char o_resv2[12]; /* reserved */ +} +AOUTHDR; + +#define AOUTSZ 72 +#define SMALL_AOUTSZ (28) +#define AOUTHDRSZ 72 + +#define RS6K_AOUTHDR_OMAGIC 0x0107 /* old: text & data writeable */ +#define RS6K_AOUTHDR_NMAGIC 0x0108 /* new: text r/o, data r/w */ +#define RS6K_AOUTHDR_ZMAGIC 0x010B /* paged: text r/o, both page-aligned */ + + +/********************** SECTION HEADER **********************/ + + +struct external_scnhdr { + char s_name[8]; /* section name */ + char s_paddr[4]; /* physical address, aliased s_nlib */ + char s_vaddr[4]; /* virtual address */ + char s_size[4]; /* section size */ + char s_scnptr[4]; /* file ptr to raw data for section */ + char s_relptr[4]; /* file ptr to relocation */ + char s_lnnoptr[4]; /* file ptr to line numbers */ + char s_nreloc[2]; /* number of relocation entries */ + char s_nlnno[2]; /* number of line number entries*/ + char s_flags[4]; /* flags */ +}; + +/* + * names of "special" sections + */ +#define _TEXT ".text" +#define _DATA ".data" +#define _BSS ".bss" +#define _PAD ".pad" +#define _LOADER ".loader" + +#define SCNHDR struct external_scnhdr +#define SCNHSZ 40 + +/* XCOFF uses a special .loader section with type STYP_LOADER. */ +#define STYP_LOADER 0x1000 + +/* XCOFF uses a special .debug section with type STYP_DEBUG. */ +#define STYP_DEBUG 0x2000 + +/* XCOFF handles line number or relocation overflow by creating + another section header with STYP_OVRFLO set. */ +#define STYP_OVRFLO 0x8000 + +/********************** LINE NUMBERS **********************/ + +/* 1 line number entry for every "breakpointable" source line in a section. + * Line numbers are grouped on a per function basis; first entry in a function + * grouping will have l_lnno = 0 and in place of physical address will be the + * symbol table index of the function name. + */ +struct external_lineno { + union { + char l_symndx[4]; /* function name symbol index, iff l_lnno == 0*/ + char l_paddr[4]; /* (physical) address of line number */ + } l_addr; + char l_lnno[2]; /* line number */ +}; + + +#define LINENO struct external_lineno +#define LINESZ 6 + + +/********************** SYMBOLS **********************/ + +#define E_SYMNMLEN 8 /* # characters in a symbol name */ +#define E_FILNMLEN 14 /* # characters in a file name */ +#define E_DIMNUM 4 /* # array dimensions in auxiliary entry */ + +struct external_syment +{ + union { + char e_name[E_SYMNMLEN]; + struct { + char e_zeroes[4]; + char e_offset[4]; + } e; + } e; + char e_value[4]; + char e_scnum[2]; + char e_type[2]; + char e_sclass[1]; + char e_numaux[1]; +}; + + + +#define N_BTMASK (017) +#define N_TMASK (060) +#define N_BTSHFT (4) +#define N_TSHIFT (2) + + +union external_auxent { + struct { + char x_tagndx[4]; /* str, un, or enum tag indx */ + union { + struct { + char x_lnno[2]; /* declaration line number */ + char x_size[2]; /* str/union/array size */ + } x_lnsz; + char x_fsize[4]; /* size of function */ + } x_misc; + union { + struct { /* if ISFCN, tag, or .bb */ + char x_lnnoptr[4]; /* ptr to fcn line # */ + char x_endndx[4]; /* entry ndx past block end */ + } x_fcn; + struct { /* if ISARY, up to 4 dimen. */ + char x_dimen[E_DIMNUM][2]; + } x_ary; + } x_fcnary; + char x_tvndx[2]; /* tv index */ + } x_sym; + + union { + char x_fname[E_FILNMLEN]; + struct { + char x_zeroes[4]; + char x_offset[4]; + } x_n; + } x_file; + + struct { + char x_scnlen[4]; /* section length */ + char x_nreloc[2]; /* # relocation entries */ + char x_nlinno[2]; /* # line numbers */ + } x_scn; + + struct { + char x_tvfill[4]; /* tv fill value */ + char x_tvlen[2]; /* length of .tv */ + char x_tvran[2][2]; /* tv range */ + } x_tv; /* info about .tv section (in auxent of symbol .tv)) */ + + struct { + unsigned char x_scnlen[4]; + unsigned char x_parmhash[4]; + unsigned char x_snhash[2]; + unsigned char x_smtyp[1]; + unsigned char x_smclas[1]; + unsigned char x_stab[4]; + unsigned char x_snstab[2]; + } x_csect; + +}; + +#define SYMENT struct external_syment +#define SYMESZ 18 +#define AUXENT union external_auxent +#define AUXESZ 18 +#define DBXMASK 0x80 /* for dbx storage mask */ +#define SYMNAME_IN_DEBUG(symptr) ((symptr)->n_sclass & DBXMASK) + + + +/********************** RELOCATION DIRECTIVES **********************/ + + +struct external_reloc { + char r_vaddr[4]; + char r_symndx[4]; + char r_size[1]; + char r_type[1]; +}; + + +#define RELOC struct external_reloc +#define RELSZ 10 + +#define DEFAULT_DATA_SECTION_ALIGNMENT 4 +#define DEFAULT_BSS_SECTION_ALIGNMENT 4 +#define DEFAULT_TEXT_SECTION_ALIGNMENT 4 +/* For new sections we havn't heard of before */ +#define DEFAULT_SECTION_ALIGNMENT 4 diff --git a/contrib/binutils/include/opcode/ia64.h b/contrib/binutils/include/opcode/ia64.h new file mode 100644 index 0000000..642330c --- /dev/null +++ b/contrib/binutils/include/opcode/ia64.h @@ -0,0 +1,391 @@ +/* ia64.h -- Header file for ia64 opcode table + Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com> + + See the file HP-COPYRIGHT for additional information. */ + +#ifndef opcode_ia64_h +#define opcode_ia64_h + +#include <sys/types.h> + +#include <bfd.h> + + +typedef BFD_HOST_U_64_BIT ia64_insn; + +enum ia64_insn_type + { + IA64_TYPE_NIL = 0, /* illegal type */ + IA64_TYPE_A, /* integer alu (I- or M-unit) */ + IA64_TYPE_I, /* non-alu integer (I-unit) */ + IA64_TYPE_M, /* memory (M-unit) */ + IA64_TYPE_B, /* branch (B-unit) */ + IA64_TYPE_F, /* floating-point (F-unit) */ + IA64_TYPE_X, /* long encoding (X-unit) */ + IA64_TYPE_DYN, /* Dynamic opcode */ + IA64_NUM_TYPES + }; + +enum ia64_unit + { + IA64_UNIT_NIL = 0, /* illegal unit */ + IA64_UNIT_I, /* integer unit */ + IA64_UNIT_M, /* memory unit */ + IA64_UNIT_B, /* branching unit */ + IA64_UNIT_F, /* floating-point unit */ + IA64_UNIT_L, /* long "unit" */ + IA64_UNIT_X, /* may be integer or branch unit */ + IA64_NUM_UNITS + }; + +/* Changes to this enumeration must be propagated to the operand table in + bfd/cpu-ia64-opc.c + */ +enum ia64_opnd + { + IA64_OPND_NIL, /* no operand---MUST BE FIRST!*/ + + /* constants */ + IA64_OPND_AR_CCV, /* application register ccv (ar.ccv) */ + IA64_OPND_AR_PFS, /* application register pfs (ar.pfs) */ + IA64_OPND_C1, /* the constant 1 */ + IA64_OPND_C8, /* the constant 8 */ + IA64_OPND_C16, /* the constant 16 */ + IA64_OPND_GR0, /* gr0 */ + IA64_OPND_IP, /* instruction pointer (ip) */ + IA64_OPND_PR, /* predicate register (pr) */ + IA64_OPND_PR_ROT, /* rotating predicate register (pr.rot) */ + IA64_OPND_PSR, /* processor status register (psr) */ + IA64_OPND_PSR_L, /* processor status register L (psr.l) */ + IA64_OPND_PSR_UM, /* processor status register UM (psr.um) */ + + /* register operands: */ + IA64_OPND_AR3, /* third application register # (bits 20-26) */ + IA64_OPND_B1, /* branch register # (bits 6-8) */ + IA64_OPND_B2, /* branch register # (bits 13-15) */ + IA64_OPND_CR3, /* third control register # (bits 20-26) */ + IA64_OPND_F1, /* first floating-point register # */ + IA64_OPND_F2, /* second floating-point register # */ + IA64_OPND_F3, /* third floating-point register # */ + IA64_OPND_F4, /* fourth floating-point register # */ + IA64_OPND_P1, /* first predicate # */ + IA64_OPND_P2, /* second predicate # */ + IA64_OPND_R1, /* first register # */ + IA64_OPND_R2, /* second register # */ + IA64_OPND_R3, /* third register # */ + IA64_OPND_R3_2, /* third register # (limited to gr0-gr3) */ + + /* indirect operands: */ + IA64_OPND_CPUID_R3, /* cpuid[reg] */ + IA64_OPND_DBR_R3, /* dbr[reg] */ + IA64_OPND_DTR_R3, /* dtr[reg] */ + IA64_OPND_ITR_R3, /* itr[reg] */ + IA64_OPND_IBR_R3, /* ibr[reg] */ + IA64_OPND_MR3, /* memory at addr of third register # */ + IA64_OPND_MSR_R3, /* msr[reg] */ + IA64_OPND_PKR_R3, /* pkr[reg] */ + IA64_OPND_PMC_R3, /* pmc[reg] */ + IA64_OPND_PMD_R3, /* pmd[reg] */ + IA64_OPND_RR_R3, /* rr[reg] */ + + /* immediate operands: */ + IA64_OPND_CCNT5, /* 5-bit count (31 - bits 20-24) */ + IA64_OPND_CNT2a, /* 2-bit count (1 + bits 27-28) */ + IA64_OPND_CNT2b, /* 2-bit count (bits 27-28): 1, 2, 3 */ + IA64_OPND_CNT2c, /* 2-bit count (bits 30-31): 0, 7, 15, or 16 */ + IA64_OPND_CNT5, /* 5-bit count (bits 14-18) */ + IA64_OPND_CNT6, /* 6-bit count (bits 27-32) */ + IA64_OPND_CPOS6a, /* 6-bit count (63 - bits 20-25) */ + IA64_OPND_CPOS6b, /* 6-bit count (63 - bits 14-19) */ + IA64_OPND_CPOS6c, /* 6-bit count (63 - bits 31-36) */ + IA64_OPND_IMM1, /* signed 1-bit immediate (bit 36) */ + IA64_OPND_IMMU2, /* unsigned 2-bit immediate (bits 13-14) */ + IA64_OPND_IMMU7a, /* unsigned 7-bit immediate (bits 13-19) */ + IA64_OPND_IMMU7b, /* unsigned 7-bit immediate (bits 20-26) */ + IA64_OPND_SOF, /* 8-bit stack frame size */ + IA64_OPND_SOL, /* 8-bit size of locals */ + IA64_OPND_SOR, /* 6-bit number of rotating registers (scaled by 8) */ + IA64_OPND_IMM8, /* signed 8-bit immediate (bits 13-19 & 36) */ + IA64_OPND_IMM8U4, /* cmp4*u signed 8-bit immediate (bits 13-19 & 36) */ + IA64_OPND_IMM8M1, /* signed 8-bit immediate -1 (bits 13-19 & 36) */ + IA64_OPND_IMM8M1U4, /* cmp4*u signed 8-bit immediate -1 (bits 13-19 & 36)*/ + IA64_OPND_IMM8M1U8, /* cmp*u signed 8-bit immediate -1 (bits 13-19 & 36) */ + IA64_OPND_IMMU9, /* unsigned 9-bit immediate (bits 33-34, 20-26) */ + IA64_OPND_IMM9a, /* signed 9-bit immediate (bits 6-12, 27, 36) */ + IA64_OPND_IMM9b, /* signed 9-bit immediate (bits 13-19, 27, 36) */ + IA64_OPND_IMM14, /* signed 14-bit immediate (bits 13-19, 27-32, 36) */ + IA64_OPND_IMM17, /* signed 17-bit immediate (2*bits 6-12, 24-31, 36) */ + IA64_OPND_IMMU21, /* unsigned 21-bit immediate (bits 6-25, 36) */ + IA64_OPND_IMM22, /* signed 22-bit immediate (bits 13-19, 22-36) */ + IA64_OPND_IMMU24, /* unsigned 24-bit immediate (bits 6-26, 31-32, 36) */ + IA64_OPND_IMM44, /* signed 44-bit immediate (2^16*bits 6-32, 36) */ + IA64_OPND_IMMU62, /* unsigned 62-bit immediate */ + IA64_OPND_IMMU64, /* unsigned 64-bit immediate (lotsa bits...) */ + IA64_OPND_INC3, /* signed 3-bit (bits 13-15): +/-1, 4, 8, 16 */ + IA64_OPND_LEN4, /* 4-bit count (bits 27-30 + 1) */ + IA64_OPND_LEN6, /* 6-bit count (bits 27-32 + 1) */ + IA64_OPND_MBTYPE4, /* 4-bit mux type (bits 20-23) */ + IA64_OPND_MHTYPE8, /* 8-bit mux type (bits 20-27) */ + IA64_OPND_POS6, /* 6-bit count (bits 14-19) */ + IA64_OPND_TAG13, /* signed 13-bit tag (ip + 16*bits 6-12, 33-34) */ + IA64_OPND_TAG13b, /* signed 13-bit tag (ip + 16*bits 24-32) */ + IA64_OPND_TGT25, /* signed 25-bit (ip + 16*bits 6-25, 36) */ + IA64_OPND_TGT25b, /* signed 25-bit (ip + 16*bits 6-12, 20-32, 36) */ + IA64_OPND_TGT25c, /* signed 25-bit (ip + 16*bits 13-32, 36) */ + IA64_OPND_TGT64, /* 64-bit (ip + 16*bits 13-32, 36, 2-40(L)) */ + + IA64_OPND_COUNT /* # of operand types (MUST BE LAST!) */ + }; + +enum ia64_dependency_mode +{ + IA64_DV_RAW, + IA64_DV_WAW, + IA64_DV_WAR, +}; + +enum ia64_dependency_semantics +{ + IA64_DVS_NONE, + IA64_DVS_IMPLIED, + IA64_DVS_IMPLIEDF, + IA64_DVS_DATA, + IA64_DVS_INSTR, + IA64_DVS_SPECIFIC, + IA64_DVS_STOP, + IA64_DVS_OTHER, +}; + +enum ia64_resource_specifier +{ + IA64_RS_ANY, + IA64_RS_AR_K, + IA64_RS_AR_UNAT, + IA64_RS_AR, /* 8-15, 20, 22-23, 31, 33-35, 37-39, 41-43, 45-47, 67-111 */ + IA64_RS_ARb, /* 48-63, 112-127 */ + IA64_RS_BR, + IA64_RS_CFM, + IA64_RS_CPUID, + IA64_RS_CR_IRR, + IA64_RS_CR_LRR, + IA64_RS_CR, /* 3-7,10-15,18,26-63,75-79,82-127 */ + IA64_RS_DBR, + IA64_RS_FR, + IA64_RS_FRb, + IA64_RS_GR0, + IA64_RS_GR, + IA64_RS_IBR, + IA64_RS_INSERVICE, /* CR[EOI] or CR[IVR] */ + IA64_RS_MSR, + IA64_RS_PKR, + IA64_RS_PMC, + IA64_RS_PMD, + IA64_RS_PR, /* non-rotating, 1-15 */ + IA64_RS_PRr, /* rotating, 16-62 */ + IA64_RS_PR63, + IA64_RS_RR, + + IA64_RS_ARX, /* ARs not in RS_AR or RS_ARb */ + IA64_RS_CRX, /* CRs not in RS_CR */ + IA64_RS_PSR, /* PSR bits */ + IA64_RS_RSE, /* implementation-specific RSE resources */ + IA64_RS_AR_FPSR, +}; + +enum ia64_rse_resource +{ + IA64_RSE_N_STACKED_PHYS, + IA64_RSE_BOF, + IA64_RSE_STORE_REG, + IA64_RSE_LOAD_REG, + IA64_RSE_BSPLOAD, + IA64_RSE_RNATBITINDEX, + IA64_RSE_CFLE, + IA64_RSE_NDIRTY, +}; + +/* Information about a given resource dependency */ +struct ia64_dependency +{ + /* Name of the resource */ + const char *name; + /* Does this dependency need further specification? */ + enum ia64_resource_specifier specifier; + /* Mode of dependency */ + enum ia64_dependency_mode mode; + /* Dependency semantics */ + enum ia64_dependency_semantics semantics; + /* Register index, if applicable (distinguishes AR, CR, and PSR deps) */ +#define REG_NONE (-1) + int regindex; + /* Special info on semantics */ + const char *info; +}; + +/* Two arrays of indexes into the ia64_dependency table. + chks are dependencies to check for conflicts when an opcode is + encountered; regs are dependencies to register (mark as used) when an + opcode is used. chks correspond to readers (RAW) or writers (WAW or + WAR) of a resource, while regs correspond to writers (RAW or WAW) and + readers (WAR) of a resource. */ +struct ia64_opcode_dependency +{ + int nchks; + const unsigned short *chks; + int nregs; + const unsigned short *regs; +}; + +/* encode/extract the note/index for a dependency */ +#define RDEP(N,X) (((N)<<11)|(X)) +#define NOTE(X) (((X)>>11)&0x1F) +#define DEP(X) ((X)&0x7FF) + +/* A template descriptor describes the execution units that are active + for each of the three slots. It also specifies the location of + instruction group boundaries that may be present between two slots. */ +struct ia64_templ_desc + { + int group_boundary; /* 0=no boundary, 1=between slot 0 & 1, etc. */ + enum ia64_unit exec_unit[3]; + const char *name; + }; + +/* The opcode table is an array of struct ia64_opcode. */ + +struct ia64_opcode + { + /* The opcode name. */ + const char *name; + + /* The type of the instruction: */ + enum ia64_insn_type type; + + /* Number of output operands: */ + int num_outputs; + + /* The opcode itself. Those bits which will be filled in with + operands are zeroes. */ + ia64_insn opcode; + + /* The opcode mask. This is used by the disassembler. This is a + mask containing ones indicating those bits which must match the + opcode field, and zeroes indicating those bits which need not + match (and are presumably filled in by operands). */ + ia64_insn mask; + + /* An array of operand codes. Each code is an index into the + operand table. They appear in the order which the operands must + appear in assembly code, and are terminated by a zero. */ + enum ia64_opnd operands[5]; + + /* One bit flags for the opcode. These are primarily used to + indicate specific processors and environments support the + instructions. The defined values are listed below. */ + unsigned int flags; + + /* Used by ia64_find_next_opcode (). */ + short ent_index; + + /* Opcode dependencies. */ + const struct ia64_opcode_dependency *dependencies; + }; + +/* Values defined for the flags field of a struct ia64_opcode. */ + +#define IA64_OPCODE_FIRST (1<<0) /* must be first in an insn group */ +#define IA64_OPCODE_X_IN_MLX (1<<1) /* insn is allowed in X slot of MLX */ +#define IA64_OPCODE_LAST (1<<2) /* must be last in an insn group */ +#define IA64_OPCODE_PRIV (1<<3) /* privileged instruct */ +#define IA64_OPCODE_SLOT2 (1<<4) /* insn allowed in slot 2 only */ +#define IA64_OPCODE_NO_PRED (1<<5) /* insn cannot be predicated */ +#define IA64_OPCODE_PSEUDO (1<<6) /* insn is a pseudo-op */ +#define IA64_OPCODE_F2_EQ_F3 (1<<7) /* constraint: F2 == F3 */ +#define IA64_OPCODE_LEN_EQ_64MCNT (1<<8) /* constraint: LEN == 64-CNT */ +#define IA64_OPCODE_MOD_RRBS (1<<9) /* modifies all rrbs in CFM */ +#define IA64_OPCODE_POSTINC (1<<10) /* postincrement MR3 operand */ + +/* A macro to extract the major opcode from an instruction. */ +#define IA64_OP(i) (((i) >> 37) & 0xf) + +enum ia64_operand_class + { + IA64_OPND_CLASS_CST, /* constant */ + IA64_OPND_CLASS_REG, /* register */ + IA64_OPND_CLASS_IND, /* indirect register */ + IA64_OPND_CLASS_ABS, /* absolute value */ + IA64_OPND_CLASS_REL, /* IP-relative value */ + }; + +/* The operands table is an array of struct ia64_operand. */ + +struct ia64_operand +{ + enum ia64_operand_class class; + + /* Set VALUE as the operand bits for the operand of type SELF in the + instruction pointed to by CODE. If an error occurs, *CODE is not + modified and the returned string describes the cause of the + error. If no error occurs, NULL is returned. */ + const char *(*insert) (const struct ia64_operand *self, ia64_insn value, + ia64_insn *code); + + /* Extract the operand bits for an operand of type SELF from + instruction CODE store them in *VALUE. If an error occurs, the + cause of the error is described by the string returned. If no + error occurs, NULL is returned. */ + const char *(*extract) (const struct ia64_operand *self, ia64_insn code, + ia64_insn *value); + + /* A string whose meaning depends on the operand class. */ + + const char *str; + + struct bit_field + { + /* The number of bits in the operand. */ + int bits; + + /* How far the operand is left shifted in the instruction. */ + int shift; + } + field[4]; /* no operand has more than this many bit-fields */ + + unsigned int flags; + + const char *desc; /* brief description */ +}; + +/* Values defined for the flags field of a struct ia64_operand. */ + +/* Disassemble as signed decimal (instead of hex): */ +#define IA64_OPND_FLAG_DECIMAL_SIGNED (1<<0) +/* Disassemble as unsigned decimal (instead of hex): */ +#define IA64_OPND_FLAG_DECIMAL_UNSIGNED (1<<1) + +extern const struct ia64_templ_desc ia64_templ_desc[16]; + +/* The tables are sorted by major opcode number and are otherwise in + the order in which the disassembler should consider instructions. */ +extern struct ia64_opcode ia64_opcodes_a[]; +extern struct ia64_opcode ia64_opcodes_i[]; +extern struct ia64_opcode ia64_opcodes_m[]; +extern struct ia64_opcode ia64_opcodes_b[]; +extern struct ia64_opcode ia64_opcodes_f[]; +extern struct ia64_opcode ia64_opcodes_d[]; + + +extern struct ia64_opcode *ia64_find_opcode (const char *name); +extern struct ia64_opcode *ia64_find_next_opcode (struct ia64_opcode *ent); + +extern struct ia64_opcode *ia64_dis_opcode (ia64_insn insn, + enum ia64_insn_type type); + +extern void ia64_free_opcode (struct ia64_opcode *ent); +extern const struct ia64_dependency *ia64_find_dependency (int index); + +/* To avoid circular library dependencies, this array is implemented + in bfd/cpu-ia64-opc.c: */ +extern const struct ia64_operand elf64_ia64_operands[IA64_OPND_COUNT]; + +#endif /* opcode_ia64_h */ diff --git a/contrib/binutils/ld/emulparams/elf64_ia64.sh b/contrib/binutils/ld/emulparams/elf64_ia64.sh new file mode 100644 index 0000000..fff5992 --- /dev/null +++ b/contrib/binutils/ld/emulparams/elf64_ia64.sh @@ -0,0 +1,15 @@ +# See genscripts.sh and ../scripttempl/elf.sc for the meaning of these. +SCRIPT_NAME=elf +ELFSIZE=64 +TEMPLATE_NAME=elf32 +OUTPUT_FORMAT="elf64-ia64-little" +ARCH=ia64 +MACHINE= +MAXPAGESIZE=0x10000 +TEXT_START_ADDR="0x4000000000000000" +DATA_ADDR="0x6000000000000000 + (. & (${MAXPAGESIZE} - 1))" +GENERATE_SHLIB_SCRIPT=yes +NOP=0x00300000010070000002000001000400 # a bundle full of nops +OTHER_GOT_SECTIONS='.IA_64.pltoff : { *(.IA_64.pltoff) }' +OTHER_PLT_RELOC_SECTIONS='.rela.IA_64.pltoff : { *(.rela.IA_64.pltoff) }' +OTHER_READONLY_SECTIONS='.opd : { *(.opd) } .IA_64.unwind_info : { *(.IA_64.unwind_info*) } .IA_64.unwind : { *(.IA_64.unwind*) }' diff --git a/contrib/binutils/ltcf-c.sh b/contrib/binutils/ltcf-c.sh new file mode 100644 index 0000000..e57abb1 --- /dev/null +++ b/contrib/binutils/ltcf-c.sh @@ -0,0 +1,689 @@ +#### This script is meant to be sourced by ltconfig. + +# ltcf-c.sh - Create a C compiler specific configuration +# +# Copyright (C) 1996-2000 Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='main(){return(0);}' + +## Linker Characteristics +case "$host_os" in +cygwin* | mingw*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$with_gcc" != yes; then + with_gnu_ld=no + fi + ;; + +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case "$host_os" in + aix3* | aix4*) + # On AIX, the GNU linker is very broken + ld_shlibs=no + cat <<EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + + # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach <jrb3@best.com> says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=yes + + extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ + sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/impgen.c~ + test -f $output_objdir/impgen.exe || (cd $output_objdir && \ + if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ + else $CC -o impgen impgen.c ; fi)~ + $output_objdir/impgen $dir/$soname > $output_objdir/$soname-def' + + old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' + + # cygwin and mingw dlls have different entry points and sets of symbols + # to exclude. + # FIXME: what about values for MSVC? + dll_entry=__cygwin_dll_entry@12 + dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ + case "$host_os" in + mingw*) + # mingw values + dll_entry=_DllMainCRTStartup@12 + dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ + ;; + esac + + # mingw and cygwin differ, and it's simplest to just exclude the union + # of the two symbol sets. + dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 + + # recent cygwin and mingw systems supply a stub DllMain which the user + # can override, but on older systems we have to supply one (in ltdll.c) + if test "x$lt_cv_need_dllmain" = "xyes"; then + ltdll_obj='$output_objdir/$soname-ltdll.'"$objext " + ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/$soname-ltdll.c~ + test -f $output_objdir/$soname-ltdll.$objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' + else + ltdll_obj= + ltdll_cmds= + fi + + # Extract the symbol export list from an `--export-all' def file, + # then regenerate the def file from the symbol export list, so that + # the compiled dll only exports the symbol export list. + # Be careful not to strip the DATA tag left be newer dlltools. + export_symbols_cmds="$ltdll_cmds"' + $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ + sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' + + # If DATA tags from a recent dlltool are present, honour them! + archive_expsym_cmds='echo EXPORTS > $output_objdir/$soname-def~ + _lt_hint=1; + cat $export_symbols | while read symbol; do + set dummy \$symbol; + case \$# in + 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; + *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;; + esac; + _lt_hint=`expr 1 + \$_lt_hint`; + done~ + '"$ltdll_cmds"' + $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ + $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ + $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags' + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = yes; then + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + case $host_os in + cygwin* | mingw*) + # dlltool doesn't understand --whole-archive et. al. + whole_archive_flag_spec= + ;; + *) + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + ;; + esac + fi +else + # PORTME fill in a description of your system's linker (not GNU ld) + case "$host_os" in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$with_gcc" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix4*) + hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib' + hardcode_libdir_separator=':' + if test "$with_gcc" = yes; then + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + shared_flag='-shared' + else + shared_flag='${wl}-bM:SRE' + hardcode_direct=yes + fi + allow_undefined_flag=' ${wl}-berok' + archive_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}' + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}' + case "$host_os" in aix4.[01]|aix4.[01].*) + # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on + always_export_symbols=yes ;; + esac + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + + cygwin* | mingw*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w $srcfile`' + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9* | hpux10* | hpux11*) + case "$host_os" in + hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; + *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; + esac + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_minus_L=yes # Not in the search PATH, but as the default + # location of the library. + export_dynamic_flag_spec='${wl}-E' + ;; + + irix5* | irix6*) + if test "$with_gcc" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='${wl}-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + openbsd*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$with_gcc" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$with_gcc" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + sco3.2v5*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + no_undefined_flag=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case "$host_os" in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv5*) + no_undefined_flag=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + hardcode_libdir_flag_spec= + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=no + hardcode_shlibpath_var=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + unixware7*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac +fi + +## Compiler Characteristics: PIC flags, static flags, etc +if test "X${ac_cv_prog_cc_pic+set}" = Xset; then + : +else + ac_cv_prog_cc_pic= + ac_cv_prog_cc_shlib= + ac_cv_prog_cc_wl= + ac_cv_prog_cc_static= + ac_cv_prog_cc_no_builtin= + ac_cv_prog_cc_can_build_shared=$can_build_shared + + if test "$with_gcc" = yes; then + ac_cv_prog_cc_wl='-Wl,' + ac_cv_prog_cc_static='-static' + + case "$host_os" in + beos* | irix5* | irix6* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + aix*) + # Below there is a dirty hack to force normal static linking with -ldl + # The problem is because libdl dynamically linked with both libc and + # libC (AIX C++ library), which obviously doesn't included in libraries + # list by gcc. This cause undefined symbols with -static flags. + # This hack allows C programs to be linked with "-static -ldl", but + # we not sure about C++ programs. + ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC" + ;; + cygwin* | mingw* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + ac_cv_prog_cc_pic='-DDLL_EXPORT' + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' + ;; + sysv4*MP*) + if test -d /usr/nec; then + ac_cv_prog_cc_pic=-Kconform_pic + fi + ;; + *) + ac_cv_prog_cc_pic='-fPIC' + ;; + esac + else + # PORTME Check for PIC flags for the system compiler. + case "$host_os" in + aix3* | aix4*) + # All AIX code is PIC. + ac_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' + ;; + + hpux9* | hpux10* | hpux11*) + # Is there a better ac_cv_prog_cc_static that works with the bundled CC? + ac_cv_prog_cc_wl='-Wl,' + ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + ac_cv_prog_cc_pic='+Z' + ;; + + irix5* | irix6*) + ac_cv_prog_cc_wl='-Wl,' + ac_cv_prog_cc_static='-non_shared' + # PIC (with -KPIC) is the default. + ;; + + cygwin* | mingw* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + ac_cv_prog_cc_pic='-DDLL_EXPORT' + ;; + + osf3* | osf4* | osf5*) + # All OSF/1 code is PIC. + ac_cv_prog_cc_wl='-Wl,' + ac_cv_prog_cc_static='-non_shared' + ;; + + sco3.2v5*) + ac_cv_prog_cc_pic='-Kpic' + ac_cv_prog_cc_static='-dn' + ac_cv_prog_cc_shlib='-belf' + ;; + + solaris*) + ac_cv_prog_cc_pic='-KPIC' + ac_cv_prog_cc_static='-Bstatic' + ac_cv_prog_cc_wl='-Wl,' + ;; + + sunos4*) + ac_cv_prog_cc_pic='-PIC' + ac_cv_prog_cc_static='-Bstatic' + ac_cv_prog_cc_wl='-Qoption ld ' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + ac_cv_prog_cc_pic='-KPIC' + ac_cv_prog_cc_static='-Bstatic' + ac_cv_prog_cc_wl='-Wl,' + ;; + + uts4*) + ac_cv_prog_cc_pic='-pic' + ac_cv_prog_cc_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + ac_cv_prog_cc_pic='-Kconform_pic' + ac_cv_prog_cc_static='-Bstatic' + fi + ;; + + *) + ac_cv_prog_cc_can_build_shared=no + ;; + esac + fi + ac_cv_prog_cc_pic="$ac_cv_prog_cc_pic -DPIC" +fi + +need_lc=yes +if test "$enable_shared" = yes && test "$with_gcc" = yes; then + case "$archive_cmds" in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + echo $ac_n "checking whether -lc should be explicitly linked in... $ac_c" 1>&6 + if eval "test \"`echo '$''{'ac_cv_archive_cmds_needs_lc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + need_lc=$ac_cv_archive_cmds_needs_lc + else + $rm conftest* + echo "static int dummy;" > conftest.$ac_ext + if { (eval echo ltcf-c.sh:need_lc: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then + # Append any warnings to the config.log. + cat conftest.err 1>&5 + soname=conftest + lib=conftest + libobjs=conftest.o + deplibs= + wl=$ac_cv_prog_cc_wl + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo ltcf-c.sh:need_lc: \"$archive_cmds\") 1>&5; (eval $archive_cmds) 2>&1 | grep " -lc " 1>&5 ; }; then + need_lc=no + fi + allow_undefined_flag=$save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + fi + $rm conftest* + echo "$ac_t$need_lc" 1>&6 + ;; + esac +fi +ac_cv_archive_cmds_needs_lc=$need_lc diff --git a/contrib/binutils/opcodes/ia64-asmtab.c b/contrib/binutils/opcodes/ia64-asmtab.c new file mode 100644 index 0000000..03ec73c --- /dev/null +++ b/contrib/binutils/opcodes/ia64-asmtab.c @@ -0,0 +1,7436 @@ +/* This file is automatically generated by ia64-gen. Do not edit! */ +static const char *ia64_strings[] = { + "", "0", "1", "a", "acq", "add", "addl", "addp4", "adds", "alloc", "and", + "andcm", "b", "bias", "br", "break", "brl", "brp", "bsw", "c", "call", + "cexit", "chk", "cloop", "clr", "clrrrb", "cmp", "cmp4", "cmpxchg1", + "cmpxchg2", "cmpxchg4", "cmpxchg8", "cond", "cover", "ctop", "czx1", + "czx2", "d", "dep", "dpnt", "dptk", "e", "epc", "eq", "excl", "exit", + "exp", "extr", "f", "fabs", "fadd", "famax", "famin", "fand", "fandcm", + "fault", "fc", "fchkf", "fclass", "fclrf", "fcmp", "fcvt", "fetchadd4", + "fetchadd8", "few", "fill", "flushrs", "fma", "fmax", "fmerge", "fmin", + "fmix", "fmpy", "fms", "fneg", "fnegabs", "fnma", "fnmpy", "fnorm", "for", + "fpabs", "fpack", "fpamax", "fpamin", "fpcmp", "fpcvt", "fpma", "fpmax", + "fpmerge", "fpmin", "fpmpy", "fpms", "fpneg", "fpnegabs", "fpnma", + "fpnmpy", "fprcpa", "fprsqrta", "frcpa", "frsqrta", "fselect", "fsetc", + "fsub", "fswap", "fsxt", "fwb", "fx", "fxor", "fxu", "g", "ga", "ge", + "getf", "geu", "gt", "gtu", "h", "hu", "i", "ia", "imp", "invala", "itc", + "itr", "l", "ld1", "ld2", "ld4", "ld8", "ldf", "ldf8", "ldfd", "ldfe", + "ldfp8", "ldfpd", "ldfps", "ldfs", "le", "leu", "lfetch", "loadrs", + "loop", "lr", "lt", "ltu", "lu", "m", "many", "mf", "mix1", "mix2", + "mix4", "mov", "movl", "mux1", "mux2", "nc", "ne", "neq", "nge", "ngt", + "nl", "nle", "nlt", "nm", "nop", "nr", "ns", "nt1", "nt2", "nta", "nz", + "or", "orcm", "ord", "pack2", "pack4", "padd1", "padd2", "padd4", "pavg1", + "pavg2", "pavgsub1", "pavgsub2", "pcmp1", "pcmp2", "pcmp4", "pmax1", + "pmax2", "pmin1", "pmin2", "pmpy2", "pmpyshr2", "popcnt", "pr", "probe", + "psad1", "pshl2", "pshl4", "pshladd2", "pshr2", "pshr4", "pshradd2", + "psub1", "psub2", "psub4", "ptc", "ptr", "r", "raz", "rel", "ret", "rfi", + "rsm", "rum", "rw", "s", "s0", "s1", "s2", "s3", "sa", "se", "setf", + "shl", "shladd", "shladdp4", "shr", "shrp", "sig", "spill", "spnt", + "sptk", "srlz", "ssm", "sss", "st1", "st2", "st4", "st8", "stf", "stf8", + "stfd", "stfe", "stfs", "sub", "sum", "sxt1", "sxt2", "sxt4", "sync", + "tak", "tbit", "thash", "tnat", "tpa", "trunc", "ttag", "u", "unc", + "unord", "unpack1", "unpack2", "unpack4", "uss", "uus", "uuu", "w", + "wexit", "wtop", "x", "xchg1", "xchg2", "xchg4", "xchg8", "xf", "xma", + "xmpy", "xor", "xuf", "z", "zxt1", "zxt2", "zxt4", +}; + +static const struct ia64_dependency +dependencies[] = { + { "ALAT", 0, 0, 0, -1, NULL, }, + { "AR[BSP]", 26, 0, 2, 17, NULL, }, + { "AR[BSPSTORE]", 26, 0, 2, 18, NULL, }, + { "AR[CCV]", 26, 0, 2, 32, NULL, }, + { "AR[EC]", 26, 0, 2, 66, NULL, }, + { "AR[FPSR].sf0.controls", 30, 0, 2, -1, NULL, }, + { "AR[FPSR].sf1.controls", 30, 0, 2, -1, NULL, }, + { "AR[FPSR].sf2.controls", 30, 0, 2, -1, NULL, }, + { "AR[FPSR].sf3.controls", 30, 0, 2, -1, NULL, }, + { "AR[FPSR].sf0.flags", 30, 0, 2, -1, NULL, }, + { "AR[FPSR].sf1.flags", 30, 0, 2, -1, NULL, }, + { "AR[FPSR].sf2.flags", 30, 0, 2, -1, NULL, }, + { "AR[FPSR].sf3.flags", 30, 0, 2, -1, NULL, }, + { "AR[FPSR].traps", 30, 0, 2, -1, NULL, }, + { "AR[FPSR].rv", 30, 0, 2, -1, NULL, }, + { "AR[ITC]", 26, 0, 2, 44, NULL, }, + { "AR[K%], % in 0 - 7", 1, 0, 2, -1, NULL, }, + { "AR[LC]", 26, 0, 2, 65, NULL, }, + { "AR[PFS]", 26, 0, 2, 64, NULL, }, + { "AR[PFS]", 26, 0, 2, 64, NULL, }, + { "AR[PFS]", 26, 0, 0, 64, NULL, }, + { "AR[RNAT]", 26, 0, 2, 19, NULL, }, + { "AR[RSC]", 26, 0, 2, 16, NULL, }, + { "AR[UNAT]{%}, % in 0 - 63", 2, 0, 2, -1, NULL, }, + { "AR%, % in 8-15, 20, 22-23, 31, 33-35, 37-39, 41-43, 45-47, 67-111", 3, 0, 0, -1, NULL, }, + { "AR%, % in 48-63, 112-127", 4, 0, 2, -1, NULL, }, + { "BR%, % in 0 - 7", 5, 0, 2, -1, NULL, }, + { "BR%, % in 0 - 7", 5, 0, 0, -1, NULL, }, + { "BR%, % in 0 - 7", 5, 0, 2, -1, NULL, }, + { "CFM", 6, 0, 2, -1, NULL, }, + { "CFM", 6, 0, 2, -1, NULL, }, + { "CFM", 6, 0, 2, -1, NULL, }, + { "CFM", 6, 0, 2, -1, NULL, }, + { "CFM", 6, 0, 0, -1, NULL, }, + { "CPUID#", 7, 0, 5, -1, NULL, }, + { "CR[CMCV]", 27, 0, 3, 74, NULL, }, + { "CR[DCR]", 27, 0, 3, 0, NULL, }, + { "CR[EOI]", 27, 0, 7, 67, "SC Section 10.8.3.4", }, + { "CR[GPTA]", 27, 0, 3, 9, NULL, }, + { "CR[IFA]", 27, 0, 1, 20, NULL, }, + { "CR[IFA]", 27, 0, 3, 20, NULL, }, + { "CR[IFS]", 27, 0, 3, 23, NULL, }, + { "CR[IFS]", 27, 0, 1, 23, NULL, }, + { "CR[IFS]", 27, 0, 1, 23, NULL, }, + { "CR[IHA]", 27, 0, 3, 25, NULL, }, + { "CR[IIM]", 27, 0, 3, 24, NULL, }, + { "CR[IIP]", 27, 0, 3, 19, NULL, }, + { "CR[IIP]", 27, 0, 1, 19, NULL, }, + { "CR[IIPA]", 27, 0, 3, 22, NULL, }, + { "CR[IPSR]", 27, 0, 3, 16, NULL, }, + { "CR[IPSR]", 27, 0, 1, 16, NULL, }, + { "CR[IRR%], % in 0 - 3", 8, 0, 3, -1, NULL, }, + { "CR[ISR]", 27, 0, 3, 17, NULL, }, + { "CR[ITIR]", 27, 0, 3, 21, NULL, }, + { "CR[ITIR]", 27, 0, 1, 21, NULL, }, + { "CR[ITM]", 27, 0, 3, 1, NULL, }, + { "CR[ITV]", 27, 0, 3, 72, NULL, }, + { "CR[IVA]", 27, 0, 4, 2, NULL, }, + { "CR[IVR]", 27, 0, 7, 65, "SC Section 10.8.3.2", }, + { "CR[LID]", 27, 0, 7, 64, "SC Section 10.8.3.1", }, + { "CR[LRR%], % in 0 - 1", 9, 0, 3, -1, NULL, }, + { "CR[PMV]", 27, 0, 3, 73, NULL, }, + { "CR[PTA]", 27, 0, 3, 8, NULL, }, + { "CR[TPR]", 27, 0, 3, 66, NULL, }, + { "CR[TPR]", 27, 0, 7, 66, "SC Section 10.8.3.3", }, + { "CR%, % in 3-7, 10-15, 18, 26-63, 75-79, 82-127", 10, 0, 0, -1, NULL, }, + { "DBR#", 11, 0, 2, -1, NULL, }, + { "DBR#", 11, 0, 3, -1, NULL, }, + { "DTC", 0, 0, 3, -1, NULL, }, + { "DTC", 0, 0, 2, -1, NULL, }, + { "DTC", 0, 0, 0, -1, NULL, }, + { "DTC", 0, 0, 2, -1, NULL, }, + { "DTC_LIMIT*", 0, 0, 2, -1, NULL, }, + { "DTR", 0, 0, 3, -1, NULL, }, + { "DTR", 0, 0, 2, -1, NULL, }, + { "DTR", 0, 0, 3, -1, NULL, }, + { "DTR", 0, 0, 0, -1, NULL, }, + { "DTR", 0, 0, 2, -1, NULL, }, + { "FR%, % in 0 - 1", 12, 0, 0, -1, NULL, }, + { "FR%, % in 2 - 127", 13, 0, 2, -1, NULL, }, + { "FR%, % in 2 - 127", 13, 0, 0, -1, NULL, }, + { "GR0", 14, 0, 0, -1, NULL, }, + { "GR%, % in 1 - 127", 15, 0, 0, -1, NULL, }, + { "GR%, % in 1 - 127", 15, 0, 2, -1, NULL, }, + { "IBR#", 16, 0, 2, -1, NULL, }, + { "InService*", 17, 0, 3, -1, NULL, }, + { "InService*", 17, 0, 2, -1, NULL, }, + { "InService*", 17, 0, 2, -1, NULL, }, + { "IP", 0, 0, 0, -1, NULL, }, + { "ITC", 0, 0, 4, -1, NULL, }, + { "ITC", 0, 0, 2, -1, NULL, }, + { "ITC", 0, 0, 0, -1, NULL, }, + { "ITC", 0, 0, 4, -1, NULL, }, + { "ITC", 0, 0, 2, -1, NULL, }, + { "ITC_LIMIT*", 0, 0, 2, -1, NULL, }, + { "ITR", 0, 0, 2, -1, NULL, }, + { "ITR", 0, 0, 4, -1, NULL, }, + { "ITR", 0, 0, 2, -1, NULL, }, + { "ITR", 0, 0, 0, -1, NULL, }, + { "ITR", 0, 0, 4, -1, NULL, }, + { "memory", 0, 0, 0, -1, NULL, }, + { "MSR#", 18, 0, 5, -1, NULL, }, + { "PKR#", 19, 0, 3, -1, NULL, }, + { "PKR#", 19, 0, 0, -1, NULL, }, + { "PKR#", 19, 0, 2, -1, NULL, }, + { "PKR#", 19, 0, 2, -1, NULL, }, + { "PMC#", 20, 0, 2, -1, NULL, }, + { "PMC#", 20, 0, 7, -1, "SC+3 Section 12.1.1", }, + { "PMD#", 21, 0, 2, -1, NULL, }, + { "PR0", 0, 0, 0, -1, NULL, }, + { "PR%, % in 1 - 15", 22, 0, 2, -1, NULL, }, + { "PR%, % in 1 - 15", 22, 0, 2, -1, NULL, }, + { "PR%, % in 1 - 15", 22, 0, 0, -1, NULL, }, + { "PR%, % in 16 - 62", 23, 0, 2, -1, NULL, }, + { "PR%, % in 16 - 62", 23, 0, 2, -1, NULL, }, + { "PR%, % in 16 - 62", 23, 0, 0, -1, NULL, }, + { "PR63", 24, 0, 2, -1, NULL, }, + { "PR63", 24, 0, 2, -1, NULL, }, + { "PR63", 24, 0, 0, -1, NULL, }, + { "PSR.ac", 28, 0, 1, 3, NULL, }, + { "PSR.ac", 28, 0, 3, 3, NULL, }, + { "PSR.ac", 28, 0, 2, 3, NULL, }, + { "PSR.be", 28, 0, 1, 1, NULL, }, + { "PSR.be", 28, 0, 3, 1, NULL, }, + { "PSR.be", 28, 0, 2, 1, NULL, }, + { "PSR.bn", 28, 0, 2, 44, NULL, }, + { "PSR.cpl", 28, 0, 1, 32, NULL, }, + { "PSR.da", 28, 0, 3, 38, NULL, }, + { "PSR.db", 28, 0, 3, 24, NULL, }, + { "PSR.db", 28, 0, 2, 24, NULL, }, + { "PSR.db", 28, 0, 3, 24, NULL, }, + { "PSR.dd", 28, 0, 3, 39, NULL, }, + { "PSR.dfh", 28, 0, 3, 19, NULL, }, + { "PSR.dfh", 28, 0, 2, 19, NULL, }, + { "PSR.dfl", 28, 0, 3, 18, NULL, }, + { "PSR.dfl", 28, 0, 2, 18, NULL, }, + { "PSR.di", 28, 0, 3, 22, NULL, }, + { "PSR.di", 28, 0, 2, 22, NULL, }, + { "PSR.dt", 28, 0, 3, 17, NULL, }, + { "PSR.dt", 28, 0, 2, 17, NULL, }, + { "PSR.ed", 28, 0, 3, 43, NULL, }, + { "PSR.i", 28, 0, 2, 14, NULL, }, + { "PSR.i", 28, 0, 3, 14, NULL, }, + { "PSR.ia", 28, 0, 0, 14, NULL, }, + { "PSR.ic", 28, 0, 2, 13, NULL, }, + { "PSR.ic", 28, 0, 3, 13, NULL, }, + { "PSR.id", 28, 0, 0, 14, NULL, }, + { "PSR.is", 28, 0, 0, 14, NULL, }, + { "PSR.it", 28, 0, 3, 14, NULL, }, + { "PSR.lp", 28, 0, 2, 25, NULL, }, + { "PSR.lp", 28, 0, 3, 25, NULL, }, + { "PSR.lp", 28, 0, 3, 25, NULL, }, + { "PSR.mc", 28, 0, 0, 35, NULL, }, + { "PSR.mfh", 28, 0, 2, 5, NULL, }, + { "PSR.mfl", 28, 0, 2, 4, NULL, }, + { "PSR.pk", 28, 0, 3, 15, NULL, }, + { "PSR.pk", 28, 0, 2, 15, NULL, }, + { "PSR.pp", 28, 0, 2, 21, NULL, }, + { "PSR.ri", 28, 0, 0, 41, NULL, }, + { "PSR.rt", 28, 0, 2, 27, NULL, }, + { "PSR.rt", 28, 0, 3, 27, NULL, }, + { "PSR.rt", 28, 0, 3, 27, NULL, }, + { "PSR.si", 28, 0, 2, 23, NULL, }, + { "PSR.si", 28, 0, 3, 23, NULL, }, + { "PSR.sp", 28, 0, 2, 20, NULL, }, + { "PSR.sp", 28, 0, 3, 20, NULL, }, + { "PSR.ss", 28, 0, 3, 40, NULL, }, + { "PSR.tb", 28, 0, 3, 26, NULL, }, + { "PSR.tb", 28, 0, 2, 26, NULL, }, + { "PSR.up", 28, 0, 2, 2, NULL, }, + { "RR#", 25, 0, 3, -1, NULL, }, + { "RR#", 25, 0, 2, -1, NULL, }, + { "RSE", 29, 0, 2, -1, NULL, }, + { "ALAT", 0, 1, 0, -1, NULL, }, + { "AR[BSP]", 26, 1, 2, 17, NULL, }, + { "AR[BSPSTORE]", 26, 1, 2, 18, NULL, }, + { "AR[CCV]", 26, 1, 2, 32, NULL, }, + { "AR[EC]", 26, 1, 2, 66, NULL, }, + { "AR[FPSR].sf0.controls", 30, 1, 2, -1, NULL, }, + { "AR[FPSR].sf1.controls", 30, 1, 2, -1, NULL, }, + { "AR[FPSR].sf2.controls", 30, 1, 2, -1, NULL, }, + { "AR[FPSR].sf3.controls", 30, 1, 2, -1, NULL, }, + { "AR[FPSR].sf0.flags", 30, 1, 0, -1, NULL, }, + { "AR[FPSR].sf0.flags", 30, 1, 2, -1, NULL, }, + { "AR[FPSR].sf0.flags", 30, 1, 2, -1, NULL, }, + { "AR[FPSR].sf1.flags", 30, 1, 0, -1, NULL, }, + { "AR[FPSR].sf1.flags", 30, 1, 2, -1, NULL, }, + { "AR[FPSR].sf1.flags", 30, 1, 2, -1, NULL, }, + { "AR[FPSR].sf2.flags", 30, 1, 0, -1, NULL, }, + { "AR[FPSR].sf2.flags", 30, 1, 2, -1, NULL, }, + { "AR[FPSR].sf2.flags", 30, 1, 2, -1, NULL, }, + { "AR[FPSR].sf3.flags", 30, 1, 0, -1, NULL, }, + { "AR[FPSR].sf3.flags", 30, 1, 2, -1, NULL, }, + { "AR[FPSR].sf3.flags", 30, 1, 2, -1, NULL, }, + { "AR[FPSR].rv", 30, 1, 2, -1, NULL, }, + { "AR[FPSR].traps", 30, 1, 2, -1, NULL, }, + { "AR[ITC]", 26, 1, 2, 44, NULL, }, + { "AR[K%], % in 0 - 7", 1, 1, 2, -1, NULL, }, + { "AR[LC]", 26, 1, 2, 65, NULL, }, + { "AR[PFS]", 26, 1, 0, 64, NULL, }, + { "AR[PFS]", 26, 1, 2, 64, NULL, }, + { "AR[PFS]", 26, 1, 2, 64, NULL, }, + { "AR[RNAT]", 26, 1, 2, 19, NULL, }, + { "AR[RSC]", 26, 1, 2, 16, NULL, }, + { "AR[UNAT]{%}, % in 0 - 63", 2, 1, 2, -1, NULL, }, + { "AR%, % in 8-15, 20, 22-23, 31, 33-35, 37-39, 41-43, 45-47, 67-111", 3, 1, 0, -1, NULL, }, + { "AR%, % in 48 - 63, 112-127", 4, 1, 2, -1, NULL, }, + { "BR%, % in 0 - 7", 5, 1, 2, -1, NULL, }, + { "BR%, % in 0 - 7", 5, 1, 2, -1, NULL, }, + { "BR%, % in 0 - 7", 5, 1, 2, -1, NULL, }, + { "BR%, % in 0 - 7", 5, 1, 0, -1, NULL, }, + { "CFM", 6, 1, 2, -1, NULL, }, + { "CPUID#", 7, 1, 0, -1, NULL, }, + { "CR[CMCV]", 27, 1, 2, 74, NULL, }, + { "CR[DCR]", 27, 1, 2, 0, NULL, }, + { "CR[EOI]", 27, 1, 7, 67, "SC Section 10.8.3.4", }, + { "CR[GPTA]", 27, 1, 2, 9, NULL, }, + { "CR[IFA]", 27, 1, 2, 20, NULL, }, + { "CR[IFS]", 27, 1, 2, 23, NULL, }, + { "CR[IHA]", 27, 1, 2, 25, NULL, }, + { "CR[IIM]", 27, 1, 2, 24, NULL, }, + { "CR[IIP]", 27, 1, 2, 19, NULL, }, + { "CR[IIPA]", 27, 1, 2, 22, NULL, }, + { "CR[IPSR]", 27, 1, 2, 16, NULL, }, + { "CR[IRR%], % in 0 - 3", 8, 1, 2, -1, NULL, }, + { "CR[ISR]", 27, 1, 2, 17, NULL, }, + { "CR[ITIR]", 27, 1, 2, 21, NULL, }, + { "CR[ITM]", 27, 1, 2, 1, NULL, }, + { "CR[ITV]", 27, 1, 2, 72, NULL, }, + { "CR[IVA]", 27, 1, 2, 2, NULL, }, + { "CR[IVR]", 27, 1, 7, 65, "SC", }, + { "CR[LID]", 27, 1, 7, 64, "SC", }, + { "CR[LRR%], % in 0 - 1", 9, 1, 2, -1, NULL, }, + { "CR[PMV]", 27, 1, 2, 73, NULL, }, + { "CR[PTA]", 27, 1, 2, 8, NULL, }, + { "CR[TPR]", 27, 1, 2, 66, NULL, }, + { "CR%, % in 3-7, 10-15, 18, 26-63, 75-79, 82-127", 10, 1, 0, -1, NULL, }, + { "DBR#", 11, 1, 2, -1, NULL, }, + { "DTC", 0, 1, 0, -1, NULL, }, + { "DTC", 0, 1, 2, -1, NULL, }, + { "DTC", 0, 1, 2, -1, NULL, }, + { "DTC_LIMIT*", 0, 1, 2, -1, NULL, }, + { "DTR", 0, 1, 2, -1, NULL, }, + { "DTR", 0, 1, 2, -1, NULL, }, + { "DTR", 0, 1, 2, -1, NULL, }, + { "DTR", 0, 1, 0, -1, NULL, }, + { "FR%, % in 0 - 1", 12, 1, 0, -1, NULL, }, + { "FR%, % in 2 - 127", 13, 1, 2, -1, NULL, }, + { "GR0", 14, 1, 0, -1, NULL, }, + { "GR%, % in 1 - 127", 15, 1, 2, -1, NULL, }, + { "IBR#", 16, 1, 2, -1, NULL, }, + { "InService*", 17, 1, 7, -1, "SC", }, + { "IP", 0, 1, 0, -1, NULL, }, + { "ITC", 0, 1, 0, -1, NULL, }, + { "ITC", 0, 1, 2, -1, NULL, }, + { "ITC", 0, 1, 2, -1, NULL, }, + { "ITR", 0, 1, 2, -1, NULL, }, + { "ITR", 0, 1, 2, -1, NULL, }, + { "ITR", 0, 1, 0, -1, NULL, }, + { "memory", 0, 1, 0, -1, NULL, }, + { "MSR#", 18, 1, 7, -1, "SC", }, + { "PKR#", 19, 1, 0, -1, NULL, }, + { "PKR#", 19, 1, 0, -1, NULL, }, + { "PKR#", 19, 1, 2, -1, NULL, }, + { "PMC#", 20, 1, 2, -1, NULL, }, + { "PMD#", 21, 1, 2, -1, NULL, }, + { "PR0", 0, 1, 0, -1, NULL, }, + { "PR%, % in 1 - 15", 22, 1, 0, -1, NULL, }, + { "PR%, % in 1 - 15", 22, 1, 0, -1, NULL, }, + { "PR%, % in 1 - 15", 22, 1, 2, -1, NULL, }, + { "PR%, % in 1 - 15", 22, 1, 2, -1, NULL, }, + { "PR%, % in 16 - 62", 23, 1, 0, -1, NULL, }, + { "PR%, % in 16 - 62", 23, 1, 0, -1, NULL, }, + { "PR%, % in 16 - 62", 23, 1, 2, -1, NULL, }, + { "PR%, % in 16 - 62", 23, 1, 2, -1, NULL, }, + { "PR63", 24, 1, 0, -1, NULL, }, + { "PR63", 24, 1, 0, -1, NULL, }, + { "PR63", 24, 1, 2, -1, NULL, }, + { "PR63", 24, 1, 2, -1, NULL, }, + { "PSR.ac", 28, 1, 2, 3, NULL, }, + { "PSR.be", 28, 1, 2, 1, NULL, }, + { "PSR.bn", 28, 1, 2, 44, NULL, }, + { "PSR.cpl", 28, 1, 2, 32, NULL, }, + { "PSR.da", 28, 1, 2, 38, NULL, }, + { "PSR.db", 28, 1, 2, 24, NULL, }, + { "PSR.dd", 28, 1, 2, 39, NULL, }, + { "PSR.dfh", 28, 1, 2, 19, NULL, }, + { "PSR.dfl", 28, 1, 2, 18, NULL, }, + { "PSR.di", 28, 1, 2, 22, NULL, }, + { "PSR.dt", 28, 1, 2, 17, NULL, }, + { "PSR.ed", 28, 1, 2, 43, NULL, }, + { "PSR.i", 28, 1, 2, 14, NULL, }, + { "PSR.ia", 28, 1, 2, 14, NULL, }, + { "PSR.ic", 28, 1, 2, 13, NULL, }, + { "PSR.id", 28, 1, 2, 14, NULL, }, + { "PSR.is", 28, 1, 2, 14, NULL, }, + { "PSR.it", 28, 1, 2, 14, NULL, }, + { "PSR.lp", 28, 1, 2, 25, NULL, }, + { "PSR.mc", 28, 1, 2, 35, NULL, }, + { "PSR.mfh", 28, 1, 0, 5, NULL, }, + { "PSR.mfh", 28, 1, 2, 5, NULL, }, + { "PSR.mfh", 28, 1, 2, 5, NULL, }, + { "PSR.mfl", 28, 1, 0, 4, NULL, }, + { "PSR.mfl", 28, 1, 2, 4, NULL, }, + { "PSR.mfl", 28, 1, 2, 4, NULL, }, + { "PSR.pk", 28, 1, 2, 15, NULL, }, + { "PSR.pp", 28, 1, 2, 21, NULL, }, + { "PSR.ri", 28, 1, 2, 41, NULL, }, + { "PSR.rt", 28, 1, 2, 27, NULL, }, + { "PSR.si", 28, 1, 2, 23, NULL, }, + { "PSR.sp", 28, 1, 2, 20, NULL, }, + { "PSR.ss", 28, 1, 2, 40, NULL, }, + { "PSR.tb", 28, 1, 2, 26, NULL, }, + { "PSR.up", 28, 1, 2, 2, NULL, }, + { "RR#", 25, 1, 2, -1, NULL, }, + { "RSE", 29, 1, 2, -1, NULL, }, + { "PR63", 24, 2, 6, -1, NULL, }, +}; + +static const short dep0[] = { + 88, 252, 2131, 2297, +}; + +static const short dep1[] = { + 32, 33, 88, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 2297, 4127, + 20605, +}; + +static const short dep2[] = { + 88, 252, 2157, 2158, 2160, 2161, 2163, 2164, 2166, 2314, 2317, 2318, 2321, + 2322, 2325, 2326, +}; + +static const short dep3[] = { + 32, 33, 88, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 2314, 2317, + 2318, 2321, 2322, 2325, 2326, 4127, 20605, +}; + +static const short dep4[] = { + 88, 252, 22637, 22638, 22640, 22641, 22643, 22644, 22646, 22794, 22797, 22798, + 22801, 22802, 22805, 22806, +}; + +static const short dep5[] = { + 32, 33, 88, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 4127, 20605, + 22794, 22797, 22798, 22801, 22802, 22805, 22806, +}; + +static const short dep6[] = { + 88, 252, 2157, 2158, 2160, 2161, 2163, 2164, 2166, 2314, 2315, 2317, 2319, + 2321, 2323, 2325, +}; + +static const short dep7[] = { + 32, 33, 88, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 2314, 2315, + 2318, 2319, 2322, 2323, 2326, 4127, 20605, +}; + +static const short dep8[] = { + 88, 252, 2157, 2158, 2160, 2161, 2163, 2164, 2166, 2314, 2316, 2318, 2320, + 2322, 2324, 2326, +}; + +static const short dep9[] = { + 32, 33, 88, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 2314, 2316, + 2317, 2320, 2321, 2324, 2325, 4127, 20605, +}; + +static const short dep10[] = { + 88, 252, 2157, 2158, 2160, 2161, 2163, 2164, 2166, 2314, 2315, 2316, 2317, + 2318, 2319, 2320, 2321, 2322, 2323, 2324, 2325, 2326, +}; + +static const short dep11[] = { + 32, 33, 88, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 2314, 2315, + 2316, 2317, 2318, 2319, 2320, 2321, 2322, 2323, 2324, 2325, 2326, 4127, 20605, + +}; + +static const short dep12[] = { + 88, 252, 2364, +}; + +static const short dep13[] = { + 32, 33, 88, 148, 166, 167, 252, 2074, 2075, 2157, 2159, 2160, 2162, 2163, + 2165, 2166, 4127, +}; + +static const short dep14[] = { + 88, 147, 252, 295, 2364, 28844, 28987, +}; + +static const short dep15[] = { + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, + 23, 24, 25, 32, 33, 88, 136, 148, 166, 167, 252, 295, 2074, 2075, 2157, 2159, + 2160, 2162, 2163, 2165, 2166, 4127, 28844, 28987, +}; + +static const short dep16[] = { + 1, 4, 32, 88, 126, 174, 177, 211, 252, 282, 2364, 28844, 28987, +}; + +static const short dep17[] = { + 1, 18, 20, 30, 32, 33, 88, 148, 150, 151, 166, 167, 174, 177, 211, 252, 282, + 2074, 2075, 2157, 2159, 2160, 2162, 2163, 2165, 2166, 4127, 28844, 28987, + +}; + +static const short dep18[] = { + 1, 32, 43, 88, 174, 211, 218, 252, 28844, 28987, +}; + +static const short dep19[] = { + 1, 30, 32, 33, 88, 145, 166, 174, 211, 218, 252, 4127, 28844, 28987, +}; + +static const short dep20[] = { + 32, 88, 211, 252, +}; + +static const short dep21[] = { + 88, 166, 211, 252, +}; + +static const short dep22[] = { + 1, 32, 88, 120, 121, 123, 124, 125, 126, 127, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 142, 143, 144, 145, 146, 147, 148, 151, 152, 153, + 154, 155, 156, 157, 158, 161, 162, 163, 164, 165, 166, 167, 168, 169, 174, + 211, 252, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 300, 301, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 28844, 28987, +}; + +static const short dep23[] = { + 1, 30, 32, 33, 42, 43, 47, 50, 64, 88, 126, 166, 174, 211, 252, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 300, 301, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 4127, 28844, 28987, +}; + +static const short dep24[] = { + 88, 125, 252, 281, +}; + +static const short dep25[] = { + 88, 126, 166, 252, 281, +}; + +static const short dep26[] = { + 88, 126, 252, 282, +}; + +static const short dep27[] = { + 18, 19, 88, 89, 92, 96, 99, 126, 148, 166, 252, 282, +}; + +static const short dep28[] = { + 32, 33, 88, 166, 252, 2157, 2159, 2160, 2162, 2163, 2165, 2166, 4127, +}; + +static const short dep29[] = { + 1, 18, 32, 88, 174, 199, 200, 211, 252, 2074, 2255, 2258, 2364, 28844, 28987, + +}; + +static const short dep30[] = { + 1, 4, 30, 32, 33, 88, 126, 148, 166, 167, 174, 199, 201, 211, 252, 2074, 2075, + 2157, 2159, 2160, 2162, 2163, 2165, 2166, 2256, 2258, 4127, 28844, 28987, + +}; + +static const short dep31[] = { + 88, 252, +}; + +static const short dep32[] = { + 88, 166, 252, 2074, 2076, +}; + +static const short dep33[] = { + 32, 33, 88, 148, 166, 167, 252, 2157, 2159, 2160, 2162, 2163, 2165, 2166, + 4127, +}; + +static const short dep34[] = { + 4, 29, 30, 31, 88, 116, 117, 177, 211, 252, 277, 278, 2364, +}; + +static const short dep35[] = { + 4, 29, 32, 33, 88, 148, 166, 167, 177, 211, 252, 277, 278, 316, 2157, 2159, + 2160, 2162, 2163, 2165, 2166, 4127, +}; + +static const short dep36[] = { + 17, 88, 198, 252, 2364, +}; + +static const short dep37[] = { + 17, 32, 33, 88, 148, 166, 167, 198, 252, 2157, 2159, 2160, 2162, 2163, 2165, + 2166, 4127, +}; + +static const short dep38[] = { + 4, 17, 29, 30, 31, 88, 116, 117, 177, 198, 211, 252, 277, 278, 2364, +}; + +static const short dep39[] = { + 4, 17, 29, 32, 33, 88, 148, 166, 167, 177, 198, 211, 252, 277, 278, 316, 2157, + 2159, 2160, 2162, 2163, 2165, 2166, 4127, +}; + +static const short dep40[] = { + 1, 4, 30, 32, 33, 88, 126, 148, 166, 167, 174, 199, 201, 211, 252, 2157, 2159, + 2160, 2162, 2163, 2165, 2166, 2256, 2258, 4127, 28844, 28987, +}; + +static const short dep41[] = { + 88, 166, 252, +}; + +static const short dep42[] = { + 9, 88, 182, 183, 252, 2127, 2295, 18585, 18586, 18731, 18732, 18734, 18735, + 22637, 22638, 22639, 22641, 22642, 22644, 22645, 22794, 22797, 22798, 22801, + 22802, 22805, 22806, +}; + +static const short dep43[] = { + 5, 13, 14, 32, 33, 88, 166, 182, 184, 252, 2126, 2127, 2128, 2157, 2158, 2161, + 2164, 2295, 4127, 16516, 16518, 18731, 18733, 18734, 18736, 22794, 22797, + 22798, 22801, 22802, 22805, 22806, +}; + +static const short dep44[] = { + 9, 10, 11, 12, 88, 182, 183, 185, 186, 188, 189, 191, 192, 252, 2127, 2295, + 18585, 18586, 18731, 18732, 18734, 18735, 22637, 22638, 22639, 22641, 22642, + 22644, 22645, 22794, 22797, 22798, 22801, 22802, 22805, 22806, +}; + +static const short dep45[] = { + 5, 6, 7, 8, 13, 14, 32, 33, 88, 166, 182, 184, 185, 187, 188, 190, 191, 193, + 252, 2126, 2127, 2128, 2157, 2158, 2161, 2164, 2295, 4127, 16516, 16518, 18731, + 18733, 18734, 18736, 22794, 22797, 22798, 22801, 22802, 22805, 22806, +}; + +static const short dep46[] = { + 10, 88, 185, 186, 252, 2127, 2295, 18585, 18586, 18731, 18732, 18734, 18735, + 22637, 22638, 22639, 22641, 22642, 22644, 22645, 22794, 22797, 22798, 22801, + 22802, 22805, 22806, +}; + +static const short dep47[] = { + 6, 13, 14, 32, 33, 88, 166, 185, 187, 252, 2126, 2127, 2128, 2157, 2158, 2161, + 2164, 2295, 4127, 16516, 16518, 18731, 18733, 18734, 18736, 22794, 22797, + 22798, 22801, 22802, 22805, 22806, +}; + +static const short dep48[] = { + 11, 88, 188, 189, 252, 2127, 2295, 18585, 18586, 18731, 18732, 18734, 18735, + 22637, 22638, 22639, 22641, 22642, 22644, 22645, 22794, 22797, 22798, 22801, + 22802, 22805, 22806, +}; + +static const short dep49[] = { + 7, 13, 14, 32, 33, 88, 166, 188, 190, 252, 2126, 2127, 2128, 2157, 2158, 2161, + 2164, 2295, 4127, 16516, 16518, 18731, 18733, 18734, 18736, 22794, 22797, + 22798, 22801, 22802, 22805, 22806, +}; + +static const short dep50[] = { + 12, 88, 191, 192, 252, 2127, 2295, 18585, 18586, 18731, 18732, 18734, 18735, + 22637, 22638, 22639, 22641, 22642, 22644, 22645, 22794, 22797, 22798, 22801, + 22802, 22805, 22806, +}; + +static const short dep51[] = { + 8, 13, 14, 32, 33, 88, 166, 191, 193, 252, 2126, 2127, 2128, 2157, 2158, 2161, + 2164, 2295, 4127, 16516, 16518, 18731, 18733, 18734, 18736, 22794, 22797, + 22798, 22801, 22802, 22805, 22806, +}; + +static const short dep52[] = { + 9, 88, 182, 183, 252, 2127, 2295, 18585, 18586, 18731, 18732, 18734, 18735, + +}; + +static const short dep53[] = { + 5, 13, 14, 32, 33, 88, 166, 182, 184, 252, 2126, 2127, 2128, 2157, 2158, 2161, + 2164, 2295, 4127, 16516, 16518, 18731, 18733, 18734, 18736, +}; + +static const short dep54[] = { + 9, 10, 11, 12, 88, 182, 183, 185, 186, 188, 189, 191, 192, 252, 2127, 2295, + 18585, 18586, 18731, 18732, 18734, 18735, +}; + +static const short dep55[] = { + 5, 6, 7, 8, 13, 14, 32, 33, 88, 166, 182, 184, 185, 187, 188, 190, 191, 193, + 252, 2126, 2127, 2128, 2157, 2158, 2161, 2164, 2295, 4127, 16516, 16518, 18731, + 18733, 18734, 18736, +}; + +static const short dep56[] = { + 10, 88, 185, 186, 252, 2127, 2295, 18585, 18586, 18731, 18732, 18734, 18735, + +}; + +static const short dep57[] = { + 6, 13, 14, 32, 33, 88, 166, 185, 187, 252, 2126, 2127, 2128, 2157, 2158, 2161, + 2164, 2295, 4127, 16516, 16518, 18731, 18733, 18734, 18736, +}; + +static const short dep58[] = { + 11, 88, 188, 189, 252, 2127, 2295, 18585, 18586, 18731, 18732, 18734, 18735, + +}; + +static const short dep59[] = { + 7, 13, 14, 32, 33, 88, 166, 188, 190, 252, 2126, 2127, 2128, 2157, 2158, 2161, + 2164, 2295, 4127, 16516, 16518, 18731, 18733, 18734, 18736, +}; + +static const short dep60[] = { + 12, 88, 191, 192, 252, 2127, 2295, 18585, 18586, 18731, 18732, 18734, 18735, + +}; + +static const short dep61[] = { + 8, 13, 14, 32, 33, 88, 166, 191, 193, 252, 2126, 2127, 2128, 2157, 2158, 2161, + 2164, 2295, 4127, 16516, 16518, 18731, 18733, 18734, 18736, +}; + +static const short dep62[] = { + 88, 252, 2127, 2295, 18585, 18586, 18731, 18732, 18734, 18735, +}; + +static const short dep63[] = { + 32, 33, 88, 166, 252, 2126, 2127, 2128, 2157, 2158, 2161, 2164, 2295, 4127, + 16516, 16518, 18731, 18733, 18734, 18736, +}; + +static const short dep64[] = { + 5, 88, 178, 252, +}; + +static const short dep65[] = { + 5, 32, 33, 88, 166, 178, 252, 2157, 2158, 2161, 2164, 4127, +}; + +static const short dep66[] = { + 5, 32, 33, 88, 166, 252, 2157, 2158, 2161, 2164, 4127, +}; + +static const short dep67[] = { + 6, 88, 179, 252, +}; + +static const short dep68[] = { + 5, 32, 33, 88, 166, 179, 252, 2157, 2158, 2161, 2164, 4127, +}; + +static const short dep69[] = { + 7, 88, 180, 252, +}; + +static const short dep70[] = { + 5, 32, 33, 88, 166, 180, 252, 2157, 2158, 2161, 2164, 4127, +}; + +static const short dep71[] = { + 8, 88, 181, 252, +}; + +static const short dep72[] = { + 5, 32, 33, 88, 166, 181, 252, 2157, 2158, 2161, 2164, 4127, +}; + +static const short dep73[] = { + 9, 88, 183, 184, 252, +}; + +static const short dep74[] = { + 32, 33, 88, 166, 183, 184, 252, 2157, 2158, 2161, 2164, 4127, +}; + +static const short dep75[] = { + 32, 33, 88, 166, 252, 2157, 2158, 2161, 2164, 4127, +}; + +static const short dep76[] = { + 10, 88, 186, 187, 252, +}; + +static const short dep77[] = { + 32, 33, 88, 166, 186, 187, 252, 2157, 2158, 2161, 2164, 4127, +}; + +static const short dep78[] = { + 11, 88, 189, 190, 252, +}; + +static const short dep79[] = { + 32, 33, 88, 166, 189, 190, 252, 2157, 2158, 2161, 2164, 4127, +}; + +static const short dep80[] = { + 12, 88, 192, 193, 252, +}; + +static const short dep81[] = { + 32, 33, 88, 166, 192, 193, 252, 2157, 2158, 2161, 2164, 4127, +}; + +static const short dep82[] = { + 9, 13, 14, 32, 33, 88, 148, 166, 167, 252, 2157, 2158, 2161, 2164, 4127, +}; + +static const short dep83[] = { + 9, 10, 13, 14, 32, 33, 88, 148, 166, 167, 252, 2157, 2158, 2161, 2164, 4127, + +}; + +static const short dep84[] = { + 9, 11, 13, 14, 32, 33, 88, 148, 166, 167, 252, 2157, 2158, 2161, 2164, 4127, + +}; + +static const short dep85[] = { + 9, 12, 13, 14, 32, 33, 88, 148, 166, 167, 252, 2157, 2158, 2161, 2164, 4127, + +}; + +static const short dep86[] = { + 9, 88, 182, 183, 252, +}; + +static const short dep87[] = { + 5, 13, 14, 32, 33, 88, 166, 182, 184, 252, 2157, 2158, 2161, 2164, 4127, +}; + +static const short dep88[] = { + 9, 10, 11, 12, 88, 182, 183, 185, 186, 188, 189, 191, 192, 252, +}; + +static const short dep89[] = { + 5, 6, 7, 8, 13, 14, 32, 33, 88, 166, 182, 184, 185, 187, 188, 190, 191, 193, + 252, 2157, 2158, 2161, 2164, 4127, +}; + +static const short dep90[] = { + 10, 88, 185, 186, 252, +}; + +static const short dep91[] = { + 6, 13, 14, 32, 33, 88, 166, 185, 187, 252, 2157, 2158, 2161, 2164, 4127, +}; + +static const short dep92[] = { + 11, 88, 188, 189, 252, +}; + +static const short dep93[] = { + 7, 13, 14, 32, 33, 88, 166, 188, 190, 252, 2157, 2158, 2161, 2164, 4127, +}; + +static const short dep94[] = { + 12, 88, 191, 192, 252, +}; + +static const short dep95[] = { + 8, 13, 14, 32, 33, 88, 166, 191, 193, 252, 2157, 2158, 2161, 2164, 4127, +}; + +static const short dep96[] = { + 9, 88, 182, 183, 252, 2157, 2158, 2159, 2161, 2162, 2164, 2165, 2314, 2317, + 2318, 2321, 2322, 2325, 2326, +}; + +static const short dep97[] = { + 5, 13, 14, 32, 33, 88, 166, 182, 184, 252, 2126, 2127, 2128, 2157, 2158, 2161, + 2164, 2314, 2317, 2318, 2321, 2322, 2325, 2326, 4127, 16516, 16518, +}; + +static const short dep98[] = { + 9, 10, 11, 12, 88, 182, 183, 185, 186, 188, 189, 191, 192, 252, 2157, 2158, + 2159, 2161, 2162, 2164, 2165, 2314, 2317, 2318, 2321, 2322, 2325, 2326, +}; + +static const short dep99[] = { + 5, 6, 7, 8, 13, 14, 32, 33, 88, 166, 182, 184, 185, 187, 188, 190, 191, 193, + 252, 2126, 2127, 2128, 2157, 2158, 2161, 2164, 2314, 2317, 2318, 2321, 2322, + 2325, 2326, 4127, 16516, 16518, +}; + +static const short dep100[] = { + 10, 88, 185, 186, 252, 2157, 2158, 2159, 2161, 2162, 2164, 2165, 2314, 2317, + 2318, 2321, 2322, 2325, 2326, +}; + +static const short dep101[] = { + 6, 13, 14, 32, 33, 88, 166, 185, 187, 252, 2126, 2127, 2128, 2157, 2158, 2161, + 2164, 2314, 2317, 2318, 2321, 2322, 2325, 2326, 4127, 16516, 16518, +}; + +static const short dep102[] = { + 11, 88, 188, 189, 252, 2157, 2158, 2159, 2161, 2162, 2164, 2165, 2314, 2317, + 2318, 2321, 2322, 2325, 2326, +}; + +static const short dep103[] = { + 7, 13, 14, 32, 33, 88, 166, 188, 190, 252, 2126, 2127, 2128, 2157, 2158, 2161, + 2164, 2314, 2317, 2318, 2321, 2322, 2325, 2326, 4127, 16516, 16518, +}; + +static const short dep104[] = { + 12, 88, 191, 192, 252, 2157, 2158, 2159, 2161, 2162, 2164, 2165, 2314, 2317, + 2318, 2321, 2322, 2325, 2326, +}; + +static const short dep105[] = { + 8, 13, 14, 32, 33, 88, 166, 191, 193, 252, 2126, 2127, 2128, 2157, 2158, 2161, + 2164, 2314, 2317, 2318, 2321, 2322, 2325, 2326, 4127, 16516, 16518, +}; + +static const short dep106[] = { + 9, 88, 182, 183, 252, 22637, 22638, 22639, 22641, 22642, 22644, 22645, 22794, + 22797, 22798, 22801, 22802, 22805, 22806, +}; + +static const short dep107[] = { + 5, 13, 14, 32, 33, 88, 166, 182, 184, 252, 2126, 2127, 2128, 2157, 2158, 2161, + 2164, 4127, 16516, 16518, 22794, 22797, 22798, 22801, 22802, 22805, 22806, + +}; + +static const short dep108[] = { + 9, 10, 11, 12, 88, 182, 183, 185, 186, 188, 189, 191, 192, 252, 22637, 22638, + 22639, 22641, 22642, 22644, 22645, 22794, 22797, 22798, 22801, 22802, 22805, + 22806, +}; + +static const short dep109[] = { + 5, 6, 7, 8, 13, 14, 32, 33, 88, 166, 182, 184, 185, 187, 188, 190, 191, 193, + 252, 2126, 2127, 2128, 2157, 2158, 2161, 2164, 4127, 16516, 16518, 22794, + 22797, 22798, 22801, 22802, 22805, 22806, +}; + +static const short dep110[] = { + 10, 88, 185, 186, 252, 22637, 22638, 22639, 22641, 22642, 22644, 22645, 22794, + 22797, 22798, 22801, 22802, 22805, 22806, +}; + +static const short dep111[] = { + 6, 13, 14, 32, 33, 88, 166, 185, 187, 252, 2126, 2127, 2128, 2157, 2158, 2161, + 2164, 4127, 16516, 16518, 22794, 22797, 22798, 22801, 22802, 22805, 22806, + +}; + +static const short dep112[] = { + 11, 88, 188, 189, 252, 22637, 22638, 22639, 22641, 22642, 22644, 22645, 22794, + 22797, 22798, 22801, 22802, 22805, 22806, +}; + +static const short dep113[] = { + 7, 13, 14, 32, 33, 88, 166, 188, 190, 252, 2126, 2127, 2128, 2157, 2158, 2161, + 2164, 4127, 16516, 16518, 22794, 22797, 22798, 22801, 22802, 22805, 22806, + +}; + +static const short dep114[] = { + 12, 88, 191, 192, 252, 22637, 22638, 22639, 22641, 22642, 22644, 22645, 22794, + 22797, 22798, 22801, 22802, 22805, 22806, +}; + +static const short dep115[] = { + 8, 13, 14, 32, 33, 88, 166, 191, 193, 252, 2126, 2127, 2128, 2157, 2158, 2161, + 2164, 4127, 16516, 16518, 22794, 22797, 22798, 22801, 22802, 22805, 22806, + +}; + +static const short dep116[] = { + 88, 252, 2157, 2158, 2159, 2161, 2162, 2164, 2165, 2314, 2317, 2318, 2321, + 2322, 2325, 2326, +}; + +static const short dep117[] = { + 32, 33, 88, 166, 252, 2126, 2127, 2128, 2157, 2158, 2161, 2164, 2314, 2317, + 2318, 2321, 2322, 2325, 2326, 4127, 16516, 16518, +}; + +static const short dep118[] = { + 88, 252, 22637, 22638, 22639, 22641, 22642, 22644, 22645, 22794, 22797, 22798, + 22801, 22802, 22805, 22806, +}; + +static const short dep119[] = { + 32, 33, 88, 166, 252, 2126, 2127, 2128, 2157, 2158, 2161, 2164, 4127, 16516, + 16518, 22794, 22797, 22798, 22801, 22802, 22805, 22806, +}; + +static const short dep120[] = { + 13, 14, 32, 33, 88, 166, 252, 2126, 2127, 2128, 2157, 2158, 2161, 2164, 2295, + 4127, 16516, 16518, 18731, 18733, 18734, 18736, +}; + +static const short dep121[] = { + 32, 33, 88, 148, 166, 167, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, + 4127, 20605, +}; + +static const short dep122[] = { + 88, 252, 2075, 2076, 2256, 2257, +}; + +static const short dep123[] = { + 32, 33, 88, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 2255, 2257, + 4127, 20605, +}; + +static const short dep124[] = { + 32, 33, 88, 166, 252, 2074, 2076, 2157, 2158, 2161, 2164, 2297, 4127, 20605, + +}; + +static const short dep125[] = { + 88, 252, 14446, 14448, 14449, 14451, 14452, 14454, 14605, 14606, 14609, 14610, + 14613, 14614, +}; + +static const short dep126[] = { + 32, 33, 88, 166, 252, 2129, 2130, 2131, 4127, 14605, 14606, 14609, 14610, + 14613, 14614, 20605, 24685, 24686, 24689, 24692, +}; + +static const short dep127[] = { + 88, 113, 115, 116, 118, 252, 273, 274, 277, 278, +}; + +static const short dep128[] = { + 32, 33, 88, 166, 252, 273, 274, 277, 278, 4127, 24685, 24686, 24689, 24692, + +}; + +static const short dep129[] = { + 32, 33, 88, 166, 252, 2157, 2158, 2161, 2164, 2297, 4127, 20605, +}; + +static const short dep130[] = { + 32, 33, 88, 110, 113, 116, 166, 252, 2297, 4127, 20605, 24685, +}; + +static const short dep131[] = { + 4, 17, 19, 20, 88, 177, 198, 201, 252, 2073, 2254, +}; + +static const short dep132[] = { + 32, 33, 88, 166, 177, 198, 200, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, + 2254, 4127, 20605, +}; + +static const short dep133[] = { + 4, 17, 18, 19, 32, 33, 88, 166, 252, 2073, 2157, 2158, 2161, 2164, 2297, 4127, + 20605, +}; + +static const short dep134[] = { + 0, 32, 33, 88, 148, 166, 167, 252, 2157, 2158, 2161, 2164, 4127, +}; + +static const short dep135[] = { + 0, 88, 173, 252, +}; + +static const short dep136[] = { + 0, 32, 33, 88, 148, 166, 167, 173, 252, 2157, 2158, 2161, 2164, 4127, +}; + +static const short dep137[] = { + 32, 33, 88, 166, 173, 252, 2157, 2158, 2161, 2164, 4127, +}; + +static const short dep138[] = { + 2, 21, 88, 175, 202, 252, 28844, 28987, +}; + +static const short dep139[] = { + 1, 2, 21, 22, 88, 160, 161, 166, 175, 202, 252, 28844, 28987, +}; + +static const short dep140[] = { + 1, 21, 22, 30, 32, 33, 88, 160, 161, 166, 175, 202, 252, 4127, 28844, 28987, + +}; + +static const short dep141[] = { + 0, 32, 33, 88, 166, 173, 252, 2157, 2158, 2161, 2164, 4127, +}; + +static const short dep142[] = { + 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 21, 22, 23, 88, 174, 175, + 176, 178, 179, 180, 181, 183, 184, 186, 187, 189, 190, 192, 193, 194, 195, + 196, 202, 203, 204, 252, 2064, 2073, 2245, 2254, 28844, 28987, +}; + +static const short dep143[] = { + 22, 32, 33, 88, 126, 166, 174, 175, 176, 178, 179, 180, 181, 183, 184, 186, + 187, 189, 190, 192, 193, 194, 195, 196, 202, 203, 204, 252, 2129, 2130, 2131, + 2157, 2158, 2161, 2164, 2245, 2254, 4127, 20605, 28844, 28987, +}; + +static const short dep144[] = { + 88, 252, 14455, 14457, 14458, 14460, 14489, 14490, 14505, 14615, 14616, 14636, + 14637, 14639, 14640, 14649, +}; + +static const short dep145[] = { + 32, 33, 88, 165, 166, 252, 2157, 2158, 2161, 2164, 4127, 14615, 14616, 14636, + 14637, 14639, 14640, 14649, +}; + +static const short dep146[] = { + 14455, 14457, 14458, 14460, 14489, 14490, 14505, 14615, 14616, 14636, 14637, + 14639, 14640, 14649, +}; + +static const short dep147[] = { + 165, 14615, 14616, 14636, 14637, 14639, 14640, 14649, +}; + +static const short dep148[] = { + 88, 252, 14456, 14457, 14459, 14460, 14468, 14469, 14470, 14471, 14472, 14473, + 14474, 14475, 14477, 14480, 14481, 14489, 14490, 14491, 14492, 14493, 14498, + 14499, 14500, 14501, 14505, 14615, 14616, 14622, 14623, 14624, 14625, 14627, + 14629, 14636, 14637, 14639, 14640, 14641, 14642, 14645, 14646, 14649, +}; + +static const short dep149[] = { + 32, 33, 64, 88, 126, 166, 252, 2157, 2158, 2161, 2164, 4127, 14615, 14616, + 14622, 14623, 14624, 14625, 14627, 14629, 14636, 14637, 14639, 14640, 14641, + 14642, 14645, 14646, 14649, +}; + +static const short dep150[] = { + 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 21, 22, 23, 32, 33, 88, 126, + 163, 166, 252, 2064, 2073, 2157, 2158, 2161, 2164, 2297, 4127, 20605, 28844, + +}; + +static const short dep151[] = { + 35, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 52, 53, 54, 55, + 56, 57, 59, 61, 62, 63, 64, 85, 87, 88, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 225, 226, 227, 228, 229, 231, 233, 234, 235, 251, 252, + 2108, 2280, +}; + +static const short dep152[] = { + 32, 33, 87, 88, 126, 145, 166, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 225, 226, 227, 228, 229, 231, 233, 234, 235, 251, 252, 2129, 2130, + 2131, 2157, 2158, 2161, 2164, 2280, 4127, 20605, +}; + +static const short dep153[] = { + 51, 86, 88, 224, 251, 252, 2131, 2297, +}; + +static const short dep154[] = { + 32, 33, 35, 36, 38, 40, 41, 43, 44, 45, 46, 48, 49, 52, 53, 55, 56, 57, 58, + 59, 61, 62, 63, 85, 86, 88, 126, 145, 166, 224, 251, 252, 2099, 2108, 2157, + 2158, 2161, 2164, 2297, 4127, 20605, +}; + +static const short dep155[] = { + 2, 21, 33, 88, 175, 202, 211, 252, 2131, 2297, 28844, 28987, +}; + +static const short dep156[] = { + 2, 18, 19, 21, 22, 30, 32, 33, 88, 160, 161, 166, 175, 202, 211, 252, 2297, + 4127, 20605, 28844, 28987, +}; + +static const short dep157[] = { + 88, 120, 121, 123, 124, 128, 129, 132, 133, 134, 135, 136, 137, 138, 139, + 141, 144, 145, 149, 150, 153, 154, 155, 156, 157, 159, 160, 162, 163, 164, + 165, 167, 168, 169, 252, 279, 280, 284, 286, 287, 288, 289, 291, 293, 297, + 300, 301, 303, 304, 305, 306, 308, 309, 310, 312, 313, +}; + +static const short dep158[] = { + 32, 33, 64, 88, 126, 166, 252, 279, 280, 284, 286, 287, 288, 289, 291, 293, + 297, 300, 301, 303, 304, 305, 306, 308, 309, 310, 312, 313, 2129, 2130, 2131, + 2157, 2158, 2161, 2164, 4127, 20605, +}; + +static const short dep159[] = { + 88, 119, 121, 122, 124, 153, 154, 169, 252, 279, 280, 300, 301, 303, 304, + 313, +}; + +static const short dep160[] = { + 32, 33, 88, 165, 166, 252, 279, 280, 300, 301, 303, 304, 313, 2129, 2130, + 2131, 2157, 2158, 2161, 2164, 4127, 20605, +}; + +static const short dep161[] = { + 32, 33, 88, 121, 124, 126, 129, 130, 133, 135, 137, 139, 141, 142, 144, 148, + 149, 151, 152, 153, 154, 156, 157, 159, 161, 162, 164, 166, 168, 169, 252, + 2157, 2158, 2161, 2164, 2297, 4127, 20605, +}; + +static const short dep162[] = { + 32, 33, 88, 121, 124, 153, 154, 166, 169, 252, 2157, 2158, 2161, 2164, 2297, + 4127, 20605, +}; + +static const short dep163[] = { + 32, 33, 67, 68, 73, 75, 88, 102, 126, 155, 166, 170, 252, 2129, 2130, 2131, + 2157, 2158, 2161, 2164, 2297, 4127, 20605, +}; + +static const short dep164[] = { + 32, 33, 67, 68, 73, 75, 88, 102, 126, 127, 128, 130, 131, 155, 166, 170, 252, + 2129, 2130, 2131, 2157, 2158, 2161, 2164, 4127, 20605, +}; + +static const short dep165[] = { + 68, 69, 88, 92, 93, 239, 240, 252, 254, 255, +}; + +static const short dep166[] = { + 32, 33, 39, 54, 69, 71, 77, 88, 90, 93, 126, 145, 166, 170, 239, 240, 252, + 254, 255, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 4127, 20605, +}; + +static const short dep167[] = { + 32, 33, 39, 54, 69, 71, 88, 90, 93, 95, 97, 126, 145, 166, 170, 239, 240, + 252, 254, 255, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 4127, 20605, +}; + +static const short dep168[] = { + 88, 252, 12458, 12459, 12602, +}; + +static const short dep169[] = { + 32, 33, 88, 126, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 4127, + 12602, 20605, +}; + +static const short dep170[] = { + 88, 252, 6210, 6211, 6381, +}; + +static const short dep171[] = { + 32, 33, 88, 126, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 4127, + 6381, 20605, +}; + +static const short dep172[] = { + 88, 252, 6228, 6394, +}; + +static const short dep173[] = { + 32, 33, 88, 126, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 4127, + 6394, 20605, +}; + +static const short dep174[] = { + 88, 252, 6246, 6247, 6248, 6249, 6405, 6407, 8454, +}; + +static const short dep175[] = { + 32, 33, 88, 126, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 4127, + 6249, 6406, 6407, 8295, 8453, 20605, +}; + +static const short dep176[] = { + 88, 252, 6250, 6251, 6408, +}; + +static const short dep177[] = { + 32, 33, 88, 126, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 4127, + 6408, 20605, +}; + +static const short dep178[] = { + 88, 252, 6252, 6409, +}; + +static const short dep179[] = { + 32, 33, 88, 126, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 4127, + 6409, 20605, +}; + +static const short dep180[] = { + 88, 252, 10341, 10500, +}; + +static const short dep181[] = { + 32, 33, 88, 126, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 4127, + 10500, 20605, +}; + +static const short dep182[] = { + 68, 69, 73, 74, 88, 92, 93, 239, 240, 242, 243, 252, 254, 255, +}; + +static const short dep183[] = { + 32, 33, 39, 54, 69, 71, 74, 77, 88, 90, 93, 126, 145, 166, 170, 239, 240, + 242, 244, 252, 254, 255, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 4127, 20605, + +}; + +static const short dep184[] = { + 68, 69, 88, 92, 93, 95, 96, 239, 240, 252, 254, 255, 256, 257, +}; + +static const short dep185[] = { + 32, 33, 39, 54, 69, 71, 88, 90, 93, 95, 97, 126, 145, 166, 170, 239, 240, + 252, 254, 255, 256, 257, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 4127, 20605, + +}; + +static const short dep186[] = { + 32, 33, 88, 126, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 2297, + 4127, 12459, 20605, +}; + +static const short dep187[] = { + 32, 33, 88, 126, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 2297, + 4127, 6210, 20605, +}; + +static const short dep188[] = { + 32, 33, 88, 126, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 2297, + 4127, 6228, 20605, +}; + +static const short dep189[] = { + 32, 33, 88, 126, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 2297, + 4127, 6248, 8294, 20605, +}; + +static const short dep190[] = { + 32, 33, 88, 126, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 2297, + 4127, 6250, 20605, +}; + +static const short dep191[] = { + 32, 33, 88, 126, 165, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, + 2297, 4127, 6251, 6252, 20605, +}; + +static const short dep192[] = { + 32, 33, 88, 126, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 2297, + 4127, 10341, 20605, +}; + +static const short dep193[] = { + 32, 33, 88, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 2297, 4127, + 6178, 20605, +}; + +static const short dep194[] = { + 68, 70, 71, 88, 89, 90, 91, 238, 239, 252, 253, 254, +}; + +static const short dep195[] = { + 32, 33, 69, 70, 74, 76, 88, 91, 93, 95, 98, 126, 166, 170, 238, 240, 252, + 253, 255, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 4127, 20605, +}; + +static const short dep196[] = { + 68, 70, 71, 72, 88, 89, 90, 91, 94, 238, 239, 241, 252, 253, 254, +}; + +static const short dep197[] = { + 32, 33, 69, 70, 72, 74, 76, 88, 91, 93, 94, 95, 98, 126, 166, 170, 238, 240, + 241, 252, 253, 255, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 4127, 20605, + +}; + +static const short dep198[] = { + 68, 70, 71, 75, 76, 77, 88, 89, 90, 91, 238, 239, 244, 245, 252, 253, 254, + +}; + +static const short dep199[] = { + 32, 33, 69, 70, 74, 76, 88, 91, 93, 126, 166, 170, 238, 240, 243, 245, 252, + 253, 255, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 4127, 20605, +}; + +static const short dep200[] = { + 68, 70, 71, 88, 89, 90, 91, 97, 98, 99, 238, 239, 252, 253, 254, 257, 258, + +}; + +static const short dep201[] = { + 32, 33, 69, 70, 88, 91, 93, 95, 98, 126, 166, 170, 238, 240, 252, 253, 255, + 256, 258, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 4127, 20605, +}; + +static const short dep202[] = { + 32, 33, 38, 62, 88, 166, 170, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, + 2297, 4127, 20605, +}; + +static const short dep203[] = { + 32, 33, 88, 166, 170, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 2297, + 4127, 20605, +}; + +static const short dep204[] = { + 32, 33, 68, 73, 75, 88, 126, 166, 170, 252, 2129, 2130, 2131, 2157, 2158, + 2161, 2164, 2297, 4127, 20605, +}; + +static const short dep205[] = { + 32, 33, 88, 148, 166, 167, 252, 2126, 2127, 2128, 2129, 2130, 2131, 2157, + 2158, 2161, 2164, 4127, 16516, 16518, 20605, +}; + +static const short dep206[] = { + 32, 33, 68, 73, 75, 88, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, + 4127, 20605, +}; + +static const short dep207[] = { + 32, 33, 69, 70, 88, 91, 126, 166, 238, 240, 252, 253, 255, 2129, 2130, 2131, + 2157, 2158, 2161, 2164, 4127, 20605, +}; + +static const short dep208[] = { + 32, 33, 67, 68, 73, 75, 88, 100, 102, 119, 120, 122, 123, 126, 127, 128, 130, + 131, 138, 155, 166, 170, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 2297, + 4127, 20605, +}; + +static const short dep209[] = { + 32, 33, 36, 67, 68, 73, 75, 88, 100, 102, 119, 120, 122, 123, 126, 127, 128, + 130, 131, 138, 140, 155, 166, 170, 252, 2129, 2130, 2131, 2157, 2158, 2161, + 2164, 2297, 4127, 20605, +}; + +static const short dep210[] = { + 0, 88, 173, 252, 2131, 2297, +}; + +static const short dep211[] = { + 0, 32, 33, 67, 68, 73, 75, 88, 100, 102, 119, 120, 122, 123, 126, 127, 128, + 130, 131, 138, 155, 166, 170, 173, 252, 2129, 2130, 2131, 2157, 2158, 2161, + 2164, 2297, 4127, 20605, +}; + +static const short dep212[] = { + 0, 32, 33, 36, 67, 68, 73, 75, 88, 100, 102, 119, 120, 122, 123, 126, 127, + 128, 130, 131, 138, 140, 155, 166, 170, 173, 252, 2129, 2130, 2131, 2157, + 2158, 2161, 2164, 2297, 4127, 20605, +}; + +static const short dep213[] = { + 23, 32, 33, 67, 68, 73, 75, 88, 100, 102, 119, 120, 122, 123, 126, 127, 128, + 130, 131, 138, 155, 166, 170, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, + 2297, 4127, 20605, +}; + +static const short dep214[] = { + 0, 88, 173, 252, 2297, 26706, +}; + +static const short dep215[] = { + 0, 88, 100, 173, 252, 259, +}; + +static const short dep216[] = { + 0, 32, 33, 67, 68, 73, 75, 88, 102, 119, 120, 122, 123, 126, 127, 128, 130, + 131, 138, 155, 166, 170, 173, 252, 259, 2129, 2130, 2131, 2157, 2158, 2161, + 2164, 4127, 20605, +}; + +static const short dep217[] = { + 0, 23, 88, 100, 173, 204, 252, 259, +}; + +static const short dep218[] = { + 0, 32, 33, 67, 68, 73, 75, 88, 102, 119, 120, 122, 123, 126, 127, 128, 130, + 131, 138, 155, 166, 170, 173, 204, 252, 259, 2129, 2130, 2131, 2157, 2158, + 2161, 2164, 4127, 20605, +}; + +static const short dep219[] = { + 0, 88, 100, 173, 252, 259, 2131, 2297, +}; + +static const short dep220[] = { + 0, 3, 32, 33, 67, 68, 73, 75, 88, 100, 102, 119, 120, 122, 123, 126, 127, + 128, 130, 131, 138, 155, 166, 170, 173, 252, 259, 2129, 2130, 2131, 2157, + 2158, 2161, 2164, 2297, 4127, 20605, +}; + +static const short dep221[] = { + 0, 32, 33, 67, 68, 73, 75, 88, 100, 102, 119, 120, 122, 123, 126, 127, 128, + 130, 131, 138, 155, 166, 170, 173, 252, 259, 2129, 2130, 2131, 2157, 2158, + 2161, 2164, 2297, 4127, 20605, +}; + +static const short dep222[] = { + 32, 33, 88, 166, 252, 2126, 2127, 2128, 2157, 2158, 2161, 2164, 2297, 4127, + 16516, 16518, 20605, +}; + +static const short dep223[] = { + 0, 32, 33, 67, 68, 73, 75, 88, 102, 119, 120, 122, 123, 126, 127, 128, 130, + 131, 138, 155, 166, 170, 173, 252, 259, 2129, 2130, 2131, 2157, 2158, 2161, + 2164, 2297, 4127, 20605, +}; + +static const short dep224[] = { + 0, 23, 88, 100, 173, 204, 252, 259, 2131, 2297, +}; + +static const short dep225[] = { + 0, 32, 33, 67, 68, 73, 75, 88, 102, 119, 120, 122, 123, 126, 127, 128, 130, + 131, 138, 155, 166, 170, 173, 204, 252, 259, 2129, 2130, 2131, 2157, 2158, + 2161, 2164, 2297, 4127, 20605, +}; + +static const short dep226[] = { + 32, 33, 67, 68, 73, 75, 88, 100, 102, 119, 120, 122, 123, 126, 127, 128, 130, + 131, 138, 155, 166, 170, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 2295, + 4127, 16516, 16518, 18731, 18733, 18734, 18736, 20605, +}; + +static const short dep227[] = { + 32, 33, 36, 67, 68, 73, 75, 88, 100, 102, 119, 120, 122, 123, 126, 127, 128, + 130, 131, 138, 140, 155, 166, 170, 252, 2129, 2130, 2131, 2157, 2158, 2161, + 2164, 2295, 4127, 16516, 16518, 18731, 18733, 18734, 18736, 20605, +}; + +static const short dep228[] = { + 0, 88, 173, 252, 2127, 2295, 18585, 18586, 18731, 18732, 18734, 18735, +}; + +static const short dep229[] = { + 0, 32, 33, 67, 68, 73, 75, 88, 100, 102, 119, 120, 122, 123, 126, 127, 128, + 130, 131, 138, 155, 166, 170, 173, 252, 2129, 2130, 2131, 2157, 2158, 2161, + 2164, 2295, 4127, 16516, 16518, 18731, 18733, 18734, 18736, 20605, +}; + +static const short dep230[] = { + 0, 32, 33, 36, 67, 68, 73, 75, 88, 100, 102, 119, 120, 122, 123, 126, 127, + 128, 130, 131, 138, 140, 155, 166, 170, 173, 252, 2129, 2130, 2131, 2157, + 2158, 2161, 2164, 2295, 4127, 16516, 16518, 18731, 18733, 18734, 18736, 20605, + +}; + +static const short dep231[] = { + 0, 88, 173, 252, 2128, 2295, 18585, 18586, 18731, 18732, 18734, 18735, +}; + +static const short dep232[] = { + 32, 33, 67, 88, 126, 140, 166, 252, 2157, 2158, 2161, 2164, 4127, +}; + +static const short dep233[] = { + 32, 33, 67, 88, 126, 127, 131, 140, 166, 252, 2157, 2158, 2161, 2164, 4127, + +}; + +static const short dep234[] = { + 32, 33, 67, 88, 126, 140, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, + 2297, 4127, 20605, +}; + +static const short dep235[] = { + 32, 33, 67, 88, 126, 127, 131, 140, 166, 252, 2129, 2130, 2131, 2157, 2158, + 2161, 2164, 2297, 4127, 20605, +}; + +static const short dep236[] = { + 32, 33, 88, 166, 252, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 2295, 4127, + 16516, 16518, 18731, 18733, 18734, 18736, 20605, +}; + +static const short dep237[] = { + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 19, 20, 21, 22, 23, + 88, 174, 175, 176, 177, 178, 179, 180, 181, 183, 184, 186, 187, 189, 190, + 192, 193, 194, 195, 196, 198, 201, 202, 203, 204, 252, 2064, 2073, 2131, 2245, + 2254, 2297, 28844, 28987, +}; + +static const short dep238[] = { + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 21, 22, 23, + 32, 33, 88, 126, 163, 166, 174, 175, 176, 177, 178, 179, 180, 181, 183, 184, + 186, 187, 189, 190, 192, 193, 194, 195, 196, 198, 200, 202, 203, 204, 252, + 2064, 2073, 2129, 2130, 2131, 2157, 2158, 2161, 2164, 2245, 2254, 2297, 4127, + 20605, 28844, 28987, +}; + +#define NELS(X) (sizeof(X)/sizeof(X[0])) +static const struct ia64_opcode_dependency +op_dependencies[] = { + { NELS(dep1), dep1, NELS(dep0), dep0, }, + { NELS(dep3), dep3, NELS(dep2), dep2, }, + { NELS(dep5), dep5, NELS(dep4), dep4, }, + { NELS(dep7), dep7, NELS(dep6), dep6, }, + { NELS(dep9), dep9, NELS(dep8), dep8, }, + { NELS(dep11), dep11, NELS(dep10), dep10, }, + { NELS(dep13), dep13, NELS(dep12), dep12, }, + { NELS(dep15), dep15, NELS(dep14), dep14, }, + { NELS(dep17), dep17, NELS(dep16), dep16, }, + { NELS(dep19), dep19, NELS(dep18), dep18, }, + { NELS(dep21), dep21, NELS(dep20), dep20, }, + { NELS(dep23), dep23, NELS(dep22), dep22, }, + { NELS(dep25), dep25, NELS(dep24), dep24, }, + { NELS(dep27), dep27, NELS(dep26), dep26, }, + { NELS(dep28), dep28, NELS(dep12), dep12, }, + { NELS(dep30), dep30, NELS(dep29), dep29, }, + { NELS(dep32), dep32, NELS(dep31), dep31, }, + { NELS(dep33), dep33, NELS(dep12), dep12, }, + { NELS(dep35), dep35, NELS(dep34), dep34, }, + { NELS(dep37), dep37, NELS(dep36), dep36, }, + { NELS(dep39), dep39, NELS(dep38), dep38, }, + { NELS(dep40), dep40, NELS(dep29), dep29, }, + { NELS(dep41), dep41, NELS(dep31), dep31, }, + { NELS(dep43), dep43, NELS(dep42), dep42, }, + { NELS(dep45), dep45, NELS(dep44), dep44, }, + { NELS(dep47), dep47, NELS(dep46), dep46, }, + { NELS(dep49), dep49, NELS(dep48), dep48, }, + { NELS(dep51), dep51, NELS(dep50), dep50, }, + { NELS(dep53), dep53, NELS(dep52), dep52, }, + { NELS(dep55), dep55, NELS(dep54), dep54, }, + { NELS(dep57), dep57, NELS(dep56), dep56, }, + { NELS(dep59), dep59, NELS(dep58), dep58, }, + { NELS(dep61), dep61, NELS(dep60), dep60, }, + { NELS(dep63), dep63, NELS(dep62), dep62, }, + { NELS(dep65), dep65, NELS(dep64), dep64, }, + { NELS(dep66), dep66, NELS(dep31), dep31, }, + { NELS(dep68), dep68, NELS(dep67), dep67, }, + { NELS(dep70), dep70, NELS(dep69), dep69, }, + { NELS(dep72), dep72, NELS(dep71), dep71, }, + { NELS(dep74), dep74, NELS(dep73), dep73, }, + { NELS(dep75), dep75, NELS(dep31), dep31, }, + { NELS(dep77), dep77, NELS(dep76), dep76, }, + { NELS(dep79), dep79, NELS(dep78), dep78, }, + { NELS(dep81), dep81, NELS(dep80), dep80, }, + { NELS(dep82), dep82, NELS(dep31), dep31, }, + { NELS(dep83), dep83, NELS(dep31), dep31, }, + { NELS(dep84), dep84, NELS(dep31), dep31, }, + { NELS(dep85), dep85, NELS(dep31), dep31, }, + { NELS(dep87), dep87, NELS(dep86), dep86, }, + { NELS(dep89), dep89, NELS(dep88), dep88, }, + { NELS(dep91), dep91, NELS(dep90), dep90, }, + { NELS(dep93), dep93, NELS(dep92), dep92, }, + { NELS(dep95), dep95, NELS(dep94), dep94, }, + { NELS(dep97), dep97, NELS(dep96), dep96, }, + { NELS(dep99), dep99, NELS(dep98), dep98, }, + { NELS(dep101), dep101, NELS(dep100), dep100, }, + { NELS(dep103), dep103, NELS(dep102), dep102, }, + { NELS(dep105), dep105, NELS(dep104), dep104, }, + { NELS(dep107), dep107, NELS(dep106), dep106, }, + { NELS(dep109), dep109, NELS(dep108), dep108, }, + { NELS(dep111), dep111, NELS(dep110), dep110, }, + { NELS(dep113), dep113, NELS(dep112), dep112, }, + { NELS(dep115), dep115, NELS(dep114), dep114, }, + { NELS(dep117), dep117, NELS(dep116), dep116, }, + { NELS(dep119), dep119, NELS(dep118), dep118, }, + { NELS(dep120), dep120, NELS(dep62), dep62, }, + { NELS(dep121), dep121, NELS(dep31), dep31, }, + { NELS(dep123), dep123, NELS(dep122), dep122, }, + { NELS(dep124), dep124, NELS(dep0), dep0, }, + { NELS(dep126), dep126, NELS(dep125), dep125, }, + { NELS(dep128), dep128, NELS(dep127), dep127, }, + { NELS(dep129), dep129, NELS(dep0), dep0, }, + { NELS(dep130), dep130, NELS(dep0), dep0, }, + { NELS(dep132), dep132, NELS(dep131), dep131, }, + { NELS(dep133), dep133, NELS(dep0), dep0, }, + { NELS(dep134), dep134, NELS(dep31), dep31, }, + { NELS(dep136), dep136, NELS(dep135), dep135, }, + { NELS(dep137), dep137, NELS(dep135), dep135, }, + { NELS(dep139), dep139, NELS(dep138), dep138, }, + { NELS(dep140), dep140, NELS(dep138), dep138, }, + { NELS(dep141), dep141, NELS(dep135), dep135, }, + { NELS(dep143), dep143, NELS(dep142), dep142, }, + { NELS(dep145), dep145, NELS(dep144), dep144, }, + { NELS(dep147), dep147, NELS(dep146), dep146, }, + { NELS(dep149), dep149, NELS(dep148), dep148, }, + { NELS(dep150), dep150, NELS(dep0), dep0, }, + { NELS(dep152), dep152, NELS(dep151), dep151, }, + { NELS(dep154), dep154, NELS(dep153), dep153, }, + { NELS(dep156), dep156, NELS(dep155), dep155, }, + { NELS(dep158), dep158, NELS(dep157), dep157, }, + { NELS(dep160), dep160, NELS(dep159), dep159, }, + { NELS(dep161), dep161, NELS(dep0), dep0, }, + { NELS(dep162), dep162, NELS(dep0), dep0, }, + { NELS(dep163), dep163, NELS(dep0), dep0, }, + { NELS(dep164), dep164, NELS(dep31), dep31, }, + { NELS(dep166), dep166, NELS(dep165), dep165, }, + { NELS(dep167), dep167, NELS(dep165), dep165, }, + { NELS(dep169), dep169, NELS(dep168), dep168, }, + { NELS(dep171), dep171, NELS(dep170), dep170, }, + { NELS(dep173), dep173, NELS(dep172), dep172, }, + { NELS(dep175), dep175, NELS(dep174), dep174, }, + { NELS(dep177), dep177, NELS(dep176), dep176, }, + { NELS(dep179), dep179, NELS(dep178), dep178, }, + { NELS(dep181), dep181, NELS(dep180), dep180, }, + { NELS(dep183), dep183, NELS(dep182), dep182, }, + { NELS(dep185), dep185, NELS(dep184), dep184, }, + { NELS(dep186), dep186, NELS(dep0), dep0, }, + { NELS(dep187), dep187, NELS(dep0), dep0, }, + { NELS(dep188), dep188, NELS(dep0), dep0, }, + { NELS(dep189), dep189, NELS(dep0), dep0, }, + { NELS(dep190), dep190, NELS(dep0), dep0, }, + { NELS(dep191), dep191, NELS(dep0), dep0, }, + { NELS(dep192), dep192, NELS(dep0), dep0, }, + { NELS(dep193), dep193, NELS(dep0), dep0, }, + { NELS(dep195), dep195, NELS(dep194), dep194, }, + { NELS(dep197), dep197, NELS(dep196), dep196, }, + { NELS(dep199), dep199, NELS(dep198), dep198, }, + { NELS(dep201), dep201, NELS(dep200), dep200, }, + { NELS(dep202), dep202, NELS(dep0), dep0, }, + { NELS(dep203), dep203, NELS(dep0), dep0, }, + { NELS(dep204), dep204, NELS(dep0), dep0, }, + { NELS(dep205), dep205, NELS(dep31), dep31, }, + { NELS(dep206), dep206, NELS(dep31), dep31, }, + { NELS(dep207), dep207, NELS(dep194), dep194, }, + { NELS(dep208), dep208, NELS(dep0), dep0, }, + { NELS(dep209), dep209, NELS(dep0), dep0, }, + { NELS(dep211), dep211, NELS(dep210), dep210, }, + { NELS(dep212), dep212, NELS(dep210), dep210, }, + { NELS(dep213), dep213, NELS(dep0), dep0, }, + { NELS(dep211), dep211, NELS(dep214), dep214, }, + { NELS(dep216), dep216, NELS(dep215), dep215, }, + { NELS(dep218), dep218, NELS(dep217), dep217, }, + { NELS(dep220), dep220, NELS(dep219), dep219, }, + { NELS(dep221), dep221, NELS(dep219), dep219, }, + { NELS(dep222), dep222, NELS(dep0), dep0, }, + { NELS(dep223), dep223, NELS(dep219), dep219, }, + { NELS(dep225), dep225, NELS(dep224), dep224, }, + { NELS(dep226), dep226, NELS(dep62), dep62, }, + { NELS(dep227), dep227, NELS(dep62), dep62, }, + { NELS(dep229), dep229, NELS(dep228), dep228, }, + { NELS(dep230), dep230, NELS(dep228), dep228, }, + { NELS(dep229), dep229, NELS(dep231), dep231, }, + { NELS(dep232), dep232, NELS(dep31), dep31, }, + { NELS(dep233), dep233, NELS(dep31), dep31, }, + { NELS(dep234), dep234, NELS(dep0), dep0, }, + { NELS(dep235), dep235, NELS(dep0), dep0, }, + { NELS(dep236), dep236, NELS(dep62), dep62, }, + { 0, NULL, 0, NULL, }, + { NELS(dep238), dep238, NELS(dep237), dep237, }, +}; + +static const struct ia64_completer_table +completer_table[] = { + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 88 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, 449, -1, 0, 1, 6 }, + { 0x0, 0x0, 0, 512, -1, 0, 1, 17 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 147 }, + { 0x0, 0x0, 0, 611, -1, 0, 1, 17 }, + { 0x0, 0x0, 0, 1815, -1, 0, 1, 10 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 9 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 13 }, + { 0x1, 0x1, 0, -1, -1, 13, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 33 }, + { 0x0, 0x0, 0, 1991, -1, 0, 1, 29 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 29 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 29 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 33 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 33 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 122 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 44 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 40 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 78 }, + { 0x0, 0x0, 0, 1855, -1, 0, 1, 29 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 29 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 29 }, + { 0x0, 0x0, 0, 2034, -1, 0, 1, 29 }, + { 0x0, 0x0, 0, 1859, -1, 0, 1, 29 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 33 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 33 }, + { 0x0, 0x0, 0, 1861, -1, 0, 1, 29 }, + { 0x0, 0x0, 0, 2043, -1, 0, 1, 29 }, + { 0x0, 0x0, 0, 2046, -1, 0, 1, 29 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 33 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 33 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 33 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 29 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 29 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 29 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 29 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 29 }, + { 0x0, 0x0, 0, 2068, -1, 0, 1, 29 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 29 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 33 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 33 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 29 }, + { 0x0, 0x0, 0, 2071, -1, 0, 1, 29 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 24 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 24 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 24 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 24 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 33 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 35 }, + { 0x0, 0x0, 0, 2079, -1, 0, 1, 29 }, + { 0x0, 0x0, 0, 1170, -1, 0, 1, 33 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 40 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 33 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 77 }, + { 0x0, 0x0, 0, 1203, -1, 0, 1, 124 }, + { 0x0, 0x0, 0, 1212, -1, 0, 1, 124 }, + { 0x0, 0x0, 0, 1221, -1, 0, 1, 124 }, + { 0x0, 0x0, 0, 1230, -1, 0, 1, 124 }, + { 0x0, 0x0, 0, 1239, -1, 0, 1, 124 }, + { 0x0, 0x0, 0, 1248, -1, 0, 1, 124 }, + { 0x0, 0x0, 0, 1257, -1, 0, 1, 124 }, + { 0x0, 0x0, 0, 1266, -1, 0, 1, 124 }, + { 0x0, 0x0, 0, 1275, -1, 0, 1, 124 }, + { 0x0, 0x0, 0, 1285, -1, 0, 1, 124 }, + { 0x0, 0x0, 0, 1295, -1, 0, 1, 124 }, + { 0x0, 0x0, 0, 1305, -1, 0, 1, 124 }, + { 0x0, 0x0, 0, 1314, -1, 0, 1, 137 }, + { 0x0, 0x0, 0, 1320, -1, 0, 1, 137 }, + { 0x0, 0x0, 0, 1326, -1, 0, 1, 137 }, + { 0x0, 0x0, 0, 1332, -1, 0, 1, 137 }, + { 0x0, 0x0, 0, 1338, -1, 0, 1, 137 }, + { 0x0, 0x0, 0, 1344, -1, 0, 1, 137 }, + { 0x0, 0x0, 0, 1350, -1, 0, 1, 137 }, + { 0x0, 0x0, 0, 1356, -1, 0, 1, 137 }, + { 0x0, 0x0, 0, 1362, -1, 0, 1, 137 }, + { 0x0, 0x0, 0, 1368, -1, 0, 1, 137 }, + { 0x0, 0x0, 0, 1374, -1, 0, 1, 137 }, + { 0x0, 0x0, 0, 1380, -1, 0, 1, 137 }, + { 0x0, 0x0, 0, 1386, -1, 0, 1, 137 }, + { 0x0, 0x0, 0, 1392, -1, 0, 1, 137 }, + { 0x0, 0x0, 0, 1398, -1, 0, 1, 137 }, + { 0x0, 0x0, 0, 1404, -1, 0, 1, 137 }, + { 0x0, 0x0, 0, 1410, -1, 0, 1, 137 }, + { 0x0, 0x0, 0, 1416, -1, 0, 1, 137 }, + { 0x0, 0x0, 0, 1420, -1, 0, 1, 142 }, + { 0x0, 0x0, 0, 1424, -1, 0, 1, 144 }, + { 0x0, 0x0, 0, 1428, -1, 0, 1, 144 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 79 }, + { 0x0, 0x0, 0, 250, -1, 0, 1, 40 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 33 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 67 }, + { 0x1, 0x1, 0, 975, -1, 20, 1, 67 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 68 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 69 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 70 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 71 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 72 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 86 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 87 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 89 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 90 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 91 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 92 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 97 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 98 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 99 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 100 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 101 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 102 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 103 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 106 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 107 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 108 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 109 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 110 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 111 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 112 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 113 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 148 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 148 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 148 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 71 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 147 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, 2371, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, 2372, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, 1827, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, 1828, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, 2386, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, 2387, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, 2388, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, 2389, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, 2390, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, 2373, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, 2374, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 11 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 84 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 83 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x1, 0x1, 0, -1, -1, 13, 1, 0 }, + { 0x0, 0x0, 0, 2392, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 84 }, + { 0x0, 0x0, 0, 1692, -1, 0, 1, 130 }, + { 0x0, 0x0, 0, 1694, -1, 0, 1, 135 }, + { 0x0, 0x0, 0, 1696, -1, 0, 1, 130 }, + { 0x0, 0x0, 0, 1698, -1, 0, 1, 135 }, + { 0x0, 0x0, 0, 1700, -1, 0, 1, 130 }, + { 0x0, 0x0, 0, 1702, -1, 0, 1, 135 }, + { 0x0, 0x0, 0, 1705, -1, 0, 1, 130 }, + { 0x0, 0x0, 0, 1708, -1, 0, 1, 135 }, + { 0x0, 0x0, 0, 1711, -1, 0, 1, 130 }, + { 0x0, 0x0, 0, 1712, -1, 0, 1, 130 }, + { 0x0, 0x0, 0, 1713, -1, 0, 1, 130 }, + { 0x0, 0x0, 0, 1714, -1, 0, 1, 130 }, + { 0x0, 0x0, 0, 1715, -1, 0, 1, 130 }, + { 0x0, 0x0, 0, 1716, -1, 0, 1, 130 }, + { 0x0, 0x0, 0, 1717, -1, 0, 1, 130 }, + { 0x0, 0x0, 0, 1718, -1, 0, 1, 130 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 82 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 120 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 118 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 120 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 119 }, + { 0x0, 0x0, 0, 1429, -1, 0, 1, 133 }, + { 0x0, 0x0, 0, 1430, -1, 0, 1, 133 }, + { 0x0, 0x0, 0, 1431, -1, 0, 1, 133 }, + { 0x0, 0x0, 0, 1432, -1, 0, 1, 133 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 0, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 1, 217, -1, 0, 1, 12 }, + { 0x1, 0x1, 2, -1, -1, 27, 1, 12 }, + { 0x0, 0x0, 3, -1, 1112, 0, 0, -1 }, + { 0x0, 0x0, 3, -1, 1113, 0, 0, -1 }, + { 0x1, 0x1, 3, 2262, 1196, 33, 1, 126 }, + { 0x1, 0x1, 3, 2263, 1205, 33, 1, 126 }, + { 0x1, 0x1, 3, 2264, 1214, 33, 1, 126 }, + { 0x1, 0x1, 3, 2265, 1223, 33, 1, 126 }, + { 0x1, 0x1, 3, 2266, 1232, 33, 1, 126 }, + { 0x1, 0x1, 3, 2267, 1241, 33, 1, 126 }, + { 0x1, 0x1, 3, 2268, 1250, 33, 1, 126 }, + { 0x1, 0x1, 3, 2269, 1259, 33, 1, 126 }, + { 0x1, 0x1, 3, 2270, 1268, 33, 1, 126 }, + { 0x1, 0x1, 3, 2271, 1277, 33, 1, 126 }, + { 0x1, 0x1, 3, 2272, 1287, 33, 1, 126 }, + { 0x1, 0x1, 3, 2273, 1297, 33, 1, 126 }, + { 0x1, 0x1, 3, 2274, 1310, 33, 1, 139 }, + { 0x1, 0x1, 3, 2275, 1316, 33, 1, 139 }, + { 0x1, 0x1, 3, 2276, 1322, 33, 1, 139 }, + { 0x1, 0x1, 3, 2277, 1328, 33, 1, 139 }, + { 0x1, 0x1, 3, 2278, 1334, 33, 1, 139 }, + { 0x1, 0x1, 3, 2279, 1340, 33, 1, 139 }, + { 0x1, 0x1, 3, 2280, 1346, 33, 1, 139 }, + { 0x1, 0x1, 3, 2281, 1352, 33, 1, 139 }, + { 0x1, 0x1, 3, 2282, 1358, 33, 1, 139 }, + { 0x1, 0x1, 3, 2283, 1364, 33, 1, 139 }, + { 0x1, 0x1, 3, 2284, 1370, 33, 1, 139 }, + { 0x1, 0x1, 3, 2285, 1376, 33, 1, 139 }, + { 0x1, 0x1, 3, 2286, 1382, 33, 1, 139 }, + { 0x1, 0x1, 3, 2287, 1388, 33, 1, 139 }, + { 0x1, 0x1, 3, 2288, 1394, 33, 1, 139 }, + { 0x1, 0x1, 3, 2289, 1400, 33, 1, 139 }, + { 0x1, 0x1, 3, 2290, 1406, 33, 1, 139 }, + { 0x1, 0x1, 3, 2291, 1412, 33, 1, 139 }, + { 0x1, 0x1, 3, -1, -1, 27, 1, 40 }, + { 0x0, 0x0, 4, 1829, 1183, 0, 1, 132 }, + { 0x0, 0x0, 4, 1830, 1185, 0, 1, 132 }, + { 0x0, 0x0, 4, 1831, 1187, 0, 1, 132 }, + { 0x0, 0x0, 4, 1832, 1189, 0, 1, 132 }, + { 0x0, 0x0, 4, 1833, 1191, 0, 1, 133 }, + { 0x0, 0x0, 4, 1834, 1193, 0, 1, 133 }, + { 0x1, 0x1, 4, -1, 1200, 33, 1, 129 }, + { 0x5, 0x5, 4, 407, 1199, 32, 1, 124 }, + { 0x1, 0x1, 4, -1, 1209, 33, 1, 129 }, + { 0x5, 0x5, 4, 408, 1208, 32, 1, 124 }, + { 0x1, 0x1, 4, -1, 1218, 33, 1, 129 }, + { 0x5, 0x5, 4, 409, 1217, 32, 1, 124 }, + { 0x1, 0x1, 4, -1, 1227, 33, 1, 129 }, + { 0x5, 0x5, 4, 410, 1226, 32, 1, 124 }, + { 0x1, 0x1, 4, -1, 1236, 33, 1, 129 }, + { 0x5, 0x5, 4, 411, 1235, 32, 1, 124 }, + { 0x1, 0x1, 4, -1, 1245, 33, 1, 129 }, + { 0x5, 0x5, 4, 412, 1244, 32, 1, 124 }, + { 0x1, 0x1, 4, -1, 1254, 33, 1, 129 }, + { 0x5, 0x5, 4, 413, 1253, 32, 1, 124 }, + { 0x1, 0x1, 4, -1, 1263, 33, 1, 129 }, + { 0x5, 0x5, 4, 414, 1262, 32, 1, 124 }, + { 0x1, 0x1, 4, -1, 1272, 33, 1, 129 }, + { 0x5, 0x5, 4, 415, 1271, 32, 1, 124 }, + { 0x1, 0x1, 4, -1, 1282, 33, 1, 129 }, + { 0x5, 0x5, 4, 881, 1280, 32, 1, 124 }, + { 0x1, 0x1, 4, -1, 1292, 33, 1, 129 }, + { 0x5, 0x5, 4, 882, 1290, 32, 1, 124 }, + { 0x1, 0x1, 4, -1, 1302, 33, 1, 129 }, + { 0x5, 0x5, 4, 883, 1300, 32, 1, 124 }, + { 0x1, 0x21, 10, 1727, -1, 33, 1, 3 }, + { 0x200001, 0x200001, 10, 1728, -1, 12, 1, 3 }, + { 0x0, 0x0, 10, 1729, -1, 0, 1, 3 }, + { 0x1, 0x1, 10, 1730, -1, 12, 1, 3 }, + { 0x1, 0x1, 10, 1731, -1, 33, 1, 3 }, + { 0x200001, 0x200001, 10, 1732, -1, 12, 1, 3 }, + { 0x0, 0x0, 10, 346, -1, 0, 1, 3 }, + { 0x1, 0x1, 10, 1758, -1, 12, 1, 3 }, + { 0x1, 0x1, 10, 350, -1, 33, 1, 3 }, + { 0x200001, 0x200001, 10, 1760, -1, 12, 1, 3 }, + { 0x1, 0x21, 10, 1737, -1, 33, 1, 3 }, + { 0x200001, 0x200001, 10, 1738, -1, 12, 1, 3 }, + { 0x0, 0x0, 10, -1, 1767, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1768, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1769, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1770, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1771, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1772, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1773, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1774, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1775, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1776, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1777, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1778, 0, 0, -1 }, + { 0x1, 0x21, 10, 1739, -1, 33, 1, 3 }, + { 0x200001, 0x200001, 10, 1740, -1, 12, 1, 3 }, + { 0x0, 0x0, 10, 1741, -1, 0, 1, 3 }, + { 0x1, 0x1, 10, 1742, -1, 12, 1, 3 }, + { 0x1, 0x1, 10, 1743, -1, 33, 1, 3 }, + { 0x200001, 0x200001, 10, 1744, -1, 12, 1, 3 }, + { 0x0, 0x0, 10, 370, -1, 0, 1, 3 }, + { 0x1, 0x1, 10, 1782, -1, 12, 1, 3 }, + { 0x1, 0x1, 10, 374, -1, 33, 1, 3 }, + { 0x200001, 0x200001, 10, 1784, -1, 12, 1, 3 }, + { 0x1, 0x21, 10, 1749, -1, 33, 1, 3 }, + { 0x200001, 0x200001, 10, 1750, -1, 12, 1, 3 }, + { 0x0, 0x0, 10, -1, 1791, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1792, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1793, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1794, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1795, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1796, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1797, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1798, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1799, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1800, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1801, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1802, 0, 0, -1 }, + { 0x1, 0x1, 10, 1751, -1, 36, 1, 3 }, + { 0x1000001, 0x1000001, 10, 1752, -1, 12, 1, 3 }, + { 0x0, 0x0, 10, -1, 1803, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1805, 0, 0, -1 }, + { 0x1, 0x1, 10, 1753, -1, 36, 1, 3 }, + { 0x1000001, 0x1000001, 10, 1754, -1, 12, 1, 3 }, + { 0x0, 0x0, 10, -1, 1807, 0, 0, -1 }, + { 0x0, 0x0, 10, -1, 1809, 0, 0, -1 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x0, 0x0, 11, 1755, -1, 0, 1, 3 }, + { 0x1, 0x1, 11, 1756, -1, 12, 1, 3 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x1, 0x1, 11, 1733, -1, 12, 1, 3 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x0, 0x0, 11, 288, -1, 0, 1, 3 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x200001, 0x200001, 11, 1735, -1, 12, 1, 3 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x1, 0x1, 11, 290, -1, 33, 1, 3 }, + { 0x0, 0x0, 11, 1761, -1, 0, 1, 3 }, + { 0x1, 0x1, 11, 1762, -1, 12, 1, 3 }, + { 0x1, 0x1, 11, 1763, -1, 33, 1, 3 }, + { 0x200001, 0x200001, 11, 1764, -1, 12, 1, 3 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x0, 0x0, 11, 1765, -1, 0, 1, 3 }, + { 0x1, 0x1, 11, 1766, -1, 12, 1, 3 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x0, 0x0, 11, 1779, -1, 0, 1, 3 }, + { 0x1, 0x1, 11, 1780, -1, 12, 1, 3 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x1, 0x1, 11, 1745, -1, 12, 1, 3 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x0, 0x0, 11, 312, -1, 0, 1, 3 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x200001, 0x200001, 11, 1747, -1, 12, 1, 3 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x1, 0x1, 11, 314, -1, 33, 1, 3 }, + { 0x0, 0x0, 11, 1785, -1, 0, 1, 3 }, + { 0x1, 0x1, 11, 1786, -1, 12, 1, 3 }, + { 0x1, 0x1, 11, 1787, -1, 33, 1, 3 }, + { 0x200001, 0x200001, 11, 1788, -1, 12, 1, 3 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x2, 0x3, 11, -1, -1, 37, 1, 5 }, + { 0x0, 0x0, 11, 1789, -1, 0, 1, 3 }, + { 0x1, 0x1, 11, 1790, -1, 12, 1, 3 }, + { 0x1, 0x1, 11, -1, -1, 36, 1, 5 }, + { 0x1, 0x1, 11, -1, -1, 36, 1, 5 }, + { 0x1, 0x1, 11, 1804, -1, 36, 1, 3 }, + { 0x1000001, 0x1000001, 11, 1806, -1, 12, 1, 3 }, + { 0x1, 0x1, 11, -1, -1, 36, 1, 5 }, + { 0x1, 0x1, 11, -1, -1, 36, 1, 5 }, + { 0x1, 0x1, 11, 1808, -1, 36, 1, 3 }, + { 0x1000001, 0x1000001, 11, 1810, -1, 12, 1, 3 }, + { 0x0, 0x0, 12, -1, -1, 0, 1, 14 }, + { 0x0, 0x0, 12, -1, -1, 0, 1, 14 }, + { 0x1, 0x1, 13, 258, 1198, 34, 1, 124 }, + { 0x1, 0x1, 13, 260, 1207, 34, 1, 124 }, + { 0x1, 0x1, 13, 262, 1216, 34, 1, 124 }, + { 0x1, 0x1, 13, 264, 1225, 34, 1, 124 }, + { 0x1, 0x1, 13, 266, 1234, 34, 1, 124 }, + { 0x1, 0x1, 13, 268, 1243, 34, 1, 124 }, + { 0x1, 0x1, 13, 270, 1252, 34, 1, 124 }, + { 0x1, 0x1, 13, 272, 1261, 34, 1, 124 }, + { 0x1, 0x1, 13, 274, 1270, 34, 1, 124 }, + { 0x1, 0x1, 13, 276, 1279, 34, 1, 124 }, + { 0x1, 0x1, 13, 278, 1289, 34, 1, 124 }, + { 0x1, 0x1, 13, 280, 1299, 34, 1, 124 }, + { 0x0, 0x0, 19, -1, 650, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 651, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 652, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 653, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 654, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 655, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 656, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 657, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 658, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 659, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 660, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 661, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 662, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 663, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 664, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 665, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 666, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 667, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 668, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 669, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 670, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 671, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 672, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 673, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 674, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 675, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 676, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 677, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 678, 0, 0, -1 }, + { 0x0, 0x0, 19, -1, 679, 0, 0, -1 }, + { 0x0, 0x0, 20, -1, 2340, 0, 0, -1 }, + { 0x0, 0x0, 20, -1, 2341, 0, 0, -1 }, + { 0x0, 0x0, 20, -1, 2356, 0, 0, -1 }, + { 0x0, 0x0, 20, -1, 2357, 0, 0, -1 }, + { 0x0, 0x0, 20, -1, 2362, 0, 0, -1 }, + { 0x0, 0x0, 20, -1, 2363, 0, 0, -1 }, + { 0x0, 0x0, 21, 686, 2352, 0, 0, -1 }, + { 0x0, 0x0, 21, 687, 2354, 0, 0, -1 }, + { 0x0, 0x0, 23, -1, 2350, 0, 0, -1 }, + { 0x0, 0x0, 23, -1, 2351, 0, 0, -1 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, 1045, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 7 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 7 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 7 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 7 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 7 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 7 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 7 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 7 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 6 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 7 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 7 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 7 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 7 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 8 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 8 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 8 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 8 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 8 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 8 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 8 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 8 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 8 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 8 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 8 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 8 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 15 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 15 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 15 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 15 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 15 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 15 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 15 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 15 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 15 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 15 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 15 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 15 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, 1066, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 18 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 19 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 19 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 19 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 19 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 19 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 19 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 19 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 19 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 19 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 19 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 19 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 19 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 20 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, 1099, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 17 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 35, 1, 21 }, + { 0x1, 0x1, 24, -1, -1, 33, 1, 76 }, + { 0x1, 0x1, 24, -1, -1, 33, 1, 76 }, + { 0x1, 0x1, 24, 1114, 1201, 35, 1, 129 }, + { 0x1, 0x1, 24, 1115, 1210, 35, 1, 129 }, + { 0x1, 0x1, 24, 1116, 1219, 35, 1, 129 }, + { 0x1, 0x1, 24, 1117, 1228, 35, 1, 129 }, + { 0x1, 0x1, 24, 1118, 1237, 35, 1, 129 }, + { 0x1, 0x1, 24, 1119, 1246, 35, 1, 129 }, + { 0x1, 0x1, 24, 1120, 1255, 35, 1, 129 }, + { 0x1, 0x1, 24, 1121, 1264, 35, 1, 129 }, + { 0x1, 0x1, 24, 1122, 1273, 35, 1, 129 }, + { 0x1, 0x1, 24, 1123, 1283, 35, 1, 129 }, + { 0x1, 0x1, 24, 1124, 1293, 35, 1, 129 }, + { 0x1, 0x1, 24, 1125, 1303, 35, 1, 129 }, + { 0x1, 0x1, 24, 1126, 1312, 35, 1, 141 }, + { 0x1, 0x1, 24, 1127, 1318, 35, 1, 141 }, + { 0x1, 0x1, 24, 1128, 1324, 35, 1, 141 }, + { 0x1, 0x1, 24, 1129, 1330, 35, 1, 141 }, + { 0x1, 0x1, 24, 1130, 1336, 35, 1, 141 }, + { 0x1, 0x1, 24, 1131, 1342, 35, 1, 141 }, + { 0x1, 0x1, 24, 1132, 1348, 35, 1, 141 }, + { 0x1, 0x1, 24, 1133, 1354, 35, 1, 141 }, + { 0x1, 0x1, 24, 1134, 1360, 35, 1, 141 }, + { 0x1, 0x1, 24, 1135, 1366, 35, 1, 141 }, + { 0x1, 0x1, 24, 1136, 1372, 35, 1, 141 }, + { 0x1, 0x1, 24, 1137, 1378, 35, 1, 141 }, + { 0x1, 0x1, 24, 1138, 1384, 35, 1, 141 }, + { 0x1, 0x1, 24, 1139, 1390, 35, 1, 141 }, + { 0x1, 0x1, 24, 1140, 1396, 35, 1, 141 }, + { 0x1, 0x1, 24, 1141, 1402, 35, 1, 141 }, + { 0x1, 0x1, 24, 1142, 1408, 35, 1, 141 }, + { 0x1, 0x1, 24, 1143, 1414, 35, 1, 141 }, + { 0x0, 0x0, 32, 2334, 2332, 0, 0, -1 }, + { 0x0, 0x0, 32, 2337, 2335, 0, 0, -1 }, + { 0x0, 0x0, 32, 2343, 2342, 0, 0, -1 }, + { 0x0, 0x0, 32, 2345, 2344, 0, 0, -1 }, + { 0x0, 0x0, 32, 2359, 2358, 0, 0, -1 }, + { 0x0, 0x0, 32, 2361, 2360, 0, 0, -1 }, + { 0x0, 0x0, 34, -1, 2353, 0, 0, -1 }, + { 0x0, 0x0, 34, -1, 2355, 0, 0, -1 }, + { 0x1, 0x1, 37, -1, 1899, 37, 1, 29 }, + { 0x1, 0x1, 37, -1, 1934, 37, 1, 29 }, + { 0x0, 0x0, 37, -1, 1937, 0, 0, -1 }, + { 0x1, 0x1, 37, -1, -1, 37, 1, 29 }, + { 0x1, 0x1, 37, -1, 1942, 37, 1, 29 }, + { 0x0, 0x0, 37, -1, 1945, 0, 0, -1 }, + { 0x1, 0x1, 37, -1, -1, 37, 1, 29 }, + { 0x0, 0x0, 37, -1, 1948, 0, 0, -1 }, + { 0x1, 0x1, 37, -1, -1, 37, 1, 29 }, + { 0x1, 0x1, 37, -1, 1951, 37, 1, 29 }, + { 0x1, 0x1, 37, -1, 1954, 37, 1, 29 }, + { 0x1, 0x1, 37, -1, 1987, 37, 1, 29 }, + { 0x3, 0x3, 37, -1, -1, 30, 1, 134 }, + { 0x0, 0x0, 37, 951, -1, 0, 1, 95 }, + { 0x0, 0x0, 37, -1, -1, 0, 1, 104 }, + { 0x0, 0x0, 37, 957, -1, 0, 1, 116 }, + { 0x3, 0x3, 37, -1, -1, 30, 1, 146 }, + { 0x0, 0x0, 37, 958, -1, 0, 1, 40 }, + { 0x0, 0x0, 39, -1, 818, 0, 0, -1 }, + { 0x0, 0x0, 39, -1, 826, 0, 0, -1 }, + { 0x0, 0x0, 39, 960, 822, 0, 0, -1 }, + { 0x3, 0x3, 39, -1, 477, 33, 1, 6 }, + { 0x18000001, 0x18000001, 39, -1, 485, 6, 1, 7 }, + { 0x3, 0x3, 39, 961, 481, 33, 1, 6 }, + { 0x0, 0x0, 39, -1, 830, 0, 0, -1 }, + { 0x3, 0x3, 39, -1, 497, 33, 1, 8 }, + { 0x0, 0x0, 39, -1, 834, 0, 0, -1 }, + { 0x3, 0x3, 39, -1, 509, 33, 1, 15 }, + { 0x0, 0x0, 39, -1, 839, 0, 0, -1 }, + { 0x0, 0x0, 39, -1, 843, 0, 0, -1 }, + { 0x3, 0x3, 39, -1, 532, 33, 1, 17 }, + { 0x3, 0x3, 39, -1, 536, 33, 1, 17 }, + { 0x0, 0x0, 39, -1, 847, 0, 0, -1 }, + { 0x0, 0x0, 39, -1, 851, 0, 0, -1 }, + { 0x3, 0x3, 39, -1, 556, 33, 1, 18 }, + { 0x18000001, 0x18000001, 39, -1, 560, 6, 1, 18 }, + { 0x0, 0x0, 39, -1, 855, 0, 0, -1 }, + { 0x3, 0x3, 39, -1, 572, 33, 1, 19 }, + { 0x0, 0x0, 39, -1, 859, 0, 0, -1 }, + { 0x0, 0x0, 39, -1, 863, 0, 0, -1 }, + { 0x3, 0x3, 39, -1, 592, 33, 1, 20 }, + { 0x18000001, 0x18000001, 39, -1, 596, 6, 1, 20 }, + { 0x0, 0x0, 39, -1, 867, 0, 0, -1 }, + { 0x3, 0x3, 39, -1, 608, 33, 1, 21 }, + { 0x0, 0x0, 39, -1, 872, 0, 0, -1 }, + { 0x0, 0x0, 39, -1, 876, 0, 0, -1 }, + { 0x3, 0x3, 39, -1, 631, 33, 1, 17 }, + { 0x3, 0x3, 39, -1, 635, 33, 1, 17 }, + { 0x0, 0x0, 39, -1, 880, 0, 0, -1 }, + { 0x3, 0x3, 39, -1, 647, 33, 1, 21 }, + { 0x0, 0x0, 40, 706, 817, 0, 0, -1 }, + { 0x0, 0x0, 40, 707, 825, 0, 0, -1 }, + { 0x0, 0x0, 40, 708, 821, 0, 0, -1 }, + { 0x1, 0x1, 40, 709, 476, 34, 1, 6 }, + { 0x10000001, 0x10000001, 40, 710, 484, 6, 1, 7 }, + { 0x1, 0x1, 40, 711, 480, 34, 1, 6 }, + { 0x0, 0x0, 40, 712, 829, 0, 0, -1 }, + { 0x1, 0x1, 40, 713, 496, 34, 1, 8 }, + { 0x0, 0x0, 40, 714, 833, 0, 0, -1 }, + { 0x1, 0x1, 40, 715, 508, 34, 1, 15 }, + { 0x0, 0x0, 40, 716, 838, 0, 0, -1 }, + { 0x0, 0x0, 40, 717, 842, 0, 0, -1 }, + { 0x1, 0x1, 40, 718, 531, 34, 1, 17 }, + { 0x1, 0x1, 40, 719, 535, 34, 1, 17 }, + { 0x0, 0x0, 40, 720, 846, 0, 0, -1 }, + { 0x0, 0x0, 40, 721, 850, 0, 0, -1 }, + { 0x1, 0x1, 40, 722, 555, 34, 1, 18 }, + { 0x10000001, 0x10000001, 40, 723, 559, 6, 1, 18 }, + { 0x0, 0x0, 40, 724, 854, 0, 0, -1 }, + { 0x1, 0x1, 40, 725, 571, 34, 1, 19 }, + { 0x0, 0x0, 40, 726, 858, 0, 0, -1 }, + { 0x0, 0x0, 40, 727, 862, 0, 0, -1 }, + { 0x1, 0x1, 40, 728, 591, 34, 1, 20 }, + { 0x10000001, 0x10000001, 40, 729, 595, 6, 1, 20 }, + { 0x0, 0x0, 40, 730, 866, 0, 0, -1 }, + { 0x1, 0x1, 40, 731, 607, 34, 1, 21 }, + { 0x0, 0x0, 40, 732, 871, 0, 0, -1 }, + { 0x0, 0x0, 40, 733, 875, 0, 0, -1 }, + { 0x1, 0x1, 40, 734, 630, 34, 1, 17 }, + { 0x1, 0x1, 40, 735, 634, 34, 1, 17 }, + { 0x0, 0x0, 40, 736, 879, 0, 0, -1 }, + { 0x1, 0x1, 40, 737, 646, 34, 1, 21 }, + { 0x800001, 0x800001, 40, -1, 965, 4, 1, 16 }, + { 0x1, 0x1, 40, 1845, 963, 4, 1, 16 }, + { 0x1, 0x1, 40, 803, 968, 4, 1, 22 }, + { 0x2, 0x3, 40, -1, 973, 20, 1, 67 }, + { 0x1, 0x1, 40, 1846, 971, 21, 1, 67 }, + { 0x0, 0x0, 41, -1, -1, 0, 1, 80 }, + { 0x0, 0x0, 41, -1, -1, 0, 1, 80 }, + { 0x0, 0x0, 41, -1, -1, 0, 1, 123 }, + { 0x1, 0x1, 43, 1144, 281, 38, 1, 1 }, + { 0x0, 0x0, 43, -1, 340, 0, 0, -1 }, + { 0x1, 0x1, 43, 1147, 291, 38, 1, 1 }, + { 0x0, 0x0, 43, -1, 360, 0, 0, -1 }, + { 0x0, 0x0, 43, -1, 294, 0, 0, -1 }, + { 0x0, 0x0, 43, -1, 304, 0, 0, -1 }, + { 0x1, 0x1, 43, 1152, 305, 38, 1, 1 }, + { 0x0, 0x0, 43, -1, 364, 0, 0, -1 }, + { 0x1, 0x1, 43, 1155, 315, 38, 1, 1 }, + { 0x0, 0x0, 43, -1, 384, 0, 0, -1 }, + { 0x0, 0x0, 43, -1, 318, 0, 0, -1 }, + { 0x0, 0x0, 43, -1, 328, 0, 0, -1 }, + { 0x0, 0x0, 43, 1028, 1906, 0, 0, -1 }, + { 0x0, 0x0, 43, 1029, 2439, 0, 1, 54 }, + { 0x0, 0x0, 43, 1030, 1958, 0, 0, -1 }, + { 0x0, 0x0, 43, 1031, -1, 0, 1, 49 }, + { 0x0, 0x0, 43, 935, -1, 0, 1, 0 }, + { 0x0, 0x0, 43, 936, -1, 0, 1, 0 }, + { 0x0, 0x0, 43, 937, -1, 0, 1, 0 }, + { 0x1, 0x1, 44, -1, 1418, 30, 1, 143 }, + { 0x1, 0x1, 44, 808, 1417, 30, 1, 142 }, + { 0x1, 0x1, 44, -1, 1422, 30, 1, 145 }, + { 0x1, 0x1, 44, 809, 1421, 30, 1, 144 }, + { 0x1, 0x1, 44, -1, 1426, 30, 1, 145 }, + { 0x1, 0x1, 44, 810, 1425, 30, 1, 144 }, + { 0x3, 0x3, 45, -1, 969, 3, 1, 22 }, + { 0x1, 0x1, 46, 1866, -1, 30, 1, 134 }, + { 0x1, 0x1, 46, 1897, -1, 30, 1, 146 }, + { 0x0, 0x0, 48, -1, -1, 0, 1, 40 }, + { 0x0, 0x0, 48, -1, -1, 0, 1, 40 }, + { 0x1, 0x1, 55, -1, 1419, 31, 1, 143 }, + { 0x1, 0x1, 55, -1, 1423, 31, 1, 145 }, + { 0x1, 0x1, 55, -1, 1427, 31, 1, 145 }, + { 0x0, 0x0, 55, -1, -1, 0, 1, 94 }, + { 0x2, 0x3, 55, -1, -1, 27, 1, 94 }, + { 0x1, 0x1, 55, -1, -1, 28, 1, 94 }, + { 0x0, 0x0, 64, 13, 447, 0, 1, 6 }, + { 0x0, 0x0, 64, 1046, 450, 0, 1, 6 }, + { 0x1, 0x1, 64, 1047, 452, 33, 1, 6 }, + { 0x1, 0x1, 64, 1048, 454, 34, 1, 6 }, + { 0x3, 0x3, 64, 1049, 456, 33, 1, 6 }, + { 0x0, 0x0, 64, 1050, 458, 0, 1, 6 }, + { 0x1, 0x1, 64, 1051, 460, 33, 1, 6 }, + { 0x1, 0x1, 64, 1052, 462, 34, 1, 6 }, + { 0x3, 0x3, 64, 1053, 464, 33, 1, 6 }, + { 0x1, 0x1, 64, 1054, 466, 6, 1, 7 }, + { 0x8000001, 0x8000001, 64, 1055, 468, 6, 1, 7 }, + { 0x10000001, 0x10000001, 64, 1056, 470, 6, 1, 7 }, + { 0x18000001, 0x18000001, 64, 1057, 472, 6, 1, 7 }, + { 0x0, 0x0, 64, 1058, 486, 0, 1, 8 }, + { 0x1, 0x1, 64, 1059, 488, 33, 1, 8 }, + { 0x1, 0x1, 64, 1060, 490, 34, 1, 8 }, + { 0x3, 0x3, 64, 1061, 492, 33, 1, 8 }, + { 0x0, 0x0, 64, 1062, 498, 0, 1, 15 }, + { 0x1, 0x1, 64, 1063, 500, 33, 1, 15 }, + { 0x1, 0x1, 64, 1064, 502, 34, 1, 15 }, + { 0x3, 0x3, 64, 1065, 504, 33, 1, 15 }, + { 0x0, 0x0, 64, 14, 510, 0, 1, 17 }, + { 0x0, 0x0, 64, 1067, 513, 0, 1, 17 }, + { 0x1, 0x1, 64, 1068, 515, 33, 1, 17 }, + { 0x1, 0x1, 64, 1069, 517, 34, 1, 17 }, + { 0x3, 0x3, 64, 1070, 519, 33, 1, 17 }, + { 0x0, 0x0, 64, 1071, 521, 0, 1, 17 }, + { 0x1, 0x1, 64, 1072, 523, 33, 1, 17 }, + { 0x1, 0x1, 64, 1073, 525, 34, 1, 17 }, + { 0x3, 0x3, 64, 1074, 527, 33, 1, 17 }, + { 0x0, 0x0, 64, 1075, 537, 0, 1, 18 }, + { 0x1, 0x1, 64, 1076, 539, 33, 1, 18 }, + { 0x1, 0x1, 64, 1077, 541, 34, 1, 18 }, + { 0x3, 0x3, 64, 1078, 543, 33, 1, 18 }, + { 0x1, 0x1, 64, 1079, 545, 6, 1, 18 }, + { 0x8000001, 0x8000001, 64, 1080, 547, 6, 1, 18 }, + { 0x10000001, 0x10000001, 64, 1081, 549, 6, 1, 18 }, + { 0x18000001, 0x18000001, 64, 1082, 551, 6, 1, 18 }, + { 0x0, 0x0, 64, 1083, 561, 0, 1, 19 }, + { 0x1, 0x1, 64, 1084, 563, 33, 1, 19 }, + { 0x1, 0x1, 64, 1085, 565, 34, 1, 19 }, + { 0x3, 0x3, 64, 1086, 567, 33, 1, 19 }, + { 0x0, 0x0, 64, 1087, 573, 0, 1, 20 }, + { 0x1, 0x1, 64, 1088, 575, 33, 1, 20 }, + { 0x1, 0x1, 64, 1089, 577, 34, 1, 20 }, + { 0x3, 0x3, 64, 1090, 579, 33, 1, 20 }, + { 0x1, 0x1, 64, 1091, 581, 6, 1, 20 }, + { 0x8000001, 0x8000001, 64, 1092, 583, 6, 1, 20 }, + { 0x10000001, 0x10000001, 64, 1093, 585, 6, 1, 20 }, + { 0x18000001, 0x18000001, 64, 1094, 587, 6, 1, 20 }, + { 0x0, 0x0, 64, 1095, 597, 0, 1, 21 }, + { 0x1, 0x1, 64, 1096, 599, 33, 1, 21 }, + { 0x1, 0x1, 64, 1097, 601, 34, 1, 21 }, + { 0x3, 0x3, 64, 1098, 603, 33, 1, 21 }, + { 0x0, 0x0, 64, 16, 609, 0, 1, 17 }, + { 0x0, 0x0, 64, 1100, 612, 0, 1, 17 }, + { 0x1, 0x1, 64, 1101, 614, 33, 1, 17 }, + { 0x1, 0x1, 64, 1102, 616, 34, 1, 17 }, + { 0x3, 0x3, 64, 1103, 618, 33, 1, 17 }, + { 0x0, 0x0, 64, 1104, 620, 0, 1, 17 }, + { 0x1, 0x1, 64, 1105, 622, 33, 1, 17 }, + { 0x1, 0x1, 64, 1106, 624, 34, 1, 17 }, + { 0x3, 0x3, 64, 1107, 626, 33, 1, 17 }, + { 0x0, 0x0, 64, 1108, 636, 0, 1, 21 }, + { 0x1, 0x1, 64, 1109, 638, 33, 1, 21 }, + { 0x1, 0x1, 64, 1110, 640, 34, 1, 21 }, + { 0x3, 0x3, 64, 1111, 642, 33, 1, 21 }, + { 0x3, 0x3, 65, 416, 1281, 33, 1, 128 }, + { 0x3, 0x3, 65, 417, 1291, 33, 1, 128 }, + { 0x3, 0x3, 65, 418, 1301, 33, 1, 128 }, + { 0x0, 0x0, 65, -1, 1306, 0, 1, 137 }, + { 0x0, 0x0, 65, -1, 1307, 0, 1, 137 }, + { 0x0, 0x0, 65, -1, 1308, 0, 1, 137 }, + { 0x0, 0x0, 106, 891, 1930, 0, 0, -1 }, + { 0x0, 0x0, 106, 892, 2377, 0, 1, 29 }, + { 0x0, 0x0, 106, 893, 1971, 0, 0, -1 }, + { 0x0, 0x0, 106, 894, 2381, 0, 1, 29 }, + { 0x0, 0x0, 108, -1, 1932, 0, 0, -1 }, + { 0x1, 0x1, 108, -1, 2378, 27, 1, 29 }, + { 0x0, 0x0, 108, -1, 1973, 0, 0, -1 }, + { 0x1, 0x1, 108, -1, 2382, 27, 1, 29 }, + { 0x0, 0x0, 109, 896, -1, 0, 1, 115 }, + { 0x1, 0x1, 110, -1, -1, 27, 1, 115 }, + { 0x0, 0x0, 111, 914, 2400, 0, 1, 1 }, + { 0x0, 0x0, 111, 1015, 285, 0, 0, -1 }, + { 0x0, 0x0, 111, 992, 348, 0, 0, -1 }, + { 0x0, 0x0, 111, -1, 356, 0, 0, -1 }, + { 0x0, 0x0, 111, 915, 2408, 0, 1, 1 }, + { 0x0, 0x0, 111, -1, 298, 0, 0, -1 }, + { 0x0, 0x0, 111, 1020, 299, 0, 0, -1 }, + { 0x0, 0x0, 111, 916, 2420, 0, 1, 1 }, + { 0x0, 0x0, 111, 1022, 309, 0, 0, -1 }, + { 0x0, 0x0, 111, 999, 372, 0, 0, -1 }, + { 0x0, 0x0, 111, -1, 380, 0, 0, -1 }, + { 0x0, 0x0, 111, 1156, 2427, 0, 1, 1 }, + { 0x0, 0x0, 111, -1, 322, 0, 0, -1 }, + { 0x0, 0x0, 111, 1027, 323, 0, 0, -1 }, + { 0x0, 0x0, 111, -1, 1916, 0, 0, -1 }, + { 0x1, 0x9, 111, -1, 2446, 33, 1, 54 }, + { 0x2, 0x3, 111, 1169, 1967, 27, 1, 49 }, + { 0x1, 0x1, 113, 1145, 2401, 37, 1, 1 }, + { 0x1, 0x1, 113, 1148, 2409, 37, 1, 1 }, + { 0x1, 0x1, 113, 1153, 2421, 37, 1, 1 }, + { 0x0, 0x0, 113, -1, 2432, 0, 1, 1 }, + { 0x0, 0x0, 114, 938, 2398, 0, 1, 1 }, + { 0x0, 0x0, 114, 991, 283, 0, 0, -1 }, + { 0x0, 0x0, 114, -1, 352, 0, 0, -1 }, + { 0x0, 0x0, 114, 1017, 354, 0, 0, -1 }, + { 0x0, 0x0, 114, -1, 2407, 0, 1, 1 }, + { 0x0, 0x0, 114, 1019, 296, 0, 0, -1 }, + { 0x0, 0x0, 114, 996, 301, 0, 0, -1 }, + { 0x0, 0x0, 114, 940, 2418, 0, 1, 1 }, + { 0x0, 0x0, 114, 998, 307, 0, 0, -1 }, + { 0x0, 0x0, 114, -1, 376, 0, 0, -1 }, + { 0x0, 0x0, 114, 1024, 378, 0, 0, -1 }, + { 0x0, 0x0, 114, -1, 2426, 0, 1, 1 }, + { 0x0, 0x0, 114, 1026, 320, 0, 0, -1 }, + { 0x0, 0x0, 114, 1003, 325, 0, 0, -1 }, + { 0x0, 0x0, 114, 911, 1914, 0, 0, -1 }, + { 0x0, 0x0, 114, 912, 2445, 0, 1, 54 }, + { 0x0, 0x0, 114, 913, 1966, 0, 1, 49 }, + { 0x1, 0x1, 114, -1, -1, 27, 1, 0 }, + { 0x1, 0x1, 114, -1, -1, 27, 1, 0 }, + { 0x1, 0x1, 114, -1, -1, 27, 1, 0 }, + { 0x1, 0x1, 115, -1, 2399, 37, 1, 1 }, + { 0x0, 0x0, 115, -1, 2412, 0, 1, 1 }, + { 0x1, 0x1, 115, -1, 2419, 37, 1, 1 }, + { 0x0, 0x0, 115, -1, 2431, 0, 1, 1 }, + { 0x0, 0x0, 116, 985, -1, 0, 1, 0 }, + { 0x0, 0x0, 116, 986, -1, 0, 1, 0 }, + { 0x0, 0x0, 116, 987, -1, 0, 1, 0 }, + { 0x3, 0x3, 116, 947, -1, 34, 1, 33 }, + { 0x3, 0x3, 116, 948, -1, 34, 1, 40 }, + { 0x1, 0x1, 117, -1, -1, 35, 1, 33 }, + { 0x1, 0x1, 117, -1, -1, 35, 1, 40 }, + { 0x0, 0x0, 118, -1, -1, 0, 1, 40 }, + { 0x0, 0x0, 118, -1, -1, 0, 1, 66 }, + { 0x1, 0x1, 118, -1, -1, 27, 1, 96 }, + { 0x0, 0x0, 118, -1, -1, 0, 1, 105 }, + { 0x0, 0x0, 118, -1, -1, 0, 1, 73 }, + { 0x0, 0x0, 118, -1, -1, 0, 1, 73 }, + { 0x0, 0x0, 118, -1, -1, 0, 1, 74 }, + { 0x0, 0x0, 118, -1, -1, 0, 1, 40 }, + { 0x1, 0x1, 118, -1, -1, 27, 1, 117 }, + { 0x1, 0x1, 118, -1, -1, 27, 1, 40 }, + { 0x0, 0x0, 118, -1, -1, 0, 1, 40 }, + { 0x0, 0x0, 119, -1, 2333, 0, 0, -1 }, + { 0x0, 0x0, 119, -1, 2336, 0, 0, -1 }, + { 0x1, 0x1, 120, -1, -1, 35, 1, 16 }, + { 0x1, 0x1, 120, -1, -1, 35, 1, 16 }, + { 0x1, 0x1, 120, -1, -1, 35, 1, 16 }, + { 0x1, 0x1, 120, -1, -1, 35, 1, 16 }, + { 0x1, 0x1, 120, -1, -1, 35, 1, 22 }, + { 0x1, 0x1, 120, -1, -1, 35, 1, 22 }, + { 0x1, 0x1, 120, -1, -1, 35, 1, 22 }, + { 0x1, 0x1, 120, -1, -1, 35, 1, 22 }, + { 0x1, 0x1, 120, -1, -1, 23, 1, 67 }, + { 0x1, 0x1, 120, -1, -1, 23, 1, 67 }, + { 0x1, 0x1, 120, -1, -1, 23, 1, 67 }, + { 0x1, 0x1, 120, -1, -1, 23, 1, 67 }, + { 0x1, 0x1, 120, 773, -1, 23, 1, 67 }, + { 0x9, 0x9, 120, 774, -1, 20, 1, 67 }, + { 0x0, 0x0, 124, 1816, -1, 0, 1, 0 }, + { 0x0, 0x0, 124, 1817, -1, 0, 1, 0 }, + { 0x1, 0x1, 124, -1, -1, 28, 1, 33 }, + { 0x1, 0x1, 124, -1, -1, 27, 1, 33 }, + { 0x1, 0x1, 124, -1, -1, 29, 1, 0 }, + { 0x1, 0x1, 124, -1, -1, 29, 1, 0 }, + { 0x1, 0x1, 124, -1, -1, 29, 1, 0 }, + { 0x1, 0x1, 124, -1, -1, 29, 1, 0 }, + { 0x0, 0x0, 124, -1, -1, 0, 1, 114 }, + { 0x1, 0x1, 124, -1, -1, 29, 1, 0 }, + { 0x1, 0x1, 124, -1, -1, 29, 1, 0 }, + { 0x1, 0x1, 124, -1, -1, 29, 1, 0 }, + { 0x0, 0x0, 124, 945, -1, 0, 1, 33 }, + { 0x0, 0x0, 124, 1037, -1, 0, 1, 40 }, + { 0x0, 0x0, 137, 1008, 2396, 0, 1, 1 }, + { 0x0, 0x0, 137, 898, 284, 0, 0, -1 }, + { 0x0, 0x0, 137, 920, 289, 0, 0, -1 }, + { 0x0, 0x0, 137, 921, 353, 0, 0, -1 }, + { 0x0, 0x0, 137, -1, 2406, 0, 1, 1 }, + { 0x0, 0x0, 137, 923, 295, 0, 0, -1 }, + { 0x0, 0x0, 137, -1, 302, 0, 0, -1 }, + { 0x0, 0x0, 137, 1010, 2416, 0, 1, 1 }, + { 0x0, 0x0, 137, 905, 308, 0, 0, -1 }, + { 0x0, 0x0, 137, 927, 313, 0, 0, -1 }, + { 0x0, 0x0, 137, 928, 377, 0, 0, -1 }, + { 0x0, 0x0, 137, -1, 2425, 0, 1, 1 }, + { 0x0, 0x0, 137, 930, 319, 0, 0, -1 }, + { 0x0, 0x0, 137, -1, 326, 0, 0, -1 }, + { 0x0, 0x0, 137, 2463, 1910, 0, 0, -1 }, + { 0x1, 0x1, 137, 2464, 2441, 33, 1, 54 }, + { 0x0, 0x0, 137, 2465, 1960, 0, 0, -1 }, + { 0x1, 0x1, 137, 2466, -1, 28, 1, 49 }, + { 0x1, 0x1, 138, -1, 2397, 37, 1, 1 }, + { 0x0, 0x0, 138, -1, 2411, 0, 1, 1 }, + { 0x1, 0x1, 138, -1, 2417, 37, 1, 1 }, + { 0x0, 0x0, 138, -1, 2430, 0, 1, 1 }, + { 0x1, 0x1, 141, 772, 967, 3, 1, 22 }, + { 0x0, 0x0, 142, 1818, -1, 0, 1, 33 }, + { 0x0, 0x0, 143, 778, 2393, 0, 1, 1 }, + { 0x0, 0x0, 143, -1, 286, 0, 0, -1 }, + { 0x0, 0x0, 143, 899, 287, 0, 0, -1 }, + { 0x0, 0x0, 143, 900, 355, 0, 0, -1 }, + { 0x0, 0x0, 143, 780, 2403, 0, 1, 1 }, + { 0x0, 0x0, 143, 902, 297, 0, 0, -1 }, + { 0x0, 0x0, 143, 924, 300, 0, 0, -1 }, + { 0x0, 0x0, 143, 784, 2413, 0, 1, 1 }, + { 0x0, 0x0, 143, -1, 310, 0, 0, -1 }, + { 0x0, 0x0, 143, 906, 311, 0, 0, -1 }, + { 0x0, 0x0, 143, 907, 379, 0, 0, -1 }, + { 0x0, 0x0, 143, 786, 2423, 0, 1, 1 }, + { 0x0, 0x0, 143, 909, 321, 0, 0, -1 }, + { 0x0, 0x0, 143, 931, 324, 0, 0, -1 }, + { 0x0, 0x0, 143, 1004, 1908, 0, 0, -1 }, + { 0x1, 0x1, 143, 1005, 2440, 36, 1, 54 }, + { 0x0, 0x0, 143, 1006, 1959, 0, 0, -1 }, + { 0x1, 0x1, 143, 1007, -1, 27, 1, 49 }, + { 0x1, 0x1, 144, -1, 2395, 37, 1, 1 }, + { 0x1, 0x1, 144, -1, 2405, 37, 1, 1 }, + { 0x1, 0x1, 144, -1, 2415, 37, 1, 1 }, + { 0x0, 0x0, 144, -1, 2429, 0, 1, 1 }, + { 0x0, 0x0, 145, -1, -1, 0, 1, 33 }, + { 0x0, 0x0, 145, 946, -1, 0, 1, 40 }, + { 0x0, 0x0, 146, -1, -1, 0, 1, 40 }, + { 0x0, 0x0, 146, -1, -1, 0, 1, 66 }, + { 0x0, 0x0, 146, -1, 2433, 0, 1, 63 }, + { 0x0, 0x0, 146, -1, -1, 0, 1, 81 }, + { 0x0, 0x0, 146, -1, -1, 0, 1, 81 }, + { 0x0, 0x0, 146, -1, -1, 0, 1, 85 }, + { 0x0, 0x0, 146, -1, -1, 0, 1, 40 }, + { 0x1, 0x1, 147, -1, 448, 12, 1, 6 }, + { 0x1, 0x1, 147, -1, 451, 12, 1, 6 }, + { 0x200001, 0x200001, 147, -1, 453, 12, 1, 6 }, + { 0x400001, 0x400001, 147, -1, 455, 12, 1, 6 }, + { 0x600001, 0x600001, 147, -1, 457, 12, 1, 6 }, + { 0x1, 0x1, 147, -1, 459, 12, 1, 6 }, + { 0x200001, 0x200001, 147, -1, 461, 12, 1, 6 }, + { 0x400001, 0x400001, 147, -1, 463, 12, 1, 6 }, + { 0x600001, 0x600001, 147, -1, 465, 12, 1, 6 }, + { 0x41, 0x41, 147, -1, 467, 6, 1, 7 }, + { 0x8000041, 0x8000041, 147, -1, 469, 6, 1, 7 }, + { 0x10000041, 0x10000041, 147, -1, 471, 6, 1, 7 }, + { 0x18000041, 0x18000041, 147, -1, 473, 6, 1, 7 }, + { 0x1, 0x1, 147, -1, 487, 12, 1, 8 }, + { 0x200001, 0x200001, 147, -1, 489, 12, 1, 8 }, + { 0x400001, 0x400001, 147, -1, 491, 12, 1, 8 }, + { 0x600001, 0x600001, 147, -1, 493, 12, 1, 8 }, + { 0x1, 0x1, 147, -1, 499, 12, 1, 15 }, + { 0x200001, 0x200001, 147, -1, 501, 12, 1, 15 }, + { 0x400001, 0x400001, 147, -1, 503, 12, 1, 15 }, + { 0x600001, 0x600001, 147, -1, 505, 12, 1, 15 }, + { 0x1, 0x1, 147, -1, 511, 12, 1, 17 }, + { 0x1, 0x1, 147, -1, 514, 12, 1, 17 }, + { 0x200001, 0x200001, 147, -1, 516, 12, 1, 17 }, + { 0x400001, 0x400001, 147, -1, 518, 12, 1, 17 }, + { 0x600001, 0x600001, 147, -1, 520, 12, 1, 17 }, + { 0x1, 0x1, 147, -1, 522, 12, 1, 17 }, + { 0x200001, 0x200001, 147, -1, 524, 12, 1, 17 }, + { 0x400001, 0x400001, 147, -1, 526, 12, 1, 17 }, + { 0x600001, 0x600001, 147, -1, 528, 12, 1, 17 }, + { 0x1, 0x1, 147, -1, 538, 12, 1, 18 }, + { 0x200001, 0x200001, 147, -1, 540, 12, 1, 18 }, + { 0x400001, 0x400001, 147, -1, 542, 12, 1, 18 }, + { 0x600001, 0x600001, 147, -1, 544, 12, 1, 18 }, + { 0x41, 0x41, 147, -1, 546, 6, 1, 18 }, + { 0x8000041, 0x8000041, 147, -1, 548, 6, 1, 18 }, + { 0x10000041, 0x10000041, 147, -1, 550, 6, 1, 18 }, + { 0x18000041, 0x18000041, 147, -1, 552, 6, 1, 18 }, + { 0x1, 0x1, 147, -1, 562, 12, 1, 19 }, + { 0x200001, 0x200001, 147, -1, 564, 12, 1, 19 }, + { 0x400001, 0x400001, 147, -1, 566, 12, 1, 19 }, + { 0x600001, 0x600001, 147, -1, 568, 12, 1, 19 }, + { 0x1, 0x1, 147, -1, 574, 12, 1, 20 }, + { 0x200001, 0x200001, 147, -1, 576, 12, 1, 20 }, + { 0x400001, 0x400001, 147, -1, 578, 12, 1, 20 }, + { 0x600001, 0x600001, 147, -1, 580, 12, 1, 20 }, + { 0x41, 0x41, 147, -1, 582, 6, 1, 20 }, + { 0x8000041, 0x8000041, 147, -1, 584, 6, 1, 20 }, + { 0x10000041, 0x10000041, 147, -1, 586, 6, 1, 20 }, + { 0x18000041, 0x18000041, 147, -1, 588, 6, 1, 20 }, + { 0x1, 0x1, 147, -1, 598, 12, 1, 21 }, + { 0x200001, 0x200001, 147, -1, 600, 12, 1, 21 }, + { 0x400001, 0x400001, 147, -1, 602, 12, 1, 21 }, + { 0x600001, 0x600001, 147, -1, 604, 12, 1, 21 }, + { 0x1, 0x1, 147, -1, 610, 12, 1, 17 }, + { 0x1, 0x1, 147, -1, 613, 12, 1, 17 }, + { 0x200001, 0x200001, 147, -1, 615, 12, 1, 17 }, + { 0x400001, 0x400001, 147, -1, 617, 12, 1, 17 }, + { 0x600001, 0x600001, 147, -1, 619, 12, 1, 17 }, + { 0x1, 0x1, 147, -1, 621, 12, 1, 17 }, + { 0x200001, 0x200001, 147, -1, 623, 12, 1, 17 }, + { 0x400001, 0x400001, 147, -1, 625, 12, 1, 17 }, + { 0x600001, 0x600001, 147, -1, 627, 12, 1, 17 }, + { 0x1, 0x1, 147, -1, 637, 12, 1, 21 }, + { 0x200001, 0x200001, 147, -1, 639, 12, 1, 21 }, + { 0x400001, 0x400001, 147, -1, 641, 12, 1, 21 }, + { 0x600001, 0x600001, 147, -1, 643, 12, 1, 21 }, + { 0x0, 0x0, 156, 648, -1, 0, 1, 75 }, + { 0x0, 0x0, 156, 649, -1, 0, 1, 75 }, + { 0x9, 0x9, 156, -1, 1202, 32, 1, 129 }, + { 0x9, 0x9, 156, -1, 1211, 32, 1, 129 }, + { 0x9, 0x9, 156, -1, 1220, 32, 1, 129 }, + { 0x9, 0x9, 156, -1, 1229, 32, 1, 129 }, + { 0x9, 0x9, 156, -1, 1238, 32, 1, 129 }, + { 0x9, 0x9, 156, -1, 1247, 32, 1, 129 }, + { 0x9, 0x9, 156, -1, 1256, 32, 1, 129 }, + { 0x9, 0x9, 156, -1, 1265, 32, 1, 129 }, + { 0x9, 0x9, 156, -1, 1274, 32, 1, 129 }, + { 0x9, 0x9, 156, -1, 1284, 32, 1, 129 }, + { 0x9, 0x9, 156, -1, 1294, 32, 1, 129 }, + { 0x9, 0x9, 156, -1, 1304, 32, 1, 129 }, + { 0x9, 0x9, 156, -1, 1313, 32, 1, 141 }, + { 0x9, 0x9, 156, -1, 1319, 32, 1, 141 }, + { 0x9, 0x9, 156, -1, 1325, 32, 1, 141 }, + { 0x9, 0x9, 156, -1, 1331, 32, 1, 141 }, + { 0x9, 0x9, 156, -1, 1337, 32, 1, 141 }, + { 0x9, 0x9, 156, -1, 1343, 32, 1, 141 }, + { 0x9, 0x9, 156, -1, 1349, 32, 1, 141 }, + { 0x9, 0x9, 156, -1, 1355, 32, 1, 141 }, + { 0x9, 0x9, 156, -1, 1361, 32, 1, 141 }, + { 0x9, 0x9, 156, -1, 1367, 32, 1, 141 }, + { 0x9, 0x9, 156, -1, 1373, 32, 1, 141 }, + { 0x9, 0x9, 156, -1, 1379, 32, 1, 141 }, + { 0x9, 0x9, 156, -1, 1385, 32, 1, 141 }, + { 0x9, 0x9, 156, -1, 1391, 32, 1, 141 }, + { 0x9, 0x9, 156, -1, 1397, 32, 1, 141 }, + { 0x9, 0x9, 156, -1, 1403, 32, 1, 141 }, + { 0x9, 0x9, 156, -1, 1409, 32, 1, 141 }, + { 0x9, 0x9, 156, -1, 1415, 32, 1, 141 }, + { 0x0, 0x0, 157, 1032, 282, 0, 0, -1 }, + { 0x1, 0x1, 157, -1, 2402, 38, 1, 1 }, + { 0x0, 0x0, 157, 779, 339, 0, 0, -1 }, + { 0x0, 0x0, 157, 1033, 292, 0, 0, -1 }, + { 0x1, 0x1, 157, -1, 2410, 38, 1, 1 }, + { 0x0, 0x0, 157, 781, 359, 0, 0, -1 }, + { 0x0, 0x0, 157, 782, 293, 0, 0, -1 }, + { 0x0, 0x0, 157, 783, 303, 0, 0, -1 }, + { 0x0, 0x0, 157, 1034, 306, 0, 0, -1 }, + { 0x1, 0x1, 157, -1, 2422, 38, 1, 1 }, + { 0x0, 0x0, 157, 785, 363, 0, 0, -1 }, + { 0x0, 0x0, 157, -1, 316, 0, 0, -1 }, + { 0x1, 0x1, 157, -1, 2428, 38, 1, 1 }, + { 0x0, 0x0, 157, 787, 383, 0, 0, -1 }, + { 0x0, 0x0, 157, 788, 317, 0, 0, -1 }, + { 0x0, 0x0, 157, 789, 327, 0, 0, -1 }, + { 0x0, 0x0, 158, 1175, 1918, 0, 0, -1 }, + { 0x0, 0x0, 158, 1176, 2451, 0, 1, 54 }, + { 0x0, 0x0, 158, 1177, 1962, 0, 0, -1 }, + { 0x1, 0x1, 158, 1178, -1, 29, 1, 49 }, + { 0x0, 0x0, 159, -1, 1928, 0, 0, -1 }, + { 0x1, 0x9, 159, -1, 2458, 33, 1, 54 }, + { 0x6, 0x7, 159, -1, 1969, 27, 1, 49 }, + { 0x0, 0x0, 160, 1164, 1926, 0, 0, -1 }, + { 0x0, 0x0, 160, 1165, 2457, 0, 1, 54 }, + { 0x1, 0x1, 160, 1166, 1968, 29, 1, 49 }, + { 0x1, 0x1, 161, 1180, -1, 27, 1, 33 }, + { 0x0, 0x0, 162, 1811, 1922, 0, 0, -1 }, + { 0x1, 0x1, 162, 1812, 2453, 33, 1, 54 }, + { 0x0, 0x0, 162, 1813, 1964, 0, 0, -1 }, + { 0x3, 0x3, 162, 1814, -1, 28, 1, 49 }, + { 0x0, 0x0, 163, 1171, 1920, 0, 0, -1 }, + { 0x1, 0x1, 163, 1172, 2452, 36, 1, 54 }, + { 0x0, 0x0, 163, 1173, 1963, 0, 0, -1 }, + { 0x5, 0x5, 163, 1174, -1, 27, 1, 49 }, + { 0x0, 0x0, 164, -1, 2434, 0, 1, 63 }, + { 0x1, 0x1, 166, -1, -1, 28, 1, 33 }, + { 0x1, 0x1, 167, 2292, -1, 27, 1, 33 }, + { 0x1, 0x1, 167, 2293, -1, 27, 1, 33 }, + { 0x1, 0x1, 168, 1445, -1, 28, 1, 132 }, + { 0x1, 0x1, 168, 1446, -1, 28, 1, 132 }, + { 0x1, 0x1, 168, 1447, -1, 28, 1, 132 }, + { 0x1, 0x1, 168, 1448, -1, 28, 1, 132 }, + { 0x1, 0x1, 168, 1449, -1, 28, 1, 132 }, + { 0x1, 0x1, 168, 1450, -1, 28, 1, 132 }, + { 0x1, 0x1, 168, 1451, -1, 28, 1, 132 }, + { 0x1, 0x1, 168, 1452, -1, 28, 1, 132 }, + { 0x1, 0x1, 168, 1453, -1, 28, 1, 133 }, + { 0x1, 0x1, 168, 1454, -1, 28, 1, 133 }, + { 0x1, 0x1, 168, 1455, -1, 28, 1, 133 }, + { 0x1, 0x1, 168, 1456, -1, 28, 1, 133 }, + { 0x1, 0x1, 168, 1457, -1, 28, 1, 125 }, + { 0x1, 0x1, 168, 1458, -1, 28, 1, 126 }, + { 0x1, 0x1, 168, 1459, -1, 28, 1, 127 }, + { 0x1, 0x1, 168, 1460, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1461, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1462, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1463, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1464, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1465, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1466, -1, 28, 1, 125 }, + { 0x1, 0x1, 168, 1467, -1, 28, 1, 126 }, + { 0x1, 0x1, 168, 1468, -1, 28, 1, 127 }, + { 0x1, 0x1, 168, 1469, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1470, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1471, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1472, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1473, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1474, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1475, -1, 28, 1, 125 }, + { 0x1, 0x1, 168, 1476, -1, 28, 1, 126 }, + { 0x1, 0x1, 168, 1477, -1, 28, 1, 127 }, + { 0x1, 0x1, 168, 1478, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1479, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1480, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1481, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1482, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1483, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1484, -1, 28, 1, 125 }, + { 0x1, 0x1, 168, 1485, -1, 28, 1, 126 }, + { 0x1, 0x1, 168, 1486, -1, 28, 1, 127 }, + { 0x1, 0x1, 168, 1487, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1488, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1489, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1490, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1491, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1492, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1493, -1, 28, 1, 125 }, + { 0x1, 0x1, 168, 1494, -1, 28, 1, 126 }, + { 0x1, 0x1, 168, 1495, -1, 28, 1, 127 }, + { 0x1, 0x1, 168, 1496, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1497, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1498, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1499, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1500, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1501, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1502, -1, 28, 1, 125 }, + { 0x1, 0x1, 168, 1503, -1, 28, 1, 126 }, + { 0x1, 0x1, 168, 1504, -1, 28, 1, 127 }, + { 0x1, 0x1, 168, 1505, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1506, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1507, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1508, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1509, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1510, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1511, -1, 28, 1, 125 }, + { 0x1, 0x1, 168, 1512, -1, 28, 1, 126 }, + { 0x1, 0x1, 168, 1513, -1, 28, 1, 127 }, + { 0x1, 0x1, 168, 1514, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1515, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1516, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1517, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1518, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1519, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1520, -1, 28, 1, 125 }, + { 0x1, 0x1, 168, 1521, -1, 28, 1, 126 }, + { 0x1, 0x1, 168, 1522, -1, 28, 1, 127 }, + { 0x1, 0x1, 168, 1523, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1524, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1525, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1526, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1527, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1528, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1529, -1, 28, 1, 125 }, + { 0x1, 0x1, 168, 1530, -1, 28, 1, 126 }, + { 0x1, 0x1, 168, 1531, -1, 28, 1, 127 }, + { 0x1, 0x1, 168, 1532, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1533, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1534, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1535, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1536, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1537, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1538, -1, 28, 1, 125 }, + { 0x1, 0x1, 168, 1539, -1, 28, 1, 126 }, + { 0x1, 0x1, 168, 1540, -1, 28, 1, 127 }, + { 0x1, 0x1, 168, 1541, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1542, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1543, -1, 28, 1, 128 }, + { 0x1, 0x1, 168, 1544, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1545, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1546, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1547, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1548, -1, 28, 1, 125 }, + { 0x1, 0x1, 168, 1549, -1, 28, 1, 126 }, + { 0x1, 0x1, 168, 1550, -1, 28, 1, 127 }, + { 0x1, 0x1, 168, 1551, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1552, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1553, -1, 28, 1, 128 }, + { 0x1, 0x1, 168, 1554, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1555, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1556, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1557, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1558, -1, 28, 1, 125 }, + { 0x1, 0x1, 168, 1559, -1, 28, 1, 126 }, + { 0x1, 0x1, 168, 1560, -1, 28, 1, 127 }, + { 0x1, 0x1, 168, 1561, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1562, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1563, -1, 28, 1, 128 }, + { 0x1, 0x1, 168, 1564, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1565, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1566, -1, 28, 1, 129 }, + { 0x1, 0x1, 168, 1567, -1, 28, 1, 124 }, + { 0x1, 0x1, 168, 1568, -1, 28, 1, 137 }, + { 0x1, 0x1, 168, 1569, -1, 28, 1, 137 }, + { 0x1, 0x1, 168, 1570, -1, 28, 1, 137 }, + { 0x1, 0x1, 168, 1571, -1, 28, 1, 138 }, + { 0x1, 0x1, 168, 1572, -1, 28, 1, 139 }, + { 0x1, 0x1, 168, 1573, -1, 28, 1, 140 }, + { 0x1, 0x1, 168, 1574, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1575, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1576, -1, 28, 1, 137 }, + { 0x1, 0x1, 168, 1577, -1, 28, 1, 138 }, + { 0x1, 0x1, 168, 1578, -1, 28, 1, 139 }, + { 0x1, 0x1, 168, 1579, -1, 28, 1, 140 }, + { 0x1, 0x1, 168, 1580, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1581, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1582, -1, 28, 1, 137 }, + { 0x1, 0x1, 168, 1583, -1, 28, 1, 138 }, + { 0x1, 0x1, 168, 1584, -1, 28, 1, 139 }, + { 0x1, 0x1, 168, 1585, -1, 28, 1, 140 }, + { 0x1, 0x1, 168, 1586, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1587, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1588, -1, 28, 1, 137 }, + { 0x1, 0x1, 168, 1589, -1, 28, 1, 138 }, + { 0x1, 0x1, 168, 1590, -1, 28, 1, 139 }, + { 0x1, 0x1, 168, 1591, -1, 28, 1, 140 }, + { 0x1, 0x1, 168, 1592, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1593, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1594, -1, 28, 1, 137 }, + { 0x1, 0x1, 168, 1595, -1, 28, 1, 138 }, + { 0x1, 0x1, 168, 1596, -1, 28, 1, 139 }, + { 0x1, 0x1, 168, 1597, -1, 28, 1, 140 }, + { 0x1, 0x1, 168, 1598, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1599, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1600, -1, 28, 1, 137 }, + { 0x1, 0x1, 168, 1601, -1, 28, 1, 138 }, + { 0x1, 0x1, 168, 1602, -1, 28, 1, 139 }, + { 0x1, 0x1, 168, 1603, -1, 28, 1, 140 }, + { 0x1, 0x1, 168, 1604, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1605, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1606, -1, 28, 1, 137 }, + { 0x1, 0x1, 168, 1607, -1, 28, 1, 138 }, + { 0x1, 0x1, 168, 1608, -1, 28, 1, 139 }, + { 0x1, 0x1, 168, 1609, -1, 28, 1, 140 }, + { 0x1, 0x1, 168, 1610, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1611, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1612, -1, 28, 1, 137 }, + { 0x1, 0x1, 168, 1613, -1, 28, 1, 138 }, + { 0x1, 0x1, 168, 1614, -1, 28, 1, 139 }, + { 0x1, 0x1, 168, 1615, -1, 28, 1, 140 }, + { 0x1, 0x1, 168, 1616, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1617, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1618, -1, 28, 1, 137 }, + { 0x1, 0x1, 168, 1619, -1, 28, 1, 138 }, + { 0x1, 0x1, 168, 1620, -1, 28, 1, 139 }, + { 0x1, 0x1, 168, 1621, -1, 28, 1, 140 }, + { 0x1, 0x1, 168, 1622, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1623, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1624, -1, 28, 1, 137 }, + { 0x1, 0x1, 168, 1625, -1, 28, 1, 138 }, + { 0x1, 0x1, 168, 1626, -1, 28, 1, 139 }, + { 0x1, 0x1, 168, 1627, -1, 28, 1, 140 }, + { 0x1, 0x1, 168, 1628, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1629, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1630, -1, 28, 1, 137 }, + { 0x1, 0x1, 168, 1631, -1, 28, 1, 138 }, + { 0x1, 0x1, 168, 1632, -1, 28, 1, 139 }, + { 0x1, 0x1, 168, 1633, -1, 28, 1, 140 }, + { 0x1, 0x1, 168, 1634, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1635, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1636, -1, 28, 1, 137 }, + { 0x1, 0x1, 168, 1637, -1, 28, 1, 138 }, + { 0x1, 0x1, 168, 1638, -1, 28, 1, 139 }, + { 0x1, 0x1, 168, 1639, -1, 28, 1, 140 }, + { 0x1, 0x1, 168, 1640, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1641, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1642, -1, 28, 1, 137 }, + { 0x1, 0x1, 168, 1643, -1, 28, 1, 138 }, + { 0x1, 0x1, 168, 1644, -1, 28, 1, 139 }, + { 0x1, 0x1, 168, 1645, -1, 28, 1, 140 }, + { 0x1, 0x1, 168, 1646, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1647, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1648, -1, 28, 1, 137 }, + { 0x1, 0x1, 168, 1649, -1, 28, 1, 138 }, + { 0x1, 0x1, 168, 1650, -1, 28, 1, 139 }, + { 0x1, 0x1, 168, 1651, -1, 28, 1, 140 }, + { 0x1, 0x1, 168, 1652, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1653, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1654, -1, 28, 1, 137 }, + { 0x1, 0x1, 168, 1655, -1, 28, 1, 138 }, + { 0x1, 0x1, 168, 1656, -1, 28, 1, 139 }, + { 0x1, 0x1, 168, 1657, -1, 28, 1, 140 }, + { 0x1, 0x1, 168, 1658, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1659, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1660, -1, 28, 1, 137 }, + { 0x1, 0x1, 168, 1661, -1, 28, 1, 138 }, + { 0x1, 0x1, 168, 1662, -1, 28, 1, 139 }, + { 0x1, 0x1, 168, 1663, -1, 28, 1, 140 }, + { 0x1, 0x1, 168, 1664, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1665, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1666, -1, 28, 1, 137 }, + { 0x1, 0x1, 168, 1667, -1, 28, 1, 138 }, + { 0x1, 0x1, 168, 1668, -1, 28, 1, 139 }, + { 0x1, 0x1, 168, 1669, -1, 28, 1, 140 }, + { 0x1, 0x1, 168, 1670, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1671, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1672, -1, 28, 1, 137 }, + { 0x1, 0x1, 168, 1673, -1, 28, 1, 138 }, + { 0x1, 0x1, 168, 1674, -1, 28, 1, 139 }, + { 0x1, 0x1, 168, 1675, -1, 28, 1, 140 }, + { 0x1, 0x1, 168, 1676, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1677, -1, 28, 1, 141 }, + { 0x1, 0x1, 168, 1678, -1, 28, 1, 137 }, + { 0x1, 0x1, 168, 1433, -1, 28, 1, 142 }, + { 0x1, 0x1, 168, 1434, -1, 28, 1, 143 }, + { 0x1, 0x1, 168, 1435, -1, 28, 1, 143 }, + { 0x1, 0x1, 168, 1436, -1, 28, 1, 142 }, + { 0x1, 0x1, 168, 1437, -1, 28, 1, 144 }, + { 0x1, 0x1, 168, 1438, -1, 28, 1, 145 }, + { 0x1, 0x1, 168, 1439, -1, 28, 1, 145 }, + { 0x1, 0x1, 168, 1440, -1, 28, 1, 144 }, + { 0x1, 0x1, 168, 1441, -1, 28, 1, 144 }, + { 0x1, 0x1, 168, 1442, -1, 28, 1, 145 }, + { 0x1, 0x1, 168, 1443, -1, 28, 1, 145 }, + { 0x1, 0x1, 168, 1444, -1, 28, 1, 144 }, + { 0x1, 0x1, 168, 1719, -1, 28, 1, 133 }, + { 0x1, 0x1, 168, 1720, -1, 28, 1, 133 }, + { 0x1, 0x1, 168, 1721, -1, 28, 1, 133 }, + { 0x1, 0x1, 168, 1722, -1, 28, 1, 133 }, + { 0x1, 0x1, 169, 1679, -1, 29, 1, 142 }, + { 0x1, 0x1, 169, 1680, -1, 29, 1, 143 }, + { 0x1, 0x1, 169, 1681, -1, 29, 1, 143 }, + { 0x1, 0x1, 169, 1682, -1, 29, 1, 142 }, + { 0x1, 0x1, 169, 1683, -1, 29, 1, 144 }, + { 0x1, 0x1, 169, 1684, -1, 29, 1, 145 }, + { 0x1, 0x1, 169, 1685, -1, 29, 1, 145 }, + { 0x1, 0x1, 169, 1686, -1, 29, 1, 144 }, + { 0x1, 0x1, 169, 1687, -1, 29, 1, 144 }, + { 0x1, 0x1, 169, 1688, -1, 29, 1, 145 }, + { 0x1, 0x1, 169, 1689, -1, 29, 1, 145 }, + { 0x1, 0x1, 169, 1690, -1, 29, 1, 144 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 132 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 132 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 132 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 132 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 132 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 132 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 132 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 132 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 133 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 133 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 133 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 133 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 125 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 126 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 127 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 257, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 1867, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 125 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 126 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 127 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 259, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 1868, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 125 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 126 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 127 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 261, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 1869, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 125 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 126 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 127 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 263, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 1870, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 125 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 126 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 127 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 265, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 1871, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 125 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 126 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 127 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 267, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 1872, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 125 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 126 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 127 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 269, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 1873, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 125 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 126 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 127 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 271, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 1874, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 125 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 126 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 127 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 273, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 1875, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 125 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 126 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 127 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 128 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 275, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 1876, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 125 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 126 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 127 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 128 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 277, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 1877, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 125 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 126 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 127 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 128 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 279, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 129 }, + { 0x3, 0x3, 170, 1878, -1, 28, 1, 124 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 137 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 137 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 137 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 138 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 139 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 140 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, 1879, -1, 28, 1, 137 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 138 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 139 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 140 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, 1880, -1, 28, 1, 137 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 138 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 139 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 140 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, 1881, -1, 28, 1, 137 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 138 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 139 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 140 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, 1882, -1, 28, 1, 137 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 138 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 139 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 140 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, 1883, -1, 28, 1, 137 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 138 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 139 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 140 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, 1884, -1, 28, 1, 137 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 138 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 139 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 140 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, 1885, -1, 28, 1, 137 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 138 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 139 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 140 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, 1886, -1, 28, 1, 137 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 138 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 139 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 140 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, 1887, -1, 28, 1, 137 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 138 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 139 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 140 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, 1888, -1, 28, 1, 137 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 138 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 139 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 140 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, 1889, -1, 28, 1, 137 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 138 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 139 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 140 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, 1890, -1, 28, 1, 137 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 138 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 139 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 140 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, 1891, -1, 28, 1, 137 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 138 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 139 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 140 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, 1892, -1, 28, 1, 137 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 138 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 139 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 140 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, 1893, -1, 28, 1, 137 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 138 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 139 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 140 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, 1894, -1, 28, 1, 137 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 138 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 139 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 140 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, 1895, -1, 28, 1, 137 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 138 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 139 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 140 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 141 }, + { 0x3, 0x3, 170, 1896, -1, 28, 1, 137 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 142 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 143 }, + { 0x3, 0x3, 170, 797, -1, 28, 1, 143 }, + { 0x3, 0x3, 170, 798, -1, 28, 1, 142 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 144 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 145 }, + { 0x3, 0x3, 170, 799, -1, 28, 1, 145 }, + { 0x3, 0x3, 170, 800, -1, 28, 1, 144 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 144 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 145 }, + { 0x3, 0x3, 170, 801, -1, 28, 1, 145 }, + { 0x3, 0x3, 170, 802, -1, 28, 1, 144 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 130 }, + { 0x3, 0x3, 170, 1835, -1, 28, 1, 130 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 135 }, + { 0x3, 0x3, 170, 1836, -1, 28, 1, 135 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 130 }, + { 0x3, 0x3, 170, 1837, -1, 28, 1, 130 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 135 }, + { 0x3, 0x3, 170, 1838, -1, 28, 1, 135 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 130 }, + { 0x3, 0x3, 170, 1839, -1, 28, 1, 130 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 135 }, + { 0x3, 0x3, 170, 1840, -1, 28, 1, 135 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 130 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 131 }, + { 0x3, 0x3, 170, 1841, -1, 28, 1, 130 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 135 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 136 }, + { 0x3, 0x3, 170, 1842, -1, 28, 1, 135 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 130 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 130 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 130 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 130 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 130 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 130 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 130 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 130 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 130 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 130 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 133 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 133 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 133 }, + { 0x3, 0x3, 170, -1, -1, 28, 1, 133 }, + { 0x0, 0x0, 171, -1, 330, 0, 0, -1 }, + { 0x0, 0x0, 171, 2490, 2460, 0, 1, 1 }, + { 0x0, 0x0, 171, -1, 334, 0, 0, -1 }, + { 0x0, 0x0, 171, 2492, 2462, 0, 1, 1 }, + { 0x11, 0x31, 172, 2394, 337, 33, 1, 4 }, + { 0x2200001, 0x2200001, 172, -1, 338, 12, 1, 4 }, + { 0x1, 0x1, 172, -1, 341, 37, 1, 4 }, + { 0x2000001, 0x2000001, 172, -1, 342, 12, 1, 4 }, + { 0x11, 0x11, 172, -1, 343, 33, 1, 4 }, + { 0x2200001, 0x2200001, 172, -1, 344, 12, 1, 4 }, + { 0x1, 0x1, 172, 1757, 345, 37, 1, 4 }, + { 0x2000001, 0x2000001, 172, -1, 347, 12, 1, 4 }, + { 0x11, 0x11, 172, 1759, 349, 33, 1, 4 }, + { 0x2200001, 0x2200001, 172, -1, 351, 12, 1, 4 }, + { 0x11, 0x31, 172, 2404, 357, 33, 1, 4 }, + { 0x2200001, 0x2200001, 172, -1, 358, 12, 1, 4 }, + { 0x11, 0x31, 172, 2414, 361, 33, 1, 4 }, + { 0x2200001, 0x2200001, 172, -1, 362, 12, 1, 4 }, + { 0x1, 0x1, 172, -1, 365, 37, 1, 4 }, + { 0x2000001, 0x2000001, 172, -1, 366, 12, 1, 4 }, + { 0x11, 0x11, 172, -1, 367, 33, 1, 4 }, + { 0x2200001, 0x2200001, 172, -1, 368, 12, 1, 4 }, + { 0x1, 0x1, 172, 1781, 369, 37, 1, 4 }, + { 0x2000001, 0x2000001, 172, -1, 371, 12, 1, 4 }, + { 0x11, 0x11, 172, 1783, 373, 33, 1, 4 }, + { 0x2200001, 0x2200001, 172, -1, 375, 12, 1, 4 }, + { 0x11, 0x31, 172, 2424, 381, 33, 1, 4 }, + { 0x2200001, 0x2200001, 172, -1, 382, 12, 1, 4 }, + { 0x1, 0x1, 172, -1, 385, 33, 1, 4 }, + { 0x200001, 0x200001, 172, -1, 386, 12, 1, 4 }, + { 0x1, 0x1, 172, -1, 389, 33, 1, 4 }, + { 0x200001, 0x200001, 172, -1, 390, 12, 1, 4 }, + { 0x1, 0x1, 173, -1, -1, 37, 1, 4 }, + { 0x2000001, 0x2000001, 173, -1, -1, 12, 1, 4 }, + { 0x2000001, 0x2000001, 173, -1, -1, 12, 1, 4 }, + { 0x1, 0x1, 173, 1734, -1, 37, 1, 4 }, + { 0x2200001, 0x2200001, 173, -1, -1, 12, 1, 4 }, + { 0x11, 0x11, 173, 1736, -1, 33, 1, 4 }, + { 0x1, 0x1, 173, -1, -1, 37, 1, 4 }, + { 0x2000001, 0x2000001, 173, -1, -1, 12, 1, 4 }, + { 0x11, 0x11, 173, -1, -1, 33, 1, 4 }, + { 0x2200001, 0x2200001, 173, -1, -1, 12, 1, 4 }, + { 0x1, 0x1, 173, -1, -1, 37, 1, 4 }, + { 0x2000001, 0x2000001, 173, -1, -1, 12, 1, 4 }, + { 0x0, 0x0, 173, -1, -1, 0, 1, 5 }, + { 0x1, 0x1, 173, -1, -1, 12, 1, 5 }, + { 0x0, 0x0, 173, -1, -1, 0, 1, 5 }, + { 0x1, 0x1, 173, -1, -1, 12, 1, 5 }, + { 0x1, 0x1, 173, -1, -1, 33, 1, 5 }, + { 0x200001, 0x200001, 173, -1, -1, 12, 1, 5 }, + { 0x0, 0x0, 173, -1, -1, 0, 1, 5 }, + { 0x1, 0x1, 173, -1, -1, 12, 1, 5 }, + { 0x1, 0x1, 173, -1, -1, 33, 1, 5 }, + { 0x200001, 0x200001, 173, -1, -1, 12, 1, 5 }, + { 0x0, 0x0, 173, -1, -1, 0, 1, 5 }, + { 0x1, 0x1, 173, -1, -1, 12, 1, 5 }, + { 0x1, 0x1, 173, -1, -1, 37, 1, 4 }, + { 0x2000001, 0x2000001, 173, -1, -1, 12, 1, 4 }, + { 0x2000001, 0x2000001, 173, -1, -1, 12, 1, 4 }, + { 0x1, 0x1, 173, 1746, -1, 37, 1, 4 }, + { 0x2200001, 0x2200001, 173, -1, -1, 12, 1, 4 }, + { 0x11, 0x11, 173, 1748, -1, 33, 1, 4 }, + { 0x1, 0x1, 173, -1, -1, 37, 1, 4 }, + { 0x2000001, 0x2000001, 173, -1, -1, 12, 1, 4 }, + { 0x11, 0x11, 173, -1, -1, 33, 1, 4 }, + { 0x2200001, 0x2200001, 173, -1, -1, 12, 1, 4 }, + { 0x1, 0x1, 173, -1, -1, 37, 1, 4 }, + { 0x2000001, 0x2000001, 173, -1, -1, 12, 1, 4 }, + { 0x0, 0x0, 173, -1, -1, 0, 1, 5 }, + { 0x1, 0x1, 173, -1, -1, 12, 1, 5 }, + { 0x0, 0x0, 173, -1, -1, 0, 1, 5 }, + { 0x1, 0x1, 173, -1, -1, 12, 1, 5 }, + { 0x1, 0x1, 173, -1, -1, 33, 1, 5 }, + { 0x200001, 0x200001, 173, -1, -1, 12, 1, 5 }, + { 0x0, 0x0, 173, -1, -1, 0, 1, 5 }, + { 0x1, 0x1, 173, -1, -1, 12, 1, 5 }, + { 0x1, 0x1, 173, -1, -1, 33, 1, 5 }, + { 0x200001, 0x200001, 173, -1, -1, 12, 1, 5 }, + { 0x0, 0x0, 173, -1, -1, 0, 1, 5 }, + { 0x1, 0x1, 173, -1, -1, 12, 1, 5 }, + { 0x9, 0x9, 173, -1, -1, 33, 1, 5 }, + { 0x1, 0x1, 173, 331, -1, 33, 1, 4 }, + { 0x1200001, 0x1200001, 173, -1, -1, 12, 1, 5 }, + { 0x200001, 0x200001, 173, 332, -1, 12, 1, 4 }, + { 0x9, 0x9, 173, -1, -1, 33, 1, 5 }, + { 0x1, 0x1, 173, 335, -1, 33, 1, 4 }, + { 0x1200001, 0x1200001, 173, -1, -1, 12, 1, 5 }, + { 0x200001, 0x200001, 173, 336, -1, 12, 1, 4 }, + { 0x0, 0x0, 174, -1, 1924, 0, 0, -1 }, + { 0x9, 0x9, 174, -1, 2454, 33, 1, 49 }, + { 0x0, 0x0, 174, -1, 1965, 0, 0, -1 }, + { 0x7, 0x7, 174, -1, -1, 27, 1, 49 }, + { 0x1, 0x1, 194, -1, -1, 27, 1, 10 }, + { 0x1, 0x1, 208, -1, -1, 29, 1, 0 }, + { 0x1, 0x1, 208, -1, -1, 29, 1, 0 }, + { 0x2, 0x3, 208, 978, -1, 27, 1, 33 }, + { 0x0, 0x0, 208, 979, -1, 0, 1, 33 }, + { 0x0, 0x0, 208, 980, -1, 0, 1, 0 }, + { 0x0, 0x0, 208, 981, -1, 0, 1, 0 }, + { 0x0, 0x0, 208, 982, -1, 0, 1, 0 }, + { 0x0, 0x0, 208, 983, -1, 0, 1, 0 }, + { 0x0, 0x0, 208, 2476, -1, 0, 1, 93 }, + { 0x0, 0x0, 208, 2477, -1, 0, 1, 93 }, + { 0x0, 0x0, 208, 2478, 812, 0, 0, -1 }, + { 0x1, 0x1, 209, -1, -1, 27, 1, 0 }, + { 0x1, 0x1, 209, -1, -1, 27, 1, 0 }, + { 0x1, 0x1, 210, -1, 1184, 32, 1, 132 }, + { 0x1, 0x1, 210, -1, 1186, 32, 1, 132 }, + { 0x1, 0x1, 210, -1, 1188, 32, 1, 132 }, + { 0x1, 0x1, 210, -1, 1190, 32, 1, 132 }, + { 0x1, 0x1, 210, -1, 1192, 32, 1, 133 }, + { 0x1, 0x1, 210, -1, 1194, 32, 1, 133 }, + { 0x1, 0x1, 210, -1, 1691, 32, 1, 130 }, + { 0x1, 0x1, 210, -1, 1693, 32, 1, 135 }, + { 0x1, 0x1, 210, -1, 1695, 32, 1, 130 }, + { 0x1, 0x1, 210, -1, 1697, 32, 1, 135 }, + { 0x1, 0x1, 210, -1, 1699, 32, 1, 130 }, + { 0x1, 0x1, 210, -1, 1701, 32, 1, 135 }, + { 0x1, 0x1, 210, 2296, 1703, 32, 1, 130 }, + { 0x1, 0x1, 210, 2297, 1706, 32, 1, 135 }, + { 0x0, 0x0, 211, -1, 2338, 0, 0, -1 }, + { 0x0, 0x0, 211, -1, 2339, 0, 0, -1 }, + { 0x0, 0x0, 211, -1, 2364, 0, 0, -1 }, + { 0x5, 0x5, 211, -1, 2367, 20, 1, 67 }, + { 0x0, 0x0, 215, 1826, 811, 0, 0, -1 }, + { 0x0, 0x0, 216, -1, 950, 0, 0, -1 }, + { 0x0, 0x0, 216, -1, 1039, 0, 0, -1 }, + { 0x0, 0x0, 216, -1, -1, 0, 1, 121 }, + { 0x0, 0x0, 216, -1, -1, 0, 1, 66 }, + { 0x1, 0x1, 216, 688, 1898, 36, 1, 65 }, + { 0x1, 0x1, 216, 689, 1933, 36, 1, 65 }, + { 0x0, 0x0, 216, 690, 1936, 0, 0, -1 }, + { 0x1, 0x1, 216, 691, -1, 36, 1, 65 }, + { 0x0, 0x0, 216, 1181, -1, 0, 1, 33 }, + { 0x1, 0x1, 216, 692, 1941, 36, 1, 65 }, + { 0x0, 0x0, 216, 693, 1944, 0, 0, -1 }, + { 0x1, 0x1, 216, 694, -1, 36, 1, 65 }, + { 0x0, 0x0, 216, 695, 1947, 0, 0, -1 }, + { 0x1, 0x1, 216, 696, -1, 36, 1, 65 }, + { 0x1, 0x1, 216, 697, 1950, 36, 1, 65 }, + { 0x1, 0x1, 216, 698, 1953, 36, 1, 65 }, + { 0x0, 0x0, 216, 1182, -1, 0, 1, 33 }, + { 0x1, 0x1, 216, 699, 1986, 36, 1, 65 }, + { 0x1, 0x1, 216, 700, -1, 31, 1, 134 }, + { 0x1, 0x1, 216, 220, 1195, 32, 1, 125 }, + { 0x1, 0x1, 216, 221, 1204, 32, 1, 125 }, + { 0x1, 0x1, 216, 222, 1213, 32, 1, 125 }, + { 0x1, 0x1, 216, 223, 1222, 32, 1, 125 }, + { 0x1, 0x1, 216, 224, 1231, 32, 1, 125 }, + { 0x1, 0x1, 216, 225, 1240, 32, 1, 125 }, + { 0x1, 0x1, 216, 226, 1249, 32, 1, 125 }, + { 0x1, 0x1, 216, 227, 1258, 32, 1, 125 }, + { 0x1, 0x1, 216, 228, 1267, 32, 1, 125 }, + { 0x1, 0x1, 216, 229, 1276, 32, 1, 125 }, + { 0x1, 0x1, 216, 230, 1286, 32, 1, 125 }, + { 0x1, 0x1, 216, 231, 1296, 32, 1, 125 }, + { 0x1, 0x1, 216, 232, 1309, 32, 1, 138 }, + { 0x1, 0x1, 216, 233, 1315, 32, 1, 138 }, + { 0x1, 0x1, 216, 234, 1321, 32, 1, 138 }, + { 0x1, 0x1, 216, 235, 1327, 32, 1, 138 }, + { 0x1, 0x1, 216, 236, 1333, 32, 1, 138 }, + { 0x1, 0x1, 216, 237, 1339, 32, 1, 138 }, + { 0x1, 0x1, 216, 238, 1345, 32, 1, 138 }, + { 0x1, 0x1, 216, 239, 1351, 32, 1, 138 }, + { 0x1, 0x1, 216, 240, 1357, 32, 1, 138 }, + { 0x1, 0x1, 216, 241, 1363, 32, 1, 138 }, + { 0x1, 0x1, 216, 242, 1369, 32, 1, 138 }, + { 0x1, 0x1, 216, 243, 1375, 32, 1, 138 }, + { 0x1, 0x1, 216, 244, 1381, 32, 1, 138 }, + { 0x1, 0x1, 216, 245, 1387, 32, 1, 138 }, + { 0x1, 0x1, 216, 246, 1393, 32, 1, 138 }, + { 0x1, 0x1, 216, 247, 1399, 32, 1, 138 }, + { 0x1, 0x1, 216, 248, 1405, 32, 1, 138 }, + { 0x1, 0x1, 216, 249, 1411, 32, 1, 138 }, + { 0x1, 0x1, 216, 704, -1, 31, 1, 146 }, + { 0x0, 0x0, 217, 1989, -1, 0, 1, 65 }, + { 0x0, 0x0, 217, 1990, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 24, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 1992, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 1993, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 1994, -1, 0, 1, 44 }, + { 0x0, 0x0, 217, 1995, -1, 0, 1, 39 }, + { 0x1, 0x1, 217, 1996, -1, 12, 1, 58 }, + { 0x0, 0x0, 217, 1997, -1, 0, 1, 53 }, + { 0x1000001, 0x1000001, 217, 1998, -1, 12, 1, 58 }, + { 0x1, 0x1, 217, 1999, -1, 36, 1, 53 }, + { 0x200001, 0x200001, 217, 2000, -1, 12, 1, 58 }, + { 0x1, 0x1, 217, 2001, -1, 33, 1, 53 }, + { 0x1200001, 0x1200001, 217, 2002, -1, 12, 1, 48 }, + { 0x9, 0x9, 217, 2003, -1, 33, 1, 48 }, + { 0x1, 0x1, 217, 2004, -1, 12, 1, 58 }, + { 0x0, 0x0, 217, 2005, -1, 0, 1, 53 }, + { 0x200001, 0x1200001, 217, 2006, -1, 12, 1, 58 }, + { 0x1, 0x9, 217, 2007, -1, 33, 1, 53 }, + { 0x1, 0x1, 217, 2008, -1, 12, 1, 58 }, + { 0x0, 0x0, 217, 2009, -1, 0, 1, 53 }, + { 0x1000001, 0x1000001, 217, 2010, -1, 12, 1, 58 }, + { 0x1, 0x1, 217, 2011, -1, 36, 1, 53 }, + { 0x200001, 0x200001, 217, 2012, -1, 12, 1, 58 }, + { 0x1, 0x1, 217, 2013, -1, 33, 1, 53 }, + { 0x1200001, 0x1200001, 217, 2014, -1, 12, 1, 48 }, + { 0x9, 0x9, 217, 2015, -1, 33, 1, 48 }, + { 0x1, 0x1, 217, 2016, -1, 12, 1, 58 }, + { 0x0, 0x0, 217, 2017, -1, 0, 1, 53 }, + { 0x200001, 0x1200001, 217, 2018, -1, 12, 1, 58 }, + { 0x1, 0x9, 217, 2019, -1, 33, 1, 53 }, + { 0x1, 0x1, 217, 2020, -1, 28, 1, 28 }, + { 0x0, 0x0, 217, 2021, -1, 0, 1, 28 }, + { 0x3, 0x3, 217, 2022, -1, 27, 1, 28 }, + { 0x1, 0x1, 217, 2023, -1, 27, 1, 28 }, + { 0x0, 0x0, 217, 2024, -1, 0, 1, 65 }, + { 0x0, 0x0, 217, 2025, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 2026, -1, 0, 1, 28 }, + { 0x1, 0x1, 217, 2027, -1, 36, 1, 65 }, + { 0x1, 0x1, 217, 2028, -1, 37, 1, 28 }, + { 0x0, 0x0, 217, 2029, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 2030, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 2031, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 2032, -1, 0, 1, 65 }, + { 0x0, 0x0, 217, 2033, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 36, -1, 0, 1, 28 }, + { 0x1, 0x1, 217, 2035, -1, 36, 1, 65 }, + { 0x1, 0x1, 217, 2036, -1, 37, 1, 28 }, + { 0x0, 0x0, 217, 2037, -1, 0, 1, 28 }, + { 0x1, 0x1, 217, 2038, -1, 36, 1, 65 }, + { 0x1, 0x1, 217, 2039, -1, 37, 1, 28 }, + { 0x0, 0x0, 217, 2040, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 2041, -1, 0, 1, 65 }, + { 0x0, 0x0, 217, 2042, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 41, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 2044, -1, 0, 1, 65 }, + { 0x0, 0x0, 217, 2045, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 42, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 2047, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 2048, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 2049, -1, 0, 1, 48 }, + { 0x1, 0x1, 217, 2050, -1, 27, 1, 48 }, + { 0x1, 0x1, 217, 2051, -1, 28, 1, 48 }, + { 0x3, 0x3, 217, 2052, -1, 27, 1, 48 }, + { 0x1, 0x1, 217, 2053, -1, 29, 1, 48 }, + { 0x5, 0x5, 217, 2054, -1, 27, 1, 48 }, + { 0x3, 0x3, 217, 2055, -1, 28, 1, 48 }, + { 0x7, 0x7, 217, 2056, -1, 27, 1, 48 }, + { 0x0, 0x0, 217, 2057, -1, 0, 1, 48 }, + { 0x0, 0x0, 217, 2058, -1, 0, 1, 48 }, + { 0x0, 0x0, 217, 2059, -1, 0, 1, 48 }, + { 0x0, 0x0, 217, 2060, -1, 0, 1, 48 }, + { 0x1, 0x1, 217, 2061, -1, 28, 1, 28 }, + { 0x0, 0x0, 217, 2062, -1, 0, 1, 28 }, + { 0x3, 0x3, 217, 2063, -1, 27, 1, 28 }, + { 0x1, 0x1, 217, 2064, -1, 27, 1, 28 }, + { 0x0, 0x0, 217, 2065, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 2066, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 2067, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 51, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 2069, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 2070, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 56, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 2072, -1, 0, 1, 23 }, + { 0x0, 0x0, 217, 2073, -1, 0, 1, 23 }, + { 0x0, 0x0, 217, 2074, -1, 0, 1, 23 }, + { 0x0, 0x0, 217, 2075, -1, 0, 1, 23 }, + { 0x0, 0x0, 217, 2076, -1, 0, 1, 34 }, + { 0x0, 0x0, 217, 2077, -1, 0, 1, 65 }, + { 0x0, 0x0, 217, 2078, -1, 0, 1, 28 }, + { 0x0, 0x0, 217, 63, -1, 0, 1, 28 }, + { 0x1, 0x1, 218, 2080, -1, 34, 1, 65 }, + { 0x1, 0x1, 218, 2081, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2082, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2083, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2084, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2085, -1, 34, 1, 45 }, + { 0x1, 0x1, 218, 2086, -1, 34, 1, 41 }, + { 0x400001, 0x400001, 218, 2087, -1, 12, 1, 60 }, + { 0x1, 0x1, 218, 2088, -1, 34, 1, 55 }, + { 0x1400001, 0x1400001, 218, 2089, -1, 12, 1, 60 }, + { 0x5, 0x5, 218, 2090, -1, 34, 1, 55 }, + { 0x600001, 0x600001, 218, 2091, -1, 12, 1, 60 }, + { 0x3, 0x3, 218, 2092, -1, 33, 1, 55 }, + { 0x1600001, 0x1600001, 218, 2093, -1, 12, 1, 50 }, + { 0xb, 0xb, 218, 2094, -1, 33, 1, 50 }, + { 0x400001, 0x400001, 218, 2095, -1, 12, 1, 60 }, + { 0x1, 0x1, 218, 2096, -1, 34, 1, 55 }, + { 0x600001, 0x1600001, 218, 2097, -1, 12, 1, 60 }, + { 0x3, 0xb, 218, 2098, -1, 33, 1, 55 }, + { 0x400001, 0x400001, 218, 2099, -1, 12, 1, 60 }, + { 0x1, 0x1, 218, 2100, -1, 34, 1, 55 }, + { 0x1400001, 0x1400001, 218, 2101, -1, 12, 1, 60 }, + { 0x5, 0x5, 218, 2102, -1, 34, 1, 55 }, + { 0x600001, 0x600001, 218, 2103, -1, 12, 1, 60 }, + { 0x3, 0x3, 218, 2104, -1, 33, 1, 55 }, + { 0x1600001, 0x1600001, 218, 2105, -1, 12, 1, 50 }, + { 0xb, 0xb, 218, 2106, -1, 33, 1, 50 }, + { 0x400001, 0x400001, 218, 2107, -1, 12, 1, 60 }, + { 0x1, 0x1, 218, 2108, -1, 34, 1, 55 }, + { 0x600001, 0x1600001, 218, 2109, -1, 12, 1, 60 }, + { 0x3, 0xb, 218, 2110, -1, 33, 1, 55 }, + { 0x41, 0x41, 218, 2111, -1, 28, 1, 30 }, + { 0x1, 0x1, 218, 2112, -1, 34, 1, 30 }, + { 0x83, 0x83, 218, 2113, -1, 27, 1, 30 }, + { 0x81, 0x81, 218, 2114, -1, 27, 1, 30 }, + { 0x1, 0x1, 218, 2115, -1, 34, 1, 65 }, + { 0x1, 0x1, 218, 2116, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2117, -1, 34, 1, 30 }, + { 0x5, 0x5, 218, 2118, -1, 34, 1, 65 }, + { 0x9, 0x9, 218, 2119, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2120, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2121, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2122, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2123, -1, 34, 1, 65 }, + { 0x1, 0x1, 218, 2124, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2125, -1, 34, 1, 30 }, + { 0x5, 0x5, 218, 2126, -1, 34, 1, 65 }, + { 0x9, 0x9, 218, 2127, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2128, -1, 34, 1, 30 }, + { 0x5, 0x5, 218, 2129, -1, 34, 1, 65 }, + { 0x9, 0x9, 218, 2130, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2131, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2132, -1, 34, 1, 65 }, + { 0x1, 0x1, 218, 2133, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2134, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2135, -1, 34, 1, 65 }, + { 0x1, 0x1, 218, 2136, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2137, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2138, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2139, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2140, -1, 34, 1, 50 }, + { 0x81, 0x81, 218, 2141, -1, 27, 1, 50 }, + { 0x41, 0x41, 218, 2142, -1, 28, 1, 50 }, + { 0x83, 0x83, 218, 2143, -1, 27, 1, 50 }, + { 0x21, 0x21, 218, 2144, -1, 29, 1, 50 }, + { 0x85, 0x85, 218, 2145, -1, 27, 1, 50 }, + { 0x43, 0x43, 218, 2146, -1, 28, 1, 50 }, + { 0x87, 0x87, 218, 2147, -1, 27, 1, 50 }, + { 0x1, 0x1, 218, 2148, -1, 34, 1, 50 }, + { 0x1, 0x1, 218, 2149, -1, 34, 1, 50 }, + { 0x1, 0x1, 218, 2150, -1, 34, 1, 50 }, + { 0x1, 0x1, 218, 2151, -1, 34, 1, 50 }, + { 0x41, 0x41, 218, 2152, -1, 28, 1, 30 }, + { 0x1, 0x1, 218, 2153, -1, 34, 1, 30 }, + { 0x83, 0x83, 218, 2154, -1, 27, 1, 30 }, + { 0x81, 0x81, 218, 2155, -1, 27, 1, 30 }, + { 0x1, 0x1, 218, 2156, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2157, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2158, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2159, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2160, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2161, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2162, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2163, -1, 34, 1, 25 }, + { 0x1, 0x1, 218, 2164, -1, 34, 1, 25 }, + { 0x1, 0x1, 218, 2165, -1, 34, 1, 25 }, + { 0x1, 0x1, 218, 2166, -1, 34, 1, 25 }, + { 0x1, 0x1, 218, 2167, -1, 34, 1, 36 }, + { 0x1, 0x1, 218, 2168, -1, 34, 1, 65 }, + { 0x1, 0x1, 218, 2169, -1, 34, 1, 30 }, + { 0x1, 0x1, 218, 2170, -1, 34, 1, 30 }, + { 0x1, 0x1, 219, 2171, -1, 35, 1, 65 }, + { 0x1, 0x1, 219, 2172, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2173, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2174, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2175, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2176, -1, 35, 1, 46 }, + { 0x1, 0x1, 219, 2177, -1, 35, 1, 42 }, + { 0x800001, 0x800001, 219, 2178, -1, 12, 1, 61 }, + { 0x1, 0x1, 219, 2179, -1, 35, 1, 56 }, + { 0x1800001, 0x1800001, 219, 2180, -1, 12, 1, 61 }, + { 0x3, 0x3, 219, 2181, -1, 35, 1, 56 }, + { 0xa00001, 0xa00001, 219, 2182, -1, 12, 1, 61 }, + { 0x5, 0x5, 219, 2183, -1, 33, 1, 56 }, + { 0x1a00001, 0x1a00001, 219, 2184, -1, 12, 1, 51 }, + { 0xd, 0xd, 219, 2185, -1, 33, 1, 51 }, + { 0x800001, 0x800001, 219, 2186, -1, 12, 1, 61 }, + { 0x1, 0x1, 219, 2187, -1, 35, 1, 56 }, + { 0xa00001, 0x1a00001, 219, 2188, -1, 12, 1, 61 }, + { 0x5, 0xd, 219, 2189, -1, 33, 1, 56 }, + { 0x800001, 0x800001, 219, 2190, -1, 12, 1, 61 }, + { 0x1, 0x1, 219, 2191, -1, 35, 1, 56 }, + { 0x1800001, 0x1800001, 219, 2192, -1, 12, 1, 61 }, + { 0x3, 0x3, 219, 2193, -1, 35, 1, 56 }, + { 0xa00001, 0xa00001, 219, 2194, -1, 12, 1, 61 }, + { 0x5, 0x5, 219, 2195, -1, 33, 1, 56 }, + { 0x1a00001, 0x1a00001, 219, 2196, -1, 12, 1, 51 }, + { 0xd, 0xd, 219, 2197, -1, 33, 1, 51 }, + { 0x800001, 0x800001, 219, 2198, -1, 12, 1, 61 }, + { 0x1, 0x1, 219, 2199, -1, 35, 1, 56 }, + { 0xa00001, 0x1a00001, 219, 2200, -1, 12, 1, 61 }, + { 0x5, 0xd, 219, 2201, -1, 33, 1, 56 }, + { 0x81, 0x81, 219, 2202, -1, 28, 1, 31 }, + { 0x1, 0x1, 219, 2203, -1, 35, 1, 31 }, + { 0x103, 0x103, 219, 2204, -1, 27, 1, 31 }, + { 0x101, 0x101, 219, 2205, -1, 27, 1, 31 }, + { 0x1, 0x1, 219, 2206, -1, 35, 1, 65 }, + { 0x1, 0x1, 219, 2207, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2208, -1, 35, 1, 31 }, + { 0x3, 0x3, 219, 2209, -1, 35, 1, 65 }, + { 0x5, 0x5, 219, 2210, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2211, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2212, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2213, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2214, -1, 35, 1, 65 }, + { 0x1, 0x1, 219, 2215, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2216, -1, 35, 1, 31 }, + { 0x3, 0x3, 219, 2217, -1, 35, 1, 65 }, + { 0x5, 0x5, 219, 2218, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2219, -1, 35, 1, 31 }, + { 0x3, 0x3, 219, 2220, -1, 35, 1, 65 }, + { 0x5, 0x5, 219, 2221, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2222, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2223, -1, 35, 1, 65 }, + { 0x1, 0x1, 219, 2224, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2225, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2226, -1, 35, 1, 65 }, + { 0x1, 0x1, 219, 2227, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2228, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2229, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2230, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2231, -1, 35, 1, 51 }, + { 0x101, 0x101, 219, 2232, -1, 27, 1, 51 }, + { 0x81, 0x81, 219, 2233, -1, 28, 1, 51 }, + { 0x103, 0x103, 219, 2234, -1, 27, 1, 51 }, + { 0x41, 0x41, 219, 2235, -1, 29, 1, 51 }, + { 0x105, 0x105, 219, 2236, -1, 27, 1, 51 }, + { 0x83, 0x83, 219, 2237, -1, 28, 1, 51 }, + { 0x107, 0x107, 219, 2238, -1, 27, 1, 51 }, + { 0x1, 0x1, 219, 2239, -1, 35, 1, 51 }, + { 0x1, 0x1, 219, 2240, -1, 35, 1, 51 }, + { 0x1, 0x1, 219, 2241, -1, 35, 1, 51 }, + { 0x1, 0x1, 219, 2242, -1, 35, 1, 51 }, + { 0x81, 0x81, 219, 2243, -1, 28, 1, 31 }, + { 0x1, 0x1, 219, 2244, -1, 35, 1, 31 }, + { 0x103, 0x103, 219, 2245, -1, 27, 1, 31 }, + { 0x101, 0x101, 219, 2246, -1, 27, 1, 31 }, + { 0x1, 0x1, 219, 2247, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2248, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2249, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2250, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2251, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2252, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2253, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2254, -1, 35, 1, 26 }, + { 0x1, 0x1, 219, 2255, -1, 35, 1, 26 }, + { 0x1, 0x1, 219, 2256, -1, 35, 1, 26 }, + { 0x1, 0x1, 219, 2257, -1, 35, 1, 26 }, + { 0x1, 0x1, 219, 2258, -1, 35, 1, 37 }, + { 0x1, 0x1, 219, 2259, -1, 35, 1, 65 }, + { 0x1, 0x1, 219, 2260, -1, 35, 1, 31 }, + { 0x1, 0x1, 219, 2261, -1, 35, 1, 31 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 65 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, 1852, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 47 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 43 }, + { 0xc00001, 0xc00001, 220, -1, -1, 12, 1, 62 }, + { 0x3, 0x3, 220, 2435, -1, 34, 1, 57 }, + { 0x1c00001, 0x1c00001, 220, -1, -1, 12, 1, 62 }, + { 0x7, 0x7, 220, 2436, -1, 34, 1, 57 }, + { 0xe00001, 0xe00001, 220, -1, -1, 12, 1, 62 }, + { 0x7, 0x7, 220, 2437, -1, 33, 1, 57 }, + { 0x1e00001, 0x1e00001, 220, -1, -1, 12, 1, 52 }, + { 0xf, 0xf, 220, 2438, -1, 33, 1, 52 }, + { 0xc00001, 0xc00001, 220, -1, -1, 12, 1, 62 }, + { 0x3, 0x3, 220, 2443, -1, 34, 1, 57 }, + { 0xe00001, 0x1e00001, 220, -1, -1, 12, 1, 62 }, + { 0x7, 0xf, 220, 2444, -1, 33, 1, 57 }, + { 0xc00001, 0xc00001, 220, -1, -1, 12, 1, 62 }, + { 0x3, 0x3, 220, 2447, -1, 34, 1, 57 }, + { 0x1c00001, 0x1c00001, 220, -1, -1, 12, 1, 62 }, + { 0x7, 0x7, 220, 2448, -1, 34, 1, 57 }, + { 0xe00001, 0xe00001, 220, -1, -1, 12, 1, 62 }, + { 0x7, 0x7, 220, 2449, -1, 33, 1, 57 }, + { 0x1e00001, 0x1e00001, 220, -1, -1, 12, 1, 52 }, + { 0xf, 0xf, 220, 2450, -1, 33, 1, 52 }, + { 0xc00001, 0xc00001, 220, -1, -1, 12, 1, 62 }, + { 0x3, 0x3, 220, 2455, -1, 34, 1, 57 }, + { 0xe00001, 0x1e00001, 220, -1, -1, 12, 1, 62 }, + { 0x7, 0xf, 220, 2456, -1, 33, 1, 57 }, + { 0xc1, 0xc1, 220, -1, -1, 28, 1, 32 }, + { 0x3, 0x3, 220, 2375, -1, 34, 1, 32 }, + { 0x183, 0x183, 220, -1, -1, 27, 1, 32 }, + { 0x181, 0x181, 220, 2376, -1, 27, 1, 32 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 65 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, 1853, -1, 34, 1, 32 }, + { 0x7, 0x7, 220, -1, -1, 34, 1, 65 }, + { 0xb, 0xb, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, 1854, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 65 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, 1857, -1, 34, 1, 32 }, + { 0x7, 0x7, 220, -1, -1, 34, 1, 65 }, + { 0xb, 0xb, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, 1858, -1, 34, 1, 32 }, + { 0x7, 0x7, 220, -1, -1, 34, 1, 65 }, + { 0xb, 0xb, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, 1860, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 65 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, 1862, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 65 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, 1863, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 52 }, + { 0x181, 0x181, 220, -1, -1, 27, 1, 52 }, + { 0xc1, 0xc1, 220, -1, -1, 28, 1, 52 }, + { 0x183, 0x183, 220, -1, -1, 27, 1, 52 }, + { 0x61, 0x61, 220, -1, -1, 29, 1, 52 }, + { 0x185, 0x185, 220, -1, -1, 27, 1, 52 }, + { 0xc3, 0xc3, 220, -1, -1, 28, 1, 52 }, + { 0x187, 0x187, 220, -1, -1, 27, 1, 52 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 52 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 52 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 52 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 52 }, + { 0xc1, 0xc1, 220, -1, -1, 28, 1, 32 }, + { 0x3, 0x3, 220, 2379, -1, 34, 1, 32 }, + { 0x183, 0x183, 220, -1, -1, 27, 1, 32 }, + { 0x181, 0x181, 220, 2380, -1, 27, 1, 32 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 27 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 27 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 27 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 27 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 38 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 65 }, + { 0x3, 0x3, 220, -1, -1, 34, 1, 32 }, + { 0x3, 0x3, 220, 1865, -1, 34, 1, 32 }, + { 0x3, 0x3, 221, 395, 1197, 32, 1, 127 }, + { 0x3, 0x3, 221, 396, 1206, 32, 1, 127 }, + { 0x3, 0x3, 221, 397, 1215, 32, 1, 127 }, + { 0x3, 0x3, 221, 398, 1224, 32, 1, 127 }, + { 0x3, 0x3, 221, 399, 1233, 32, 1, 127 }, + { 0x3, 0x3, 221, 400, 1242, 32, 1, 127 }, + { 0x3, 0x3, 221, 401, 1251, 32, 1, 127 }, + { 0x3, 0x3, 221, 402, 1260, 32, 1, 127 }, + { 0x3, 0x3, 221, 403, 1269, 32, 1, 127 }, + { 0x3, 0x3, 221, 404, 1278, 32, 1, 127 }, + { 0x3, 0x3, 221, 405, 1288, 32, 1, 127 }, + { 0x3, 0x3, 221, 406, 1298, 32, 1, 127 }, + { 0x3, 0x3, 221, 419, 1311, 32, 1, 140 }, + { 0x3, 0x3, 221, 420, 1317, 32, 1, 140 }, + { 0x3, 0x3, 221, 421, 1323, 32, 1, 140 }, + { 0x3, 0x3, 221, 422, 1329, 32, 1, 140 }, + { 0x3, 0x3, 221, 423, 1335, 32, 1, 140 }, + { 0x3, 0x3, 221, 424, 1341, 32, 1, 140 }, + { 0x3, 0x3, 221, 425, 1347, 32, 1, 140 }, + { 0x3, 0x3, 221, 426, 1353, 32, 1, 140 }, + { 0x3, 0x3, 221, 427, 1359, 32, 1, 140 }, + { 0x3, 0x3, 221, 428, 1365, 32, 1, 140 }, + { 0x3, 0x3, 221, 429, 1371, 32, 1, 140 }, + { 0x3, 0x3, 221, 430, 1377, 32, 1, 140 }, + { 0x3, 0x3, 221, 431, 1383, 32, 1, 140 }, + { 0x3, 0x3, 221, 432, 1389, 32, 1, 140 }, + { 0x3, 0x3, 221, 433, 1395, 32, 1, 140 }, + { 0x3, 0x3, 221, 434, 1401, 32, 1, 140 }, + { 0x3, 0x3, 221, 435, 1407, 32, 1, 140 }, + { 0x3, 0x3, 221, 436, 1413, 32, 1, 140 }, + { 0x1, 0x1, 222, -1, -1, 28, 1, 33 }, + { 0x1, 0x1, 222, -1, -1, 28, 1, 33 }, + { 0x0, 0x0, 229, 804, -1, 0, 1, 134 }, + { 0x0, 0x0, 229, 805, -1, 0, 1, 146 }, + { 0x1, 0x1, 230, -1, 1704, 33, 1, 131 }, + { 0x1, 0x1, 230, -1, 1707, 33, 1, 136 }, + { 0x0, 0x0, 230, -1, 1709, 0, 1, 130 }, + { 0x0, 0x0, 230, -1, 1710, 0, 1, 130 }, + { 0x0, 0x0, 231, 738, 816, 0, 0, -1 }, + { 0x0, 0x0, 231, 739, 824, 0, 0, -1 }, + { 0x0, 0x0, 231, 740, 820, 0, 0, -1 }, + { 0x1, 0x1, 231, 741, 475, 33, 1, 6 }, + { 0x8000001, 0x8000001, 231, 742, 483, 6, 1, 7 }, + { 0x1, 0x1, 231, 743, 479, 33, 1, 6 }, + { 0x0, 0x0, 231, 744, 828, 0, 0, -1 }, + { 0x1, 0x1, 231, 745, 495, 33, 1, 8 }, + { 0x0, 0x0, 231, 746, 832, 0, 0, -1 }, + { 0x1, 0x1, 231, 747, 507, 33, 1, 15 }, + { 0x0, 0x0, 231, 748, 837, 0, 0, -1 }, + { 0x0, 0x0, 231, 749, 841, 0, 0, -1 }, + { 0x1, 0x1, 231, 750, 530, 33, 1, 17 }, + { 0x1, 0x1, 231, 751, 534, 33, 1, 17 }, + { 0x0, 0x0, 231, 752, 845, 0, 0, -1 }, + { 0x0, 0x0, 231, 753, 849, 0, 0, -1 }, + { 0x1, 0x1, 231, 754, 554, 33, 1, 18 }, + { 0x8000001, 0x8000001, 231, 755, 558, 6, 1, 18 }, + { 0x0, 0x0, 231, 756, 853, 0, 0, -1 }, + { 0x1, 0x1, 231, 757, 570, 33, 1, 19 }, + { 0x0, 0x0, 231, 758, 857, 0, 0, -1 }, + { 0x0, 0x0, 231, 759, 861, 0, 0, -1 }, + { 0x1, 0x1, 231, 760, 590, 33, 1, 20 }, + { 0x8000001, 0x8000001, 231, 761, 594, 6, 1, 20 }, + { 0x0, 0x0, 231, 762, 865, 0, 0, -1 }, + { 0x1, 0x1, 231, 763, 606, 33, 1, 21 }, + { 0x0, 0x0, 231, 764, 870, 0, 0, -1 }, + { 0x0, 0x0, 231, 765, 874, 0, 0, -1 }, + { 0x1, 0x1, 231, 766, 629, 33, 1, 17 }, + { 0x1, 0x1, 231, 767, 633, 33, 1, 17 }, + { 0x0, 0x0, 231, 768, 878, 0, 0, -1 }, + { 0x1, 0x1, 231, 769, 645, 33, 1, 21 }, + { 0x0, 0x0, 232, 2300, 815, 0, 0, -1 }, + { 0x0, 0x0, 232, 2301, 823, 0, 0, -1 }, + { 0x0, 0x0, 232, 2302, 819, 0, 0, -1 }, + { 0x0, 0x0, 232, 2303, 474, 0, 1, 6 }, + { 0x1, 0x1, 232, 2304, 482, 6, 1, 7 }, + { 0x0, 0x0, 232, 2305, 478, 0, 1, 6 }, + { 0x0, 0x0, 232, 2306, 827, 0, 0, -1 }, + { 0x0, 0x0, 232, 2307, 494, 0, 1, 8 }, + { 0x0, 0x0, 232, 2308, 831, 0, 0, -1 }, + { 0x0, 0x0, 232, 2309, 506, 0, 1, 15 }, + { 0x0, 0x0, 232, 2310, 836, 0, 0, -1 }, + { 0x0, 0x0, 232, 2311, 840, 0, 0, -1 }, + { 0x0, 0x0, 232, 2312, 529, 0, 1, 17 }, + { 0x0, 0x0, 232, 2313, 533, 0, 1, 17 }, + { 0x0, 0x0, 232, 2314, 844, 0, 0, -1 }, + { 0x0, 0x0, 232, 2315, 848, 0, 0, -1 }, + { 0x0, 0x0, 232, 2316, 553, 0, 1, 18 }, + { 0x1, 0x1, 232, 2317, 557, 6, 1, 18 }, + { 0x0, 0x0, 232, 2318, 852, 0, 0, -1 }, + { 0x0, 0x0, 232, 2319, 569, 0, 1, 19 }, + { 0x0, 0x0, 232, 2320, 856, 0, 0, -1 }, + { 0x0, 0x0, 232, 2321, 860, 0, 0, -1 }, + { 0x0, 0x0, 232, 2322, 589, 0, 1, 20 }, + { 0x1, 0x1, 232, 2323, 593, 6, 1, 20 }, + { 0x0, 0x0, 232, 2324, 864, 0, 0, -1 }, + { 0x0, 0x0, 232, 2325, 605, 0, 1, 21 }, + { 0x0, 0x0, 232, 2326, 869, 0, 0, -1 }, + { 0x0, 0x0, 232, 2327, 873, 0, 0, -1 }, + { 0x0, 0x0, 232, 2328, 628, 0, 1, 17 }, + { 0x0, 0x0, 232, 2329, 632, 0, 1, 17 }, + { 0x0, 0x0, 232, 2330, 877, 0, 0, -1 }, + { 0x0, 0x0, 232, 2331, 644, 0, 1, 21 }, + { 0x1, 0x1, 232, 770, 964, 27, 1, 16 }, + { 0x0, 0x0, 232, 771, 962, 0, 1, 16 }, + { 0x0, 0x0, 232, 1012, 966, 0, 1, 22 }, + { 0x0, 0x1, 232, 974, 972, 20, 1, 67 }, + { 0x0, 0x0, 232, 108, 970, 0, 1, 67 }, + { 0x1, 0x1, 235, -1, -1, 29, 1, 0 }, + { 0x0, 0x0, 235, -1, -1, 0, 1, 0 }, + { 0x1, 0x1, 235, 2472, -1, 27, 1, 0 }, + { 0x1, 0x1, 235, 2473, -1, 27, 1, 0 }, + { 0x1, 0x1, 235, 2474, -1, 27, 1, 0 }, + { 0x1, 0x1, 235, 2475, -1, 27, 1, 0 }, + { 0x0, 0x0, 256, -1, 1929, 0, 0, -1 }, + { 0x0, 0x0, 256, -1, 1931, 0, 0, -1 }, + { 0x1, 0x1, 256, -1, -1, 28, 1, 29 }, + { 0x1, 0x1, 256, -1, -1, 28, 1, 29 }, + { 0x0, 0x0, 256, -1, 1970, 0, 0, -1 }, + { 0x0, 0x0, 256, -1, 1972, 0, 0, -1 }, + { 0x1, 0x1, 256, -1, -1, 28, 1, 29 }, + { 0x1, 0x1, 256, -1, -1, 28, 1, 29 }, + { 0x0, 0x0, 258, 22, -1, 0, 1, 0 }, + { 0x0, 0x0, 258, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 258, -1, -1, 0, 1, 0 }, + { 0x0, 0x1, 258, -1, -1, 29, 1, 0 }, + { 0x0, 0x1, 258, -1, -1, 29, 1, 0 }, + { 0x0, 0x1, 258, -1, -1, 29, 1, 0 }, + { 0x0, 0x1, 258, -1, -1, 29, 1, 0 }, + { 0x0, 0x1, 258, -1, -1, 29, 1, 0 }, + { 0x0, 0x0, 258, 176, -1, 0, 1, 0 }, + { 0x0, 0x1, 258, -1, -1, 29, 1, 0 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 64 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 64 }, + { 0x0, 0x0, 259, -1, 1905, 0, 0, -1 }, + { 0x0, 0x0, 259, -1, 1907, 0, 0, -1 }, + { 0x0, 0x0, 259, -1, 1909, 0, 0, -1 }, + { 0x0, 0x0, 259, -1, 1911, 0, 0, -1 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 59 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 59 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 59 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 49 }, + { 0x0, 0x0, 259, -1, 1913, 0, 0, -1 }, + { 0x0, 0x0, 259, -1, 1915, 0, 0, -1 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 59 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 59 }, + { 0x0, 0x0, 259, -1, 1917, 0, 0, -1 }, + { 0x0, 0x0, 259, -1, 1919, 0, 0, -1 }, + { 0x0, 0x0, 259, -1, 1921, 0, 0, -1 }, + { 0x0, 0x0, 259, -1, 1923, 0, 0, -1 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 59 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 59 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 59 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 49 }, + { 0x0, 0x0, 259, -1, 1925, 0, 0, -1 }, + { 0x0, 0x0, 259, -1, 1927, 0, 0, -1 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 59 }, + { 0x1, 0x1, 259, -1, -1, 12, 1, 59 }, + { 0x1, 0x1, 259, 329, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, 387, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, 333, -1, 12, 1, 2 }, + { 0x1, 0x1, 259, 391, -1, 12, 1, 2 }, + { 0x0, 0x0, 260, -1, 1912, 0, 0, -1 }, + { 0x9, 0x9, 260, -1, 2442, 33, 1, 49 }, + { 0x0, 0x0, 260, 1162, 1961, 0, 0, -1 }, + { 0x3, 0x3, 260, 1163, -1, 27, 1, 49 }, + { 0x0, 0x0, 264, 2369, -1, 0, 1, 0 }, + { 0x3, 0x3, 265, -1, -1, 27, 1, 0 }, + { 0x3, 0x3, 265, -1, -1, 27, 1, 0 }, + { 0x3, 0x3, 265, -1, -1, 27, 1, 0 }, + { 0x3, 0x3, 265, -1, -1, 27, 1, 0 }, + { 0x1, 0x1, 266, 2468, -1, 28, 1, 0 }, + { 0x1, 0x1, 266, 2469, -1, 28, 1, 0 }, + { 0x1, 0x1, 266, 2470, -1, 28, 1, 0 }, + { 0x1, 0x1, 266, 2471, -1, 28, 1, 0 }, + { 0x1, 0x1, 267, -1, -1, 27, 1, 93 }, + { 0x1, 0x1, 267, -1, -1, 27, 1, 93 }, + { 0x0, 0x0, 267, -1, 813, 0, 0, -1 }, + { 0x0, 0x0, 268, 2481, 2346, 0, 0, -1 }, + { 0x0, 0x0, 268, 2482, 2348, 0, 0, -1 }, + { 0x0, 0x0, 269, -1, 2347, 0, 0, -1 }, + { 0x0, 0x0, 269, -1, 2349, 0, 0, -1 }, + { 0x0, 0x0, 270, -1, -1, 0, 1, 40 }, + { 0x0, 0x0, 270, -1, -1, 0, 1, 40 }, + { 0x0, 0x0, 275, -1, -1, 0, 1, 33 }, + { 0x0, 0x0, 279, -1, 1935, 0, 1, 29 }, + { 0x0, 0x0, 280, -1, -1, 0, 1, 0 }, + { 0x0, 0x0, 280, -1, -1, 0, 1, 71 }, + { 0x0, 0x0, 280, 1723, 2459, 0, 1, 1 }, + { 0x0, 0x0, 280, -1, 388, 0, 0, -1 }, + { 0x0, 0x0, 280, 1725, 2461, 0, 1, 1 }, + { 0x0, 0x0, 280, -1, 392, 0, 0, -1 }, +}; + +static const struct ia64_main_table +main_table[] = { + { 5, 1, 1, 0x00000000ull, 0xf8000000ull, { 23, 24, 25, 0, 0 }, 0x0, 0, }, + { 5, 1, 1, 0x08000000ull, 0xf8000000ull, { 23, 24, 25, 3, 0 }, 0x0, 1, }, + { 5, 7, 1, 0x00000000ull, 0x00000000ull, { 23, 65, 26, 0, 0 }, 0x0, 2, }, + { 5, 7, 1, 0x00000000ull, 0x00000000ull, { 23, 62, 25, 0, 0 }, 0x0, 3, }, + { 6, 1, 1, 0x00000000ull, 0x00000000ull, { 23, 65, 26, 0, 0 }, 0x0, 4, }, + { 7, 1, 1, 0x40000000ull, 0xf8000000ull, { 23, 24, 25, 0, 0 }, 0x0, 5, }, + { 7, 1, 1, 0x00000000ull, 0x00000000ull, { 23, 62, 25, 0, 0 }, 0x0, 6, }, + { 8, 1, 1, 0x00000000ull, 0x00000000ull, { 23, 62, 25, 0, 0 }, 0x0, 7, }, + { 9, 3, 1, 0x00000000ull, 0x00000000ull, { 23, 2, 51, 52, 53 }, 0x221, 8, }, + { 10, 1, 1, 0x60000000ull, 0xf8000000ull, { 23, 24, 25, 0, 0 }, 0x0, 9, }, + { 10, 1, 1, 0x60000000ull, 0xf8000000ull, { 23, 54, 25, 0, 0 }, 0x0, 10, }, + { 11, 1, 1, 0x68000000ull, 0xf8000000ull, { 23, 24, 25, 0, 0 }, 0x0, 11, }, + { 11, 1, 1, 0x68000000ull, 0xf8000000ull, { 23, 54, 25, 0, 0 }, 0x0, 12, }, + { 14, 4, 0, 0x00000000ull, 0xf80011ffull, { 15, 0, 0, 0, 0 }, 0x40, 814, }, + { 14, 4, 0, 0x00000000ull, 0xf80011c0ull, { 15, 0, 0, 0, 0 }, 0x0, 680, }, + { 14, 4, 0, 0x00000000ull, 0xf80011c0ull, { 15, 0, 0, 0, 0 }, 0x40, 681, }, + { 14, 4, 0, 0x08000100ull, 0xf80011c0ull, { 15, 0, 0, 0, 0 }, 0x200, 1843, }, + { 14, 4, 0, 0x08000100ull, 0xf80011c0ull, { 15, 0, 0, 0, 0 }, 0x240, 1844, }, + { 14, 4, 1, 0x00000000ull, 0x00001000ull, { 14, 15, 0, 0, 0 }, 0x0, 437, }, + { 14, 4, 1, 0x00000000ull, 0x00001000ull, { 14, 15, 0, 0, 0 }, 0x40, 438, }, + { 14, 4, 0, 0x00000000ull, 0x000011ffull, { 80, 0, 0, 0, 0 }, 0x40, 835, }, + { 14, 4, 0, 0x00000000ull, 0x000011c0ull, { 80, 0, 0, 0, 0 }, 0x0, 682, }, + { 14, 4, 0, 0x00000000ull, 0x000011c0ull, { 80, 0, 0, 0, 0 }, 0x40, 683, }, + { 14, 4, 0, 0x00000080ull, 0x000011c0ull, { 80, 0, 0, 0, 0 }, 0x210, 2479, }, + { 14, 4, 0, 0x00000080ull, 0x000011c0ull, { 80, 0, 0, 0, 0 }, 0x250, 2480, }, + { 14, 4, 0, 0x00000140ull, 0x000011c0ull, { 80, 0, 0, 0, 0 }, 0x30, 445, }, + { 14, 4, 0, 0x00000140ull, 0x000011c0ull, { 80, 0, 0, 0, 0 }, 0x70, 446, }, + { 14, 4, 0, 0x00000180ull, 0x000011c0ull, { 80, 0, 0, 0, 0 }, 0x230, 443, }, + { 14, 4, 0, 0x00000180ull, 0x000011c0ull, { 80, 0, 0, 0, 0 }, 0x270, 444, }, + { 14, 4, 1, 0x00000000ull, 0x00001000ull, { 14, 80, 0, 0, 0 }, 0x0, 439, }, + { 14, 4, 1, 0x00000000ull, 0x00001000ull, { 14, 80, 0, 0, 0 }, 0x40, 440, }, + { 15, 4, 0, 0x00000000ull, 0xf8000000ull, { 64, 0, 0, 0, 0 }, 0x0, 393, }, + { 15, 5, 0, 0x00000000ull, 0xf8000000ull, { 64, 0, 0, 0, 0 }, 0x0, 806, }, + { 15, 2, 0, 0x00000000ull, 0xf8000000ull, { 64, 0, 0, 0, 0 }, 0x2, 949, }, + { 15, 3, 0, 0x00000000ull, 0xf8000000ull, { 64, 0, 0, 0, 0 }, 0x0, 1038, }, + { 15, 6, 0, 0x00000000ull, 0xf8000000ull, { 68, 0, 0, 0, 0 }, 0x0, 2483, }, + { 15, 7, 0, 0x00000000ull, 0x00000000ull, { 64, 0, 0, 0, 0 }, 0x0, 15, }, + { 16, 6, 0, 0x00000000ull, 0x000011ffull, { 81, 0, 0, 0, 0 }, 0x40, 868, }, + { 16, 6, 0, 0x00000000ull, 0x000011c0ull, { 81, 0, 0, 0, 0 }, 0x0, 684, }, + { 16, 6, 0, 0x00000000ull, 0x000011c0ull, { 81, 0, 0, 0, 0 }, 0x40, 685, }, + { 16, 6, 1, 0x00000000ull, 0x00001000ull, { 14, 81, 0, 0, 0 }, 0x0, 441, }, + { 16, 6, 1, 0x00000000ull, 0x00001000ull, { 14, 81, 0, 0, 0 }, 0x40, 442, }, + { 17, 4, 0, 0x80000000ull, 0xf8000018ull, { 15, 76, 0, 0, 0 }, 0x20, 2365, }, + { 17, 4, 0, 0x00000000ull, 0x00000018ull, { 80, 76, 0, 0, 0 }, 0x20, 2366, }, + { 18, 4, 0, 0x60000000ull, 0xf8000000ull, { 0, 0, 0, 0, 0 }, 0x2c, 216, }, + { 22, 2, 0, 0x00000000ull, 0x00000000ull, { 24, 79, 0, 0, 0 }, 0x0, 1848, }, + { 22, 3, 0, 0x00000000ull, 0x00000000ull, { 23, 80, 0, 0, 0 }, 0x0, 218, }, + { 22, 3, 0, 0x00000000ull, 0x00000000ull, { 17, 80, 0, 0, 0 }, 0x0, 219, }, + { 22, 3, 0, 0x00000000ull, 0x00000000ull, { 24, 79, 0, 0, 0 }, 0x0, 1849, }, + { 22, 3, 0, 0x00000000ull, 0x00000000ull, { 18, 79, 0, 0, 0 }, 0x0, 1850, }, + { 22, 7, 0, 0x00000000ull, 0x00000000ull, { 24, 79, 0, 0, 0 }, 0x0, 1851, }, + { 25, 4, 0, 0x20000000ull, 0xf8000000ull, { 0, 0, 0, 0, 0 }, 0x224, 17, }, + { 26, 1, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 24, 25, 0 }, 0x0, 1014, }, + { 26, 1, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 25, 24, 0 }, 0x0, 990, }, + { 26, 1, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 25, 24, 0 }, 0x0, 918, }, + { 26, 1, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 24, 25, 0 }, 0x0, 897, }, + { 26, 1, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 24, 25, 0 }, 0x40, 1146, }, + { 26, 1, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 6, 25, 0 }, 0x0, 919, }, + { 26, 1, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 25, 6, 0 }, 0x40, 1016, }, + { 26, 1, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 6, 25, 0 }, 0x40, 993, }, + { 26, 1, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 54, 25, 0 }, 0x0, 1018, }, + { 26, 1, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 56, 25, 0 }, 0x0, 994, }, + { 26, 1, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 56, 25, 0 }, 0x0, 922, }, + { 26, 1, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 54, 25, 0 }, 0x0, 901, }, + { 26, 1, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 54, 25, 0 }, 0x40, 1149, }, + { 26, 1, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 58, 25, 0 }, 0x0, 1009, }, + { 26, 1, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 58, 25, 0 }, 0x0, 939, }, + { 26, 1, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 24, 25, 0 }, 0x40, 1150, }, + { 26, 1, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 6, 25, 0 }, 0x40, 995, }, + { 26, 1, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 25, 6, 0 }, 0x40, 903, }, + { 26, 1, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 54, 25, 0 }, 0x40, 1151, }, + { 27, 1, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 24, 25, 0 }, 0x0, 1021, }, + { 27, 1, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 25, 24, 0 }, 0x0, 997, }, + { 27, 1, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 25, 24, 0 }, 0x0, 925, }, + { 27, 1, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 24, 25, 0 }, 0x0, 904, }, + { 27, 1, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 24, 25, 0 }, 0x40, 1154, }, + { 27, 1, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 6, 25, 0 }, 0x0, 926, }, + { 27, 1, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 25, 6, 0 }, 0x40, 1023, }, + { 27, 1, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 6, 25, 0 }, 0x40, 1000, }, + { 27, 1, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 54, 25, 0 }, 0x0, 1025, }, + { 27, 1, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 56, 25, 0 }, 0x0, 1001, }, + { 27, 1, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 56, 25, 0 }, 0x0, 929, }, + { 27, 1, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 54, 25, 0 }, 0x0, 908, }, + { 27, 1, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 54, 25, 0 }, 0x40, 1157, }, + { 27, 1, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 55, 25, 0 }, 0x0, 1035, }, + { 27, 1, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 57, 25, 0 }, 0x0, 1011, }, + { 27, 1, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 57, 25, 0 }, 0x0, 941, }, + { 27, 1, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 55, 25, 0 }, 0x0, 917, }, + { 27, 1, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 24, 25, 0 }, 0x40, 1158, }, + { 27, 1, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 6, 25, 0 }, 0x40, 1002, }, + { 27, 1, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 25, 6, 0 }, 0x40, 910, }, + { 27, 1, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 54, 25, 0 }, 0x40, 1159, }, + { 28, 3, 1, 0x08000000ull, 0xf8000000ull, { 23, 32, 24, 1, 0 }, 0x0, 251, }, + { 29, 3, 1, 0x48000000ull, 0xf8000000ull, { 23, 32, 24, 1, 0 }, 0x0, 252, }, + { 30, 3, 1, 0x88000000ull, 0xf8000000ull, { 23, 32, 24, 1, 0 }, 0x0, 253, }, + { 31, 3, 1, 0xc8000000ull, 0xf8000000ull, { 23, 32, 24, 1, 0 }, 0x0, 254, }, + { 33, 4, 0, 0x10000000ull, 0xf8000000ull, { 0, 0, 0, 0, 0 }, 0x224, 18, }, + { 35, 2, 1, 0xc0000000ull, 0xf8000000ull, { 23, 25, 0, 0, 0 }, 0x0, 976, }, + { 36, 2, 1, 0xc8000000ull, 0xf8000000ull, { 23, 25, 0, 0, 0 }, 0x0, 977, }, + { 38, 2, 1, 0x00000000ull, 0x00000000ull, { 23, 24, 25, 46, 71 }, 0x0, 19, }, + { 38, 2, 1, 0x00000000ull, 0x04000000ull, { 23, 24, 44, 72, 0 }, 0x0, 2487, }, + { 38, 2, 1, 0x04000000ull, 0x04000000ull, { 23, 54, 44, 72, 0 }, 0x0, 2488, }, + { 38, 2, 1, 0x00000000ull, 0x00000000ull, { 23, 47, 25, 45, 72 }, 0x0, 20, }, + { 42, 4, 0, 0x80000000ull, 0xf8000000ull, { 0, 0, 0, 0, 0 }, 0x20, 21, }, + { 47, 2, 1, 0x00000000ull, 0x00002000ull, { 23, 25, 75, 72, 0 }, 0x0, 2383, }, + { 49, 5, 1, 0x80000000ull, 0xf80fe000ull, { 17, 19, 0, 0, 0 }, 0x40, 23, }, + { 50, 5, 1, 0x08000000ull, 0xf8000000ull, { 17, 19, 18, 0, 0 }, 0x40, 1900, }, + { 51, 5, 1, 0xb8000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x0, 1901, }, + { 51, 5, 1, 0xb8000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x40, 25, }, + { 52, 5, 1, 0xb0000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x0, 1902, }, + { 52, 5, 1, 0xb0000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x40, 26, }, + { 53, 5, 1, 0x60000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x0, 27, }, + { 54, 5, 1, 0x68000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x0, 28, }, + { 56, 3, 0, 0x80000000ull, 0xf8000000ull, { 25, 0, 0, 0, 0 }, 0x0, 29, }, + { 57, 5, 0, 0x40000000ull, 0xf8000000ull, { 78, 0, 0, 0, 0 }, 0x0, 1903, }, + { 57, 5, 0, 0x40000000ull, 0xf8000000ull, { 78, 0, 0, 0, 0 }, 0x40, 30, }, + { 58, 5, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 18, 59, 0 }, 0x0, 1040, }, + { 58, 5, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 18, 59, 0 }, 0x40, 1179, }, + { 59, 5, 0, 0x28000000ull, 0xf8000000ull, { 0, 0, 0, 0, 0 }, 0x0, 1904, }, + { 59, 5, 0, 0x28000000ull, 0xf8000000ull, { 0, 0, 0, 0, 0 }, 0x40, 31, }, + { 60, 5, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 18, 19, 0 }, 0x0, 790, }, + { 60, 5, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 18, 19, 0 }, 0x40, 791, }, + { 60, 5, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 19, 18, 0 }, 0x0, 932, }, + { 60, 5, 2, 0x00000000ull, 0x00001000ull, { 21, 22, 19, 18, 0 }, 0x40, 933, }, + { 60, 5, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 18, 19, 0 }, 0x0, 1160, }, + { 60, 5, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 18, 19, 0 }, 0x40, 1161, }, + { 60, 5, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 19, 18, 0 }, 0x0, 1167, }, + { 60, 5, 2, 0x00000000ull, 0x00001000ull, { 22, 21, 19, 18, 0 }, 0x40, 1168, }, + { 61, 5, 1, 0xc0000000ull, 0xf8000000ull, { 17, 18, 0, 0, 0 }, 0x0, 887, }, + { 61, 5, 1, 0xc0000000ull, 0xf8000000ull, { 17, 18, 0, 0, 0 }, 0x40, 888, }, + { 61, 5, 1, 0xe0000000ull, 0xf8000000ull, { 17, 18, 0, 0, 0 }, 0x0, 2485, }, + { 61, 5, 1, 0x08000000ull, 0xf80fe000ull, { 17, 19, 0, 0, 0 }, 0x40, 2486, }, + { 62, 3, 1, 0x88000000ull, 0xf8000000ull, { 23, 32, 70, 0, 0 }, 0x0, 255, }, + { 63, 3, 1, 0xc8000000ull, 0xf8000000ull, { 23, 32, 70, 0, 0 }, 0x0, 256, }, + { 66, 3, 0, 0x60000000ull, 0xf8000000ull, { 0, 0, 0, 0, 0 }, 0x21, 32, }, + { 67, 5, 1, 0x00000000ull, 0x00000000ull, { 17, 19, 20, 18, 0 }, 0x0, 1938, }, + { 67, 5, 1, 0x00000000ull, 0x00000000ull, { 17, 19, 20, 18, 0 }, 0x40, 33, }, + { 68, 5, 1, 0xa8000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x0, 1939, }, + { 68, 5, 1, 0xa8000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x40, 34, }, + { 69, 5, 1, 0x80000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x0, 1856, }, + { 70, 5, 1, 0xa0000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x0, 1940, }, + { 70, 5, 1, 0xa0000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x40, 35, }, + { 71, 5, 1, 0xc8000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x0, 1013, }, + { 72, 5, 1, 0x00000000ull, 0x000fe000ull, { 17, 19, 20, 0, 0 }, 0x40, 1943, }, + { 73, 5, 1, 0x00000000ull, 0x00000000ull, { 17, 19, 20, 18, 0 }, 0x0, 1946, }, + { 73, 5, 1, 0x00000000ull, 0x00000000ull, { 17, 19, 20, 18, 0 }, 0x40, 37, }, + { 74, 5, 1, 0x88000000ull, 0xf8000000ull, { 17, 19, 0, 0, 0 }, 0xc0, 38, }, + { 75, 5, 1, 0x88000000ull, 0xf80fe000ull, { 17, 19, 0, 0, 0 }, 0x40, 39, }, + { 76, 5, 1, 0x00000000ull, 0x00000000ull, { 17, 19, 20, 18, 0 }, 0x0, 1949, }, + { 76, 5, 1, 0x00000000ull, 0x00000000ull, { 17, 19, 20, 18, 0 }, 0x40, 40, }, + { 77, 5, 1, 0x00000000ull, 0x000fe000ull, { 17, 19, 20, 0, 0 }, 0x40, 1952, }, + { 78, 5, 1, 0x08000000ull, 0xf80fe000ull, { 17, 19, 0, 0, 0 }, 0x40, 1955, }, + { 79, 5, 1, 0x70000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x0, 43, }, + { 80, 5, 1, 0x80000000ull, 0xf80fe000ull, { 17, 19, 0, 0, 0 }, 0x40, 44, }, + { 81, 5, 1, 0x40000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x0, 45, }, + { 82, 5, 1, 0xb8000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x0, 1956, }, + { 82, 5, 1, 0xb8000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x40, 46, }, + { 83, 5, 1, 0xb0000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x0, 1957, }, + { 83, 5, 1, 0xb0000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x40, 47, }, + { 84, 5, 1, 0x80000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x0, 792, }, + { 84, 5, 1, 0x80000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x40, 793, }, + { 84, 5, 1, 0x88000000ull, 0xf8000000ull, { 17, 19, 18, 0, 0 }, 0x40, 934, }, + { 85, 5, 1, 0xc0000000ull, 0xf8000000ull, { 17, 18, 0, 0, 0 }, 0x0, 889, }, + { 85, 5, 1, 0xc0000000ull, 0xf8000000ull, { 17, 18, 0, 0, 0 }, 0x40, 890, }, + { 86, 5, 1, 0x00000000ull, 0x00000000ull, { 17, 19, 20, 18, 0 }, 0x0, 1974, }, + { 86, 5, 1, 0x00000000ull, 0x00000000ull, { 17, 19, 20, 18, 0 }, 0x40, 48, }, + { 87, 5, 1, 0xa8000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x0, 1975, }, + { 87, 5, 1, 0xa8000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x40, 49, }, + { 88, 5, 1, 0x80000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x0, 1864, }, + { 89, 5, 1, 0xa0000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x0, 1976, }, + { 89, 5, 1, 0xa0000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x40, 50, }, + { 90, 5, 1, 0x00000000ull, 0x000fe000ull, { 17, 19, 20, 0, 0 }, 0x40, 1977, }, + { 91, 5, 1, 0x00000000ull, 0x00000000ull, { 17, 19, 20, 18, 0 }, 0x0, 1978, }, + { 91, 5, 1, 0x00000000ull, 0x00000000ull, { 17, 19, 20, 18, 0 }, 0x40, 52, }, + { 92, 5, 1, 0x88000000ull, 0xf8000000ull, { 17, 19, 0, 0, 0 }, 0xc0, 53, }, + { 93, 5, 1, 0x88000000ull, 0xf80fe000ull, { 17, 19, 0, 0, 0 }, 0x40, 54, }, + { 94, 5, 1, 0x00000000ull, 0x00000000ull, { 17, 19, 20, 18, 0 }, 0x0, 1979, }, + { 94, 5, 1, 0x00000000ull, 0x00000000ull, { 17, 19, 20, 18, 0 }, 0x40, 55, }, + { 95, 5, 1, 0x00000000ull, 0x000fe000ull, { 17, 19, 20, 0, 0 }, 0x40, 1980, }, + { 96, 5, 2, 0x00000000ull, 0x00000000ull, { 17, 22, 18, 19, 0 }, 0x0, 1981, }, + { 96, 5, 2, 0x00000000ull, 0x00000000ull, { 17, 22, 18, 19, 0 }, 0x40, 57, }, + { 97, 5, 2, 0x00000000ull, 0x00000000ull, { 17, 22, 19, 0, 0 }, 0x0, 1982, }, + { 97, 5, 2, 0x00000000ull, 0x00000000ull, { 17, 22, 19, 0, 0 }, 0x40, 58, }, + { 98, 5, 2, 0x00000000ull, 0x00000000ull, { 17, 22, 18, 19, 0 }, 0x0, 1983, }, + { 98, 5, 2, 0x00000000ull, 0x00000000ull, { 17, 22, 18, 19, 0 }, 0x40, 59, }, + { 99, 5, 2, 0x00000000ull, 0x00000000ull, { 17, 22, 19, 0, 0 }, 0x0, 1984, }, + { 99, 5, 2, 0x00000000ull, 0x00000000ull, { 17, 22, 19, 0, 0 }, 0x40, 60, }, + { 100, 5, 1, 0x00000000ull, 0x00000000ull, { 17, 19, 20, 18, 0 }, 0x0, 61, }, + { 101, 5, 0, 0x20000000ull, 0xf8000000ull, { 49, 50, 0, 0, 0 }, 0x0, 1985, }, + { 101, 5, 0, 0x20000000ull, 0xf8000000ull, { 49, 50, 0, 0, 0 }, 0x40, 62, }, + { 102, 5, 1, 0x08000000ull, 0xf8000000ull, { 17, 19, 18, 0, 0 }, 0x40, 1988, }, + { 103, 5, 1, 0xa0000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x0, 64, }, + { 104, 5, 1, 0xe0000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x0, 1819, }, + { 105, 3, 0, 0x00000000ull, 0xf8000000ull, { 0, 0, 0, 0, 0 }, 0x0, 65, }, + { 107, 5, 1, 0x78000000ull, 0xf8000000ull, { 17, 18, 19, 0, 0 }, 0x0, 66, }, + { 112, 3, 1, 0x08000000ull, 0xc8000000ull, { 23, 18, 0, 0, 0 }, 0x0, 2294, }, + { 121, 3, 0, 0x80000000ull, 0xf8000000ull, { 0, 0, 0, 0, 0 }, 0x0, 67, }, + { 121, 3, 0, 0x90000000ull, 0xf8000000ull, { 23, 0, 0, 0, 0 }, 0x0, 775, }, + { 121, 3, 0, 0x98000000ull, 0xf8000000ull, { 17, 0, 0, 0, 0 }, 0x0, 776, }, + { 122, 3, 0, 0x70000000ull, 0xf8000000ull, { 24, 0, 0, 0, 0 }, 0xc, 701, }, + { 123, 3, 1, 0x70000000ull, 0xf8000000ull, { 29, 24, 0, 0, 0 }, 0x8, 702, }, + { 123, 3, 1, 0x78000000ull, 0xf8000000ull, { 30, 24, 0, 0, 0 }, 0x8, 952, }, + { 125, 3, 1, 0x00000000ull, 0xf8000000ull, { 23, 32, 0, 0, 0 }, 0x0, 68, }, + { 125, 3, 1, 0x00000000ull, 0xf8000000ull, { 23, 32, 24, 0, 0 }, 0x400, 69, }, + { 125, 3, 1, 0x00000000ull, 0xf0000000ull, { 23, 32, 61, 0, 0 }, 0x400, 70, }, + { 126, 3, 1, 0x40000000ull, 0xf8000000ull, { 23, 32, 0, 0, 0 }, 0x0, 71, }, + { 126, 3, 1, 0x40000000ull, 0xf8000000ull, { 23, 32, 24, 0, 0 }, 0x400, 72, }, + { 126, 3, 1, 0x40000000ull, 0xf0000000ull, { 23, 32, 61, 0, 0 }, 0x400, 73, }, + { 127, 3, 1, 0x80000000ull, 0xf8000000ull, { 23, 32, 0, 0, 0 }, 0x0, 74, }, + { 127, 3, 1, 0x80000000ull, 0xf8000000ull, { 23, 32, 24, 0, 0 }, 0x400, 75, }, + { 127, 3, 1, 0x80000000ull, 0xf0000000ull, { 23, 32, 61, 0, 0 }, 0x400, 76, }, + { 128, 3, 1, 0xc0000000ull, 0xf8000000ull, { 23, 32, 0, 0, 0 }, 0x0, 77, }, + { 128, 3, 1, 0xc0000000ull, 0xf8000000ull, { 23, 32, 24, 0, 0 }, 0x400, 78, }, + { 128, 3, 1, 0xc0000000ull, 0xf0000000ull, { 23, 32, 61, 0, 0 }, 0x400, 79, }, + { 129, 3, 1, 0xc0000000ull, 0xf8000000ull, { 17, 32, 0, 0, 0 }, 0x0, 884, }, + { 129, 3, 1, 0xc0000000ull, 0xf8000000ull, { 17, 32, 24, 0, 0 }, 0x400, 885, }, + { 129, 3, 1, 0xc0000000ull, 0xf0000000ull, { 17, 32, 61, 0, 0 }, 0x400, 886, }, + { 130, 3, 1, 0x40000000ull, 0xf8000000ull, { 17, 32, 0, 0, 0 }, 0x0, 80, }, + { 130, 3, 1, 0x40000000ull, 0xf8000000ull, { 17, 32, 24, 0, 0 }, 0x400, 81, }, + { 130, 3, 1, 0x40000000ull, 0xf0000000ull, { 17, 32, 61, 0, 0 }, 0x400, 82, }, + { 131, 3, 1, 0xc0000000ull, 0xf8000000ull, { 17, 32, 0, 0, 0 }, 0x0, 83, }, + { 131, 3, 1, 0xc0000000ull, 0xf8000000ull, { 17, 32, 24, 0, 0 }, 0x400, 84, }, + { 131, 3, 1, 0xc0000000ull, 0xf0000000ull, { 17, 32, 61, 0, 0 }, 0x400, 85, }, + { 132, 3, 1, 0x00000000ull, 0xf8000000ull, { 17, 32, 0, 0, 0 }, 0x0, 86, }, + { 132, 3, 1, 0x00000000ull, 0xf8000000ull, { 17, 32, 24, 0, 0 }, 0x400, 87, }, + { 132, 3, 1, 0x00000000ull, 0xf0000000ull, { 17, 32, 61, 0, 0 }, 0x400, 88, }, + { 133, 3, 2, 0x48000000ull, 0xf8000000ull, { 17, 18, 32, 0, 0 }, 0x0, 89, }, + { 133, 3, 2, 0x48000000ull, 0xf8000000ull, { 17, 18, 32, 5, 0 }, 0x400, 90, }, + { 134, 3, 2, 0xc8000000ull, 0xf8000000ull, { 17, 18, 32, 0, 0 }, 0x0, 91, }, + { 134, 3, 2, 0xc8000000ull, 0xf8000000ull, { 17, 18, 32, 5, 0 }, 0x400, 92, }, + { 135, 3, 2, 0x88000000ull, 0xf8000000ull, { 17, 18, 32, 0, 0 }, 0x0, 93, }, + { 135, 3, 2, 0x88000000ull, 0xf8000000ull, { 17, 18, 32, 4, 0 }, 0x400, 94, }, + { 136, 3, 1, 0x80000000ull, 0xf8000000ull, { 17, 32, 0, 0, 0 }, 0x0, 95, }, + { 136, 3, 1, 0x80000000ull, 0xf8000000ull, { 17, 32, 24, 0, 0 }, 0x400, 96, }, + { 136, 3, 1, 0x80000000ull, 0xf0000000ull, { 17, 32, 61, 0, 0 }, 0x400, 97, }, + { 139, 3, 0, 0x00000000ull, 0xf8000000ull, { 32, 0, 0, 0, 0 }, 0x0, 98, }, + { 139, 3, 0, 0x00000000ull, 0xf8000000ull, { 32, 24, 0, 0, 0 }, 0x400, 99, }, + { 139, 3, 0, 0x00000000ull, 0xf0000000ull, { 32, 61, 0, 0, 0 }, 0x400, 100, }, + { 140, 3, 0, 0x50000000ull, 0xf8000000ull, { 0, 0, 0, 0, 0 }, 0x21, 101, }, + { 148, 3, 0, 0x10000000ull, 0xf8000000ull, { 0, 0, 0, 0, 0 }, 0x0, 102, }, + { 149, 2, 1, 0x80000000ull, 0xf0000000ull, { 23, 24, 25, 0, 0 }, 0x0, 1820, }, + { 150, 2, 1, 0x80000000ull, 0xf0000000ull, { 23, 24, 25, 0, 0 }, 0x0, 1821, }, + { 151, 2, 1, 0x80000000ull, 0xf0000000ull, { 23, 24, 25, 0, 0 }, 0x0, 1822, }, + { 152, 1, 1, 0x00000000ull, 0xf80fe000ull, { 23, 25, 0, 0, 0 }, 0x0, 103, }, + { 152, 1, 1, 0x00000000ull, 0x07f00000ull, { 23, 62, 0, 0, 0 }, 0x40, 104, }, + { 152, 1, 1, 0x00000000ull, 0x00300000ull, { 23, 65, 0, 0, 0 }, 0x40, 105, }, + { 152, 5, 1, 0x80000000ull, 0xf8000000ull, { 17, 19, 0, 0, 0 }, 0xc0, 106, }, + { 152, 2, 1, 0x00100000ull, 0x00f00000ull, { 14, 24, 0, 0, 0 }, 0x40, 107, }, + { 152, 2, 1, 0x00000000ull, 0x00f00000ull, { 14, 24, 77, 0, 0 }, 0x0, 2368, }, + { 152, 2, 1, 0x88000000ull, 0xf8000000ull, { 23, 15, 0, 0, 0 }, 0x0, 109, }, + { 152, 2, 1, 0x00000000ull, 0x00000000ull, { 8, 24, 63, 0, 0 }, 0x0, 110, }, + { 152, 2, 1, 0x00000000ull, 0x00000000ull, { 9, 67, 0, 0, 0 }, 0x0, 111, }, + { 152, 2, 1, 0x80000000ull, 0xf8000000ull, { 23, 7, 0, 0, 0 }, 0x0, 112, }, + { 152, 2, 1, 0x98000000ull, 0xf8000000ull, { 23, 8, 0, 0, 0 }, 0x0, 113, }, + { 152, 2, 1, 0x50000000ull, 0xf8000000ull, { 13, 24, 0, 0, 0 }, 0x0, 953, }, + { 152, 2, 1, 0x50000000ull, 0xf8000000ull, { 13, 54, 0, 0, 0 }, 0x0, 954, }, + { 152, 2, 1, 0x90000000ull, 0xf8000000ull, { 23, 13, 0, 0, 0 }, 0x0, 955, }, + { 152, 3, 1, 0x40000000ull, 0xf8000000ull, { 13, 54, 0, 0, 0 }, 0x0, 1041, }, + { 152, 3, 1, 0x50000000ull, 0xf8000000ull, { 13, 24, 0, 0, 0 }, 0x0, 1042, }, + { 152, 3, 1, 0x10000000ull, 0xf8000000ull, { 23, 13, 0, 0, 0 }, 0x0, 1043, }, + { 152, 3, 1, 0x60000000ull, 0xf8000000ull, { 16, 24, 0, 0, 0 }, 0x8, 114, }, + { 152, 3, 1, 0x20000000ull, 0xf8000000ull, { 23, 16, 0, 0, 0 }, 0x8, 115, }, + { 152, 3, 1, 0x68000000ull, 0xf8000000ull, { 11, 24, 0, 0, 0 }, 0x8, 116, }, + { 152, 3, 1, 0x48000000ull, 0xf8000000ull, { 12, 24, 0, 0, 0 }, 0x0, 117, }, + { 152, 3, 1, 0x28000000ull, 0xf8000000ull, { 23, 10, 0, 0, 0 }, 0x8, 118, }, + { 152, 3, 1, 0x08000000ull, 0xf8000000ull, { 23, 12, 0, 0, 0 }, 0x0, 119, }, + { 152, 3, 1, 0x00000000ull, 0xf8000000ull, { 37, 24, 0, 0, 0 }, 0x8, 120, }, + { 152, 3, 1, 0x08000000ull, 0xf8000000ull, { 28, 24, 0, 0, 0 }, 0x8, 121, }, + { 152, 3, 1, 0x10000000ull, 0xf8000000ull, { 31, 24, 0, 0, 0 }, 0x8, 122, }, + { 152, 3, 1, 0x18000000ull, 0xf8000000ull, { 34, 24, 0, 0, 0 }, 0x8, 123, }, + { 152, 3, 1, 0x20000000ull, 0xf8000000ull, { 35, 24, 0, 0, 0 }, 0x8, 124, }, + { 152, 3, 1, 0x28000000ull, 0xf8000000ull, { 36, 24, 0, 0, 0 }, 0x8, 125, }, + { 152, 3, 1, 0x30000000ull, 0xf8000000ull, { 33, 24, 0, 0, 0 }, 0x8, 126, }, + { 152, 3, 1, 0x80000000ull, 0xf8000000ull, { 23, 37, 0, 0, 0 }, 0x8, 127, }, + { 152, 3, 1, 0x88000000ull, 0xf8000000ull, { 23, 28, 0, 0, 0 }, 0x8, 128, }, + { 152, 3, 1, 0x90000000ull, 0xf8000000ull, { 23, 31, 0, 0, 0 }, 0x8, 129, }, + { 152, 3, 1, 0x98000000ull, 0xf8000000ull, { 23, 34, 0, 0, 0 }, 0x8, 130, }, + { 152, 3, 1, 0xa0000000ull, 0xf8000000ull, { 23, 35, 0, 0, 0 }, 0x8, 131, }, + { 152, 3, 1, 0xa8000000ull, 0xf8000000ull, { 23, 36, 0, 0, 0 }, 0x0, 132, }, + { 152, 3, 1, 0xb0000000ull, 0xf8000000ull, { 23, 33, 0, 0, 0 }, 0x8, 133, }, + { 152, 3, 1, 0xb8000000ull, 0xf8000000ull, { 23, 27, 0, 0, 0 }, 0x0, 134, }, + { 152, 7, 1, 0x00000000ull, 0x00000000ull, { 23, 13, 0, 0, 0 }, 0x0, 135, }, + { 152, 7, 1, 0x00000000ull, 0x00000000ull, { 13, 54, 0, 0, 0 }, 0x0, 136, }, + { 152, 7, 1, 0x00000000ull, 0x00000000ull, { 13, 24, 0, 0, 0 }, 0x0, 137, }, + { 153, 6, 1, 0x00000000ull, 0x00100000ull, { 23, 69, 0, 0, 0 }, 0x0, 138, }, + { 154, 2, 1, 0xa0000000ull, 0xf0000000ull, { 23, 24, 73, 0, 0 }, 0x0, 139, }, + { 155, 2, 1, 0xa0000000ull, 0xf0000000ull, { 23, 24, 74, 0, 0 }, 0x0, 140, }, + { 165, 4, 0, 0x00000000ull, 0xf8000000ull, { 64, 0, 0, 0, 0 }, 0x0, 394, }, + { 165, 5, 0, 0x08000000ull, 0xf8000000ull, { 64, 0, 0, 0, 0 }, 0x0, 807, }, + { 165, 2, 0, 0x08000000ull, 0xf8000000ull, { 64, 0, 0, 0, 0 }, 0x2, 956, }, + { 165, 3, 0, 0x08000000ull, 0xf8000000ull, { 64, 0, 0, 0, 0 }, 0x0, 1044, }, + { 165, 6, 0, 0x08000000ull, 0xf8000000ull, { 68, 0, 0, 0, 0 }, 0x0, 2484, }, + { 165, 7, 0, 0x00000000ull, 0x00000000ull, { 64, 0, 0, 0, 0 }, 0x0, 141, }, + { 172, 1, 1, 0x70000000ull, 0xf8000000ull, { 23, 24, 25, 0, 0 }, 0x0, 142, }, + { 172, 1, 1, 0x70000000ull, 0xf8000000ull, { 23, 54, 25, 0, 0 }, 0x0, 143, }, + { 175, 2, 1, 0x00000000ull, 0xf0000000ull, { 23, 24, 25, 0, 0 }, 0x0, 2467, }, + { 176, 2, 1, 0x20000000ull, 0xf0000000ull, { 23, 24, 25, 0, 0 }, 0x0, 2370, }, + { 177, 1, 1, 0x00000000ull, 0xf8000000ull, { 23, 24, 25, 0, 0 }, 0x0, 144, }, + { 178, 1, 1, 0x00000000ull, 0xf8000000ull, { 23, 24, 25, 0, 0 }, 0x0, 145, }, + { 179, 1, 1, 0x00000000ull, 0xf8000000ull, { 23, 24, 25, 0, 0 }, 0x0, 146, }, + { 180, 1, 1, 0x50000000ull, 0xf8000000ull, { 23, 24, 25, 0, 0 }, 0x0, 147, }, + { 181, 1, 1, 0x50000000ull, 0xf8000000ull, { 23, 24, 25, 0, 0 }, 0x0, 148, }, + { 182, 1, 1, 0x70000000ull, 0xf8000000ull, { 23, 24, 25, 0, 0 }, 0x0, 149, }, + { 183, 1, 1, 0x70000000ull, 0xf8000000ull, { 23, 24, 25, 0, 0 }, 0x0, 150, }, + { 184, 1, 1, 0x20000000ull, 0xf8000000ull, { 23, 24, 25, 0, 0 }, 0x0, 794, }, + { 185, 1, 1, 0x20000000ull, 0xf8000000ull, { 23, 24, 25, 0, 0 }, 0x0, 795, }, + { 186, 1, 1, 0x20000000ull, 0xf8000000ull, { 23, 24, 25, 0, 0 }, 0x0, 796, }, + { 187, 2, 1, 0x50000000ull, 0xf0000000ull, { 23, 24, 25, 0, 0 }, 0x0, 2384, }, + { 188, 2, 1, 0x70000000ull, 0xf0000000ull, { 23, 24, 25, 0, 0 }, 0x0, 151, }, + { 189, 2, 1, 0x10000000ull, 0xf0000000ull, { 23, 24, 25, 0, 0 }, 0x0, 2385, }, + { 190, 2, 1, 0x30000000ull, 0xf0000000ull, { 23, 24, 25, 0, 0 }, 0x0, 152, }, + { 191, 2, 1, 0xd0000000ull, 0xf0000000ull, { 23, 24, 25, 0, 0 }, 0x0, 1823, }, + { 192, 2, 1, 0x30000000ull, 0x30000000ull, { 23, 24, 25, 41, 0 }, 0x0, 153, }, + { 193, 2, 1, 0x90000000ull, 0xf0000000ull, { 23, 25, 0, 0, 0 }, 0x0, 154, }, + { 195, 3, 1, 0xc0000000ull, 0xf8000000ull, { 23, 25, 24, 0, 0 }, 0x0, 1824, }, + { 195, 3, 1, 0xc0000000ull, 0xf8000000ull, { 23, 25, 48, 0, 0 }, 0x0, 1825, }, + { 195, 3, 0, 0x88000000ull, 0xf8000000ull, { 25, 48, 0, 0, 0 }, 0x0, 1847, }, + { 196, 2, 1, 0xb0000000ull, 0xf0000000ull, { 23, 24, 25, 0, 0 }, 0x0, 155, }, + { 197, 2, 1, 0x40000000ull, 0xf0000000ull, { 23, 24, 25, 0, 0 }, 0x0, 156, }, + { 197, 2, 1, 0x50000000ull, 0xf0000000ull, { 23, 24, 38, 0, 0 }, 0x0, 157, }, + { 198, 2, 1, 0x40000000ull, 0xf0000000ull, { 23, 24, 25, 0, 0 }, 0x0, 158, }, + { 198, 2, 1, 0x50000000ull, 0xf0000000ull, { 23, 24, 38, 0, 0 }, 0x0, 159, }, + { 199, 1, 1, 0x80000000ull, 0xe0000000ull, { 23, 24, 40, 25, 0 }, 0x0, 160, }, + { 200, 2, 1, 0x20000000ull, 0xf0000000ull, { 23, 25, 24, 0, 0 }, 0x0, 161, }, + { 200, 2, 1, 0x30000000ull, 0xf0000000ull, { 23, 25, 42, 0, 0 }, 0x0, 162, }, + { 201, 2, 1, 0x20000000ull, 0xf0000000ull, { 23, 25, 24, 0, 0 }, 0x0, 163, }, + { 201, 2, 1, 0x30000000ull, 0xf0000000ull, { 23, 25, 42, 0, 0 }, 0x0, 164, }, + { 202, 1, 1, 0xc0000000ull, 0xe0000000ull, { 23, 24, 40, 25, 0 }, 0x0, 165, }, + { 203, 1, 1, 0x20000000ull, 0xf8000000ull, { 23, 24, 25, 0, 0 }, 0x0, 166, }, + { 204, 1, 1, 0x20000000ull, 0xf8000000ull, { 23, 24, 25, 0, 0 }, 0x0, 167, }, + { 205, 1, 1, 0x20000000ull, 0xf8000000ull, { 23, 24, 25, 0, 0 }, 0x0, 168, }, + { 206, 3, 0, 0x48000000ull, 0xf8000000ull, { 25, 24, 0, 0, 0 }, 0x8, 984, }, + { 206, 3, 0, 0x50000000ull, 0xf8000000ull, { 25, 24, 0, 0, 0 }, 0xc, 895, }, + { 206, 3, 0, 0xa0000000ull, 0xf8000000ull, { 25, 0, 0, 0, 0 }, 0x8, 777, }, + { 207, 3, 0, 0x60000000ull, 0xf8000000ull, { 25, 24, 0, 0, 0 }, 0x8, 703, }, + { 212, 4, 0, 0x40000000ull, 0xf8000000ull, { 0, 0, 0, 0, 0 }, 0x22c, 169, }, + { 213, 3, 0, 0x38000000ull, 0x78000000ull, { 66, 0, 0, 0, 0 }, 0x8, 170, }, + { 214, 3, 0, 0x28000000ull, 0x78000000ull, { 66, 0, 0, 0, 0 }, 0x0, 171, }, + { 223, 3, 1, 0x08000000ull, 0xc8000000ull, { 17, 24, 0, 0, 0 }, 0x0, 2295, }, + { 224, 2, 1, 0x00000000ull, 0x04000000ull, { 23, 24, 44, 0, 0 }, 0x140, 172, }, + { 224, 2, 1, 0x40000000ull, 0xf0000000ull, { 23, 24, 25, 0, 0 }, 0x0, 173, }, + { 225, 1, 1, 0x80000000ull, 0xe0000000ull, { 23, 24, 39, 25, 0 }, 0x0, 174, }, + { 226, 1, 1, 0xc0000000ull, 0xe0000000ull, { 23, 24, 39, 25, 0 }, 0x0, 175, }, + { 227, 2, 1, 0x00000000ull, 0x00002000ull, { 23, 25, 75, 0, 0 }, 0x140, 2391, }, + { 227, 2, 1, 0x20000000ull, 0xf0000000ull, { 23, 25, 24, 0, 0 }, 0x0, 177, }, + { 228, 2, 1, 0x00000000ull, 0x00000000ull, { 23, 24, 25, 43, 0 }, 0x0, 178, }, + { 233, 3, 0, 0x80000000ull, 0xf8000000ull, { 0, 0, 0, 0, 0 }, 0x0, 705, }, + { 234, 3, 0, 0x30000000ull, 0x78000000ull, { 66, 0, 0, 0, 0 }, 0x8, 179, }, + { 236, 3, 1, 0x00000000ull, 0xf8000000ull, { 32, 24, 0, 0, 0 }, 0x0, 180, }, + { 236, 3, 1, 0x00000000ull, 0xf0000000ull, { 32, 24, 60, 0, 0 }, 0x400, 181, }, + { 237, 3, 1, 0x40000000ull, 0xf8000000ull, { 32, 24, 0, 0, 0 }, 0x0, 182, }, + { 237, 3, 1, 0x40000000ull, 0xf0000000ull, { 32, 24, 60, 0, 0 }, 0x400, 183, }, + { 238, 3, 1, 0x80000000ull, 0xf8000000ull, { 32, 24, 0, 0, 0 }, 0x0, 184, }, + { 238, 3, 1, 0x80000000ull, 0xf0000000ull, { 32, 24, 60, 0, 0 }, 0x400, 185, }, + { 239, 3, 1, 0xc0000000ull, 0xf8000000ull, { 32, 24, 0, 0, 0 }, 0x0, 186, }, + { 239, 3, 1, 0xc0000000ull, 0xf0000000ull, { 32, 24, 60, 0, 0 }, 0x400, 187, }, + { 240, 3, 1, 0xc0000000ull, 0xf8000000ull, { 32, 18, 0, 0, 0 }, 0x0, 2298, }, + { 240, 3, 1, 0xc0000000ull, 0xf0000000ull, { 32, 18, 60, 0, 0 }, 0x400, 2299, }, + { 241, 3, 1, 0x40000000ull, 0xf8000000ull, { 32, 18, 0, 0, 0 }, 0x0, 188, }, + { 241, 3, 1, 0x40000000ull, 0xf0000000ull, { 32, 18, 60, 0, 0 }, 0x400, 189, }, + { 242, 3, 1, 0xc0000000ull, 0xf8000000ull, { 32, 18, 0, 0, 0 }, 0x0, 190, }, + { 242, 3, 1, 0xc0000000ull, 0xf0000000ull, { 32, 18, 60, 0, 0 }, 0x400, 191, }, + { 243, 3, 1, 0x00000000ull, 0xf8000000ull, { 32, 18, 0, 0, 0 }, 0x0, 192, }, + { 243, 3, 1, 0x00000000ull, 0xf0000000ull, { 32, 18, 60, 0, 0 }, 0x400, 193, }, + { 244, 3, 1, 0x80000000ull, 0xf8000000ull, { 32, 18, 0, 0, 0 }, 0x0, 194, }, + { 244, 3, 1, 0x80000000ull, 0xf0000000ull, { 32, 18, 60, 0, 0 }, 0x400, 195, }, + { 245, 1, 1, 0x28000000ull, 0xf8000000ull, { 23, 24, 25, 0, 0 }, 0x0, 196, }, + { 245, 1, 1, 0x20000000ull, 0xf8000000ull, { 23, 24, 25, 3, 0 }, 0x0, 197, }, + { 245, 1, 1, 0x28000000ull, 0xf8000000ull, { 23, 54, 25, 0, 0 }, 0x0, 198, }, + { 246, 3, 0, 0x20000000ull, 0x78000000ull, { 66, 0, 0, 0, 0 }, 0x0, 199, }, + { 247, 2, 1, 0xa0000000ull, 0xf8000000ull, { 23, 25, 0, 0, 0 }, 0x0, 200, }, + { 248, 2, 1, 0xa8000000ull, 0xf8000000ull, { 23, 25, 0, 0, 0 }, 0x0, 201, }, + { 249, 2, 1, 0xb0000000ull, 0xf8000000ull, { 23, 25, 0, 0, 0 }, 0x0, 202, }, + { 250, 3, 0, 0x98000000ull, 0xf8000000ull, { 0, 0, 0, 0, 0 }, 0x0, 959, }, + { 251, 3, 1, 0xf8000000ull, 0xf8000000ull, { 23, 25, 0, 0, 0 }, 0x8, 203, }, + { 252, 2, 2, 0x00000000ull, 0x00003000ull, { 21, 22, 25, 75, 0 }, 0x0, 2489, }, + { 252, 2, 2, 0x00000000ull, 0x00003000ull, { 22, 21, 25, 75, 0 }, 0x40, 1724, }, + { 253, 3, 1, 0xd0000000ull, 0xf8000000ull, { 23, 25, 0, 0, 0 }, 0x0, 204, }, + { 254, 2, 2, 0x00002000ull, 0x00003000ull, { 21, 22, 25, 0, 0 }, 0x0, 2491, }, + { 254, 2, 2, 0x00002000ull, 0x00003000ull, { 22, 21, 25, 0, 0 }, 0x40, 1726, }, + { 255, 3, 1, 0xf0000000ull, 0xf8000000ull, { 23, 25, 0, 0, 0 }, 0x8, 205, }, + { 257, 3, 1, 0xd8000000ull, 0xf8000000ull, { 23, 25, 0, 0, 0 }, 0x0, 206, }, + { 261, 2, 1, 0x40000000ull, 0xf0000000ull, { 23, 24, 25, 0, 0 }, 0x0, 942, }, + { 262, 2, 1, 0x40000000ull, 0xf0000000ull, { 23, 24, 25, 0, 0 }, 0x0, 943, }, + { 263, 2, 1, 0x40000000ull, 0xf0000000ull, { 23, 24, 25, 0, 0 }, 0x0, 944, }, + { 271, 3, 1, 0x08000000ull, 0xf8000000ull, { 23, 32, 24, 0, 0 }, 0x0, 207, }, + { 272, 3, 1, 0x48000000ull, 0xf8000000ull, { 23, 32, 24, 0, 0 }, 0x0, 208, }, + { 273, 3, 1, 0x88000000ull, 0xf8000000ull, { 23, 32, 24, 0, 0 }, 0x0, 209, }, + { 274, 3, 1, 0xc8000000ull, 0xf8000000ull, { 23, 32, 24, 0, 0 }, 0x0, 210, }, + { 276, 5, 1, 0x00000000ull, 0x00000000ull, { 17, 19, 20, 18, 0 }, 0x0, 988, }, + { 276, 5, 1, 0x00000000ull, 0x00000000ull, { 17, 19, 20, 18, 0 }, 0x40, 1036, }, + { 277, 5, 1, 0x00000000ull, 0x000fe000ull, { 17, 19, 20, 0, 0 }, 0x40, 989, }, + { 278, 1, 1, 0x78000000ull, 0xf8000000ull, { 23, 24, 25, 0, 0 }, 0x0, 211, }, + { 278, 1, 1, 0x78000000ull, 0xf8000000ull, { 23, 54, 25, 0, 0 }, 0x0, 212, }, + { 281, 2, 1, 0x80000000ull, 0xf8000000ull, { 23, 25, 0, 0, 0 }, 0x0, 213, }, + { 282, 2, 1, 0x88000000ull, 0xf8000000ull, { 23, 25, 0, 0, 0 }, 0x0, 214, }, + { 283, 2, 1, 0x90000000ull, 0xf8000000ull, { 23, 25, 0, 0, 0 }, 0x0, 215, }, +}; + +static const char dis_table[] = { +0xa0, 0xc2, 0x60, 0xa0, 0x2c, 0x80, 0xa0, 0x2a, 0x80, 0xa0, 0x1a, 0x70, +0x98, 0xb0, 0x01, 0x40, 0x90, 0x50, 0x90, 0x28, 0x24, 0x31, 0x48, 0x24, +0x31, 0x40, 0x90, 0x28, 0x24, 0x31, 0x38, 0x24, 0x31, 0x30, 0x90, 0x50, +0x90, 0x28, 0x24, 0x31, 0x20, 0x24, 0x31, 0x18, 0x90, 0x28, 0x24, 0x31, +0x10, 0x24, 0x31, 0x08, 0xa8, 0x0b, 0x28, 0x15, 0x00, 0x97, 0x00, 0x95, +0xa8, 0x9a, 0x98, 0x05, 0x18, 0x90, 0xf8, 0x90, 0x80, 0x90, 0x40, 0x80, +0xa4, 0x21, 0x18, 0x34, 0x26, 0x80, 0xa4, 0x2e, 0xc0, 0x35, 0xdd, 0x90, +0x50, 0x90, 0x28, 0x80, 0x35, 0xd3, 0x80, 0x34, 0x0a, 0x81, 0x33, 0xa6, +0x90, 0xe0, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x20, 0x30, 0x34, 0x07, 0xa4, +0x1d, 0x28, 0x34, 0x04, 0x90, 0x38, 0xa4, 0x30, 0xc0, 0x36, 0x1e, 0xa4, +0x30, 0x68, 0x36, 0x12, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x2f, 0x40, 0x35, +0xf3, 0xa4, 0x2f, 0x18, 0x35, 0xee, 0x80, 0xa4, 0x20, 0x10, 0x34, 0x03, +0x92, 0x18, 0x91, 0xc0, 0x80, 0x91, 0x80, 0x90, 0xf8, 0xdb, 0x84, 0x60, +0xea, 0x40, 0xc0, 0xc0, 0x80, 0xa4, 0x3a, 0x70, 0x8c, 0x3b, 0xd0, 0x84, +0x37, 0x84, 0xc0, 0xc0, 0x80, 0xa4, 0x3a, 0x60, 0x8c, 0x3b, 0xb0, 0x84, +0x37, 0x82, 0xd3, 0x82, 0x40, 0x50, 0xc0, 0xc0, 0x81, 0x37, 0x36, 0x50, +0xc0, 0xc0, 0x81, 0x37, 0x34, 0xa4, 0x1d, 0x38, 0x33, 0xa8, 0x80, 0x90, +0x28, 0x80, 0x33, 0xa4, 0x80, 0x34, 0x0c, 0x81, 0x90, 0x38, 0xa4, 0x20, +0x98, 0x34, 0x0f, 0xa4, 0x20, 0x68, 0x34, 0x09, 0xc0, 0x40, 0x10, 0x10, +0x90, 0x38, 0xa4, 0x1d, 0x10, 0x33, 0xa3, 0xa4, 0x1d, 0x00, 0x33, 0xa1, +0x18, 0x24, 0x21, 0x10, 0x83, 0x90, 0xa8, 0xd3, 0x82, 0xc0, 0xc0, 0xc0, +0x80, 0xa4, 0x3a, 0x40, 0x37, 0x6e, 0xc0, 0xc0, 0x80, 0xa4, 0x3a, 0x30, +0x37, 0x6a, 0xd3, 0x82, 0x40, 0x50, 0xc0, 0xc0, 0x81, 0x37, 0x30, 0x50, +0xc0, 0xc0, 0x81, 0x37, 0x2e, 0x92, 0xb8, 0x99, 0x84, 0x20, 0x88, 0x90, +0x78, 0x90, 0x50, 0x10, 0x10, 0x80, 0xa4, 0x2e, 0xb8, 0x35, 0xdc, 0x82, +0x35, 0xd2, 0x90, 0x80, 0x10, 0x10, 0x90, 0x38, 0xa4, 0x30, 0xb8, 0x36, +0x1d, 0xa4, 0x30, 0x60, 0x36, 0x11, 0x80, 0x90, 0x38, 0xa4, 0x2f, 0x38, +0x35, 0xf2, 0xa4, 0x2f, 0x10, 0x35, 0xed, 0x83, 0x90, 0xa8, 0xd3, 0x82, +0xc0, 0xc0, 0xc0, 0x80, 0xa4, 0x3a, 0x10, 0x37, 0x62, 0xc0, 0xc0, 0x80, +0xa4, 0x3a, 0x00, 0x37, 0x5e, 0xd3, 0x82, 0x40, 0x50, 0xc0, 0xc0, 0x81, +0x37, 0x2a, 0x50, 0xc0, 0xc0, 0x81, 0x37, 0x28, 0x18, 0x24, 0x20, 0x90, +0x83, 0x90, 0xa8, 0xd3, 0x82, 0xc0, 0xc0, 0xc0, 0x80, 0xa4, 0x39, 0xe0, +0x37, 0x56, 0xc0, 0xc0, 0x80, 0xa4, 0x39, 0xd0, 0x37, 0x52, 0xd3, 0x82, +0x40, 0x50, 0xc0, 0xc0, 0x81, 0x37, 0x24, 0x50, 0xc0, 0xc0, 0x81, 0x37, +0x22, 0x94, 0x50, 0x92, 0xf8, 0x99, 0x84, 0x1d, 0x68, 0x90, 0x78, 0x90, +0x50, 0x10, 0x10, 0x80, 0xa4, 0x2e, 0xb0, 0x35, 0xdb, 0x82, 0x35, 0xd1, +0x90, 0x80, 0x10, 0x10, 0x90, 0x38, 0xa4, 0x30, 0xb0, 0x36, 0x1c, 0xa4, +0x30, 0x58, 0x36, 0x10, 0x80, 0x90, 0x38, 0xa4, 0x2f, 0x30, 0x35, 0xf1, +0xa4, 0x2f, 0x08, 0x35, 0xec, 0x83, 0x90, 0xe8, 0xd3, 0x83, 0xc0, 0xc0, +0xc0, 0x80, 0xa4, 0x3a, 0x80, 0x8c, 0x3b, 0xf0, 0x84, 0x37, 0x86, 0xc0, +0xc0, 0x80, 0xa4, 0x3a, 0x68, 0x8c, 0x3b, 0xc0, 0x84, 0x37, 0x83, 0xd3, +0x82, 0x40, 0x50, 0xc0, 0xc0, 0x81, 0x37, 0x38, 0x50, 0xc0, 0xc0, 0x81, +0x37, 0x35, 0x18, 0x24, 0x1d, 0x60, 0x83, 0x90, 0xa8, 0xd3, 0x82, 0xc0, +0xc0, 0xc0, 0x80, 0xa4, 0x3a, 0x50, 0x37, 0x72, 0xc0, 0xc0, 0x80, 0xa4, +0x3a, 0x38, 0x37, 0x6c, 0xd3, 0x82, 0x40, 0x50, 0xc0, 0xc0, 0x81, 0x37, +0x32, 0x50, 0xc0, 0xc0, 0x81, 0x37, 0x2f, 0x92, 0xb8, 0x99, 0x84, 0x1d, +0x58, 0x90, 0x78, 0x90, 0x50, 0x10, 0x10, 0x80, 0xa4, 0x2e, 0xa8, 0x35, +0xda, 0x82, 0x35, 0xd0, 0x90, 0x80, 0x10, 0x10, 0x90, 0x38, 0xa4, 0x30, +0xa8, 0x36, 0x1b, 0xa4, 0x30, 0x50, 0x36, 0x0f, 0x80, 0x90, 0x38, 0xa4, +0x2f, 0x28, 0x35, 0xf0, 0xa4, 0x2f, 0x00, 0x35, 0xeb, 0x83, 0x90, 0xa8, +0xd3, 0x82, 0xc0, 0xc0, 0xc0, 0x80, 0xa4, 0x3a, 0x20, 0x37, 0x66, 0xc0, +0xc0, 0x80, 0xa4, 0x3a, 0x08, 0x37, 0x60, 0xd3, 0x82, 0x40, 0x50, 0xc0, +0xc0, 0x81, 0x37, 0x2c, 0x50, 0xc0, 0xc0, 0x81, 0x37, 0x29, 0x18, 0x20, +0x01, 0x48, 0x83, 0x90, 0xa8, 0xd3, 0x82, 0xc0, 0xc0, 0xc0, 0x80, 0xa4, +0x39, 0xf0, 0x37, 0x5a, 0xc0, 0xc0, 0x80, 0xa4, 0x39, 0xd8, 0x37, 0x54, +0xd3, 0x82, 0x40, 0x50, 0xc0, 0xc0, 0x81, 0x37, 0x26, 0x50, 0xc0, 0xc0, +0x81, 0x37, 0x23, 0xda, 0x06, 0xe0, 0xea, 0x80, 0x90, 0x60, 0x90, 0x38, +0xa4, 0x21, 0x00, 0x34, 0x1e, 0x80, 0x34, 0x1b, 0x90, 0x38, 0xa4, 0x20, +0xa8, 0x34, 0x19, 0x80, 0x34, 0x16, 0x90, 0x60, 0x90, 0x38, 0xa4, 0x20, +0xe8, 0x34, 0x1f, 0x80, 0x34, 0x1c, 0x90, 0x38, 0xa4, 0x20, 0xc0, 0x34, +0x1a, 0x80, 0x34, 0x17, 0xc8, 0x40, 0x18, 0x00, 0x91, 0x38, 0x90, 0x40, +0x82, 0xa4, 0x2e, 0x70, 0x35, 0xcf, 0x90, 0xc0, 0x80, 0x90, 0x90, 0x90, +0x48, 0xc9, 0xe1, 0x82, 0x00, 0x85, 0x36, 0x07, 0xc9, 0xe1, 0x81, 0x40, +0x85, 0x36, 0x04, 0x80, 0x36, 0x03, 0x10, 0x10, 0x81, 0x35, 0xdf, 0x90, +0xa8, 0x10, 0x10, 0x90, 0x28, 0x81, 0x35, 0xfd, 0x90, 0x38, 0xa4, 0x2f, +0xc0, 0x35, 0xf9, 0xa4, 0x2f, 0xb0, 0x35, 0xf7, 0x90, 0x70, 0x10, 0x10, +0x90, 0x38, 0xa4, 0x2f, 0xd8, 0x35, 0xfc, 0x80, 0x35, 0xfa, 0x90, 0x60, +0x90, 0x28, 0x24, 0x30, 0x10, 0xa4, 0x30, 0x00, 0x36, 0x01, 0x80, 0xa4, +0x2f, 0xf0, 0x35, 0xff, 0x80, 0x90, 0xf8, 0x90, 0x90, 0x90, 0x50, 0x90, +0x28, 0x80, 0x37, 0x1a, 0x80, 0x37, 0x21, 0x80, 0xa4, 0x38, 0xf8, 0x37, +0x20, 0x90, 0x28, 0x81, 0x37, 0x1e, 0x80, 0xa4, 0x38, 0xe0, 0x37, 0x1d, +0x83, 0x37, 0x1b, 0x98, 0xb0, 0x01, 0x40, 0x90, 0x50, 0x90, 0x28, 0x24, +0x2e, 0x60, 0x24, 0x2e, 0x58, 0x90, 0x28, 0x24, 0x2e, 0x50, 0x24, 0x2e, +0x48, 0x90, 0x50, 0x90, 0x28, 0x24, 0x2e, 0x38, 0x24, 0x2e, 0x30, 0x90, +0x28, 0x24, 0x2e, 0x28, 0x24, 0x2e, 0x20, 0xa8, 0x08, 0xe0, 0x0d, 0xe0, +0x96, 0x38, 0x95, 0xe8, 0x9b, 0x48, 0x05, 0xa8, 0x91, 0xa0, 0x90, 0xd0, +0x90, 0x70, 0x90, 0x38, 0xa4, 0x1c, 0x88, 0x33, 0x92, 0xa4, 0x1c, 0x78, +0x33, 0x90, 0x90, 0x38, 0xa4, 0x1c, 0x68, 0x33, 0x8e, 0x80, 0x33, 0x8c, +0x90, 0x60, 0x90, 0x28, 0x24, 0x1c, 0x28, 0xa4, 0x1c, 0x18, 0x33, 0x84, +0x90, 0x38, 0xa4, 0x1c, 0x08, 0x33, 0x82, 0xa4, 0x1c, 0x50, 0x33, 0x8b, +0x90, 0xe0, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x1c, 0x40, 0x33, 0x89, 0xa4, +0x1c, 0x30, 0x33, 0x87, 0x90, 0x38, 0xa4, 0x2d, 0xd8, 0x35, 0xc1, 0xa4, +0x2d, 0x78, 0x35, 0xb5, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x2a, 0xb0, 0x35, +0x62, 0xa4, 0x2a, 0x80, 0x35, 0x5c, 0x10, 0x10, 0xa4, 0x1b, 0xf8, 0x33, +0x80, 0x91, 0x50, 0x90, 0x90, 0x90, 0x50, 0x90, 0x28, 0x24, 0x1c, 0xb8, +0x80, 0x33, 0x9e, 0x80, 0xa4, 0x1c, 0xc0, 0x33, 0x9c, 0x90, 0x50, 0x90, +0x28, 0x24, 0x1c, 0xc8, 0x80, 0x33, 0x9f, 0x90, 0x38, 0xa4, 0x1c, 0xd0, +0x33, 0x9d, 0xa4, 0x1c, 0x98, 0x33, 0x94, 0x90, 0xe0, 0x90, 0x70, 0x90, +0x38, 0xa4, 0x2d, 0x08, 0x35, 0xa9, 0xa4, 0x2c, 0x68, 0x35, 0x96, 0x90, +0x38, 0xa4, 0x2c, 0x00, 0x35, 0x87, 0xa4, 0x2b, 0x70, 0x35, 0x76, 0x81, +0xa4, 0x1c, 0xa8, 0x33, 0x96, 0xe4, 0xe1, 0xc5, 0x00, 0x37, 0x16, 0xed, +0x21, 0xc3, 0xa0, 0xdf, 0x80, 0x37, 0x10, 0x92, 0x40, 0x99, 0x18, 0x02, +0x00, 0x10, 0x10, 0x90, 0x80, 0x10, 0x10, 0x90, 0x38, 0xa4, 0x2d, 0xd0, +0x35, 0xc0, 0xa4, 0x2d, 0x70, 0x35, 0xb4, 0x80, 0x90, 0x38, 0xa4, 0x2a, +0xa8, 0x35, 0x61, 0xa4, 0x2a, 0x78, 0x35, 0x5b, 0x10, 0x10, 0x80, 0x90, +0x70, 0x90, 0x38, 0xa4, 0x2c, 0xf8, 0x35, 0xa8, 0xa4, 0x2c, 0x60, 0x35, +0x94, 0x90, 0x38, 0xa4, 0x2b, 0xf0, 0x35, 0x86, 0xa4, 0x2b, 0x68, 0x35, +0x74, 0xe4, 0xe1, 0xc2, 0x00, 0x37, 0x0a, 0xed, 0x21, 0xc0, 0xa0, 0xdf, +0x40, 0x37, 0x04, 0x92, 0x80, 0x92, 0x40, 0x99, 0x18, 0x02, 0x00, 0x10, +0x10, 0x90, 0x80, 0x10, 0x10, 0x90, 0x38, 0xa4, 0x2d, 0xc8, 0x35, 0xbf, +0xa4, 0x2d, 0x68, 0x35, 0xb3, 0x80, 0x90, 0x38, 0xa4, 0x2a, 0xa0, 0x35, +0x60, 0xa4, 0x2a, 0x70, 0x35, 0x5a, 0x10, 0x10, 0x80, 0x90, 0x70, 0x90, +0x38, 0xa4, 0x2c, 0xe8, 0x35, 0xa7, 0xa4, 0x2c, 0x58, 0x35, 0x92, 0x90, +0x38, 0xa4, 0x2b, 0xe0, 0x35, 0x85, 0xa4, 0x2b, 0x60, 0x35, 0x72, 0xe4, +0xe1, 0xc5, 0x40, 0x37, 0x18, 0xe5, 0x21, 0xc3, 0xc0, 0x37, 0x12, 0x92, +0x50, 0x99, 0x18, 0x02, 0x00, 0x10, 0x10, 0x90, 0x80, 0x10, 0x10, 0x90, +0x38, 0xa4, 0x2d, 0xc0, 0x35, 0xbe, 0xa4, 0x2d, 0x60, 0x35, 0xb2, 0x80, +0x90, 0x38, 0xa4, 0x2a, 0x98, 0x35, 0x5f, 0xa4, 0x2a, 0x68, 0x35, 0x59, +0x10, 0x10, 0x80, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x2c, 0xd8, 0x35, 0xa6, +0xa4, 0x2c, 0x50, 0x35, 0x90, 0x90, 0x38, 0xa4, 0x2b, 0xd0, 0x35, 0x84, +0xa4, 0x2b, 0x58, 0x35, 0x70, 0xec, 0xe1, 0xc2, 0x60, 0xe6, 0xc0, 0x37, +0x0c, 0xe5, 0x21, 0xc0, 0xc0, 0x37, 0x06, 0xc0, 0x40, 0x80, 0x10, 0x10, +0x81, 0x90, 0x90, 0x90, 0x48, 0xc9, 0xe1, 0x59, 0x80, 0x85, 0x35, 0x6a, +0xc9, 0xe1, 0x5a, 0x00, 0x85, 0x35, 0x67, 0x80, 0x35, 0x65, 0x80, 0xd8, +0x47, 0x80, 0x0d, 0xc0, 0xc0, 0x80, 0x10, 0x10, 0x82, 0x90, 0x58, 0xd5, +0x81, 0x80, 0x80, 0x37, 0x00, 0x80, 0x36, 0xfe, 0xd5, 0x81, 0x80, 0x80, +0x36, 0xfc, 0x80, 0x36, 0xfa, 0xc0, 0x80, 0x10, 0x10, 0x82, 0x90, 0x58, +0xd5, 0x81, 0x80, 0x80, 0x37, 0x01, 0x80, 0x36, 0xff, 0xd5, 0x81, 0x80, +0x80, 0x36, 0xfd, 0x80, 0x36, 0xfb, 0xc0, 0x80, 0x84, 0x36, 0xf9, 0xa0, +0x56, 0x50, 0xa0, 0x40, 0x70, 0xa8, 0x1d, 0x40, 0x33, 0x18, 0xa0, 0x12, +0x38, 0xa0, 0x0b, 0x48, 0x96, 0x00, 0x9a, 0xf0, 0x05, 0xc0, 0x91, 0x70, +0x90, 0xb8, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x14, 0x50, 0x33, 0x7c, 0xa4, +0x14, 0x60, 0x33, 0x7b, 0x10, 0x10, 0xa4, 0x14, 0x58, 0x33, 0x7a, 0x90, +0x70, 0x90, 0x38, 0xa4, 0x14, 0x20, 0x33, 0x61, 0xa4, 0x14, 0x30, 0x33, +0x60, 0x10, 0x10, 0xa4, 0x14, 0x28, 0x33, 0x5f, 0x90, 0xb8, 0x90, 0x70, +0x90, 0x38, 0xa4, 0x13, 0xf0, 0x33, 0x46, 0xa4, 0x14, 0x00, 0x33, 0x45, +0x10, 0x10, 0xa4, 0x13, 0xf8, 0x33, 0x44, 0x90, 0x70, 0x90, 0x38, 0xa4, +0x13, 0xc0, 0x33, 0x2b, 0xa4, 0x13, 0xd0, 0x33, 0x2a, 0x10, 0x10, 0xa4, +0x13, 0xc8, 0x33, 0x29, 0x91, 0x70, 0x90, 0xb8, 0x90, 0x70, 0x90, 0x38, +0xa4, 0x14, 0x38, 0x33, 0x77, 0xa4, 0x14, 0x48, 0x33, 0x79, 0x10, 0x10, +0xa4, 0x14, 0x40, 0x33, 0x78, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x14, 0x08, +0x33, 0x5c, 0xa4, 0x14, 0x18, 0x33, 0x5e, 0x10, 0x10, 0xa4, 0x14, 0x10, +0x33, 0x5d, 0x90, 0xb8, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x13, 0xd8, 0x33, +0x41, 0xa4, 0x13, 0xe8, 0x33, 0x43, 0x10, 0x10, 0xa4, 0x13, 0xe0, 0x33, +0x42, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x13, 0xa8, 0x33, 0x26, 0xa4, 0x13, +0xb8, 0x33, 0x28, 0x10, 0x10, 0xa4, 0x13, 0xb0, 0x33, 0x27, 0xe4, 0xe1, +0x4f, 0xc0, 0x35, 0x49, 0x9a, 0xf0, 0x05, 0x00, 0x91, 0x70, 0x90, 0xb8, +0x90, 0x70, 0x90, 0x38, 0xa4, 0x13, 0xa0, 0x33, 0x74, 0xa4, 0x13, 0x98, +0x33, 0x76, 0x10, 0x10, 0xa4, 0x13, 0x90, 0x33, 0x75, 0x90, 0x70, 0x90, +0x38, 0xa4, 0x13, 0x88, 0x33, 0x59, 0xa4, 0x13, 0x80, 0x33, 0x5b, 0x10, +0x10, 0xa4, 0x13, 0x78, 0x33, 0x5a, 0x90, 0xb8, 0x90, 0x70, 0x90, 0x38, +0xa4, 0x13, 0x70, 0x33, 0x3e, 0xa4, 0x13, 0x68, 0x33, 0x40, 0x10, 0x10, +0xa4, 0x13, 0x60, 0x33, 0x3f, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x13, 0x58, +0x33, 0x23, 0xa4, 0x13, 0x50, 0x33, 0x25, 0x10, 0x10, 0xa4, 0x13, 0x48, +0x33, 0x24, 0x91, 0x10, 0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x33, +0x71, 0x80, 0x33, 0x73, 0x10, 0x10, 0x80, 0x33, 0x72, 0x90, 0x50, 0x90, +0x28, 0x80, 0x33, 0x56, 0x80, 0x33, 0x58, 0x10, 0x10, 0x80, 0x33, 0x57, +0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x33, 0x3b, 0x80, 0x33, 0x3d, +0x10, 0x10, 0x80, 0x33, 0x3c, 0x90, 0x50, 0x90, 0x28, 0x80, 0x33, 0x20, +0x80, 0x33, 0x22, 0x10, 0x10, 0x80, 0x33, 0x21, 0xe4, 0xe1, 0x3d, 0x40, +0x35, 0x09, 0x95, 0x40, 0x9a, 0x90, 0x05, 0x00, 0x91, 0x10, 0x90, 0x88, +0x90, 0x50, 0x90, 0x28, 0x80, 0x33, 0x6e, 0x80, 0x33, 0x70, 0x10, 0x10, +0x80, 0x33, 0x6f, 0x90, 0x50, 0x90, 0x28, 0x80, 0x33, 0x53, 0x80, 0x33, +0x55, 0x10, 0x10, 0x80, 0x33, 0x54, 0x90, 0xb8, 0x90, 0x70, 0x90, 0x38, +0xa4, 0x13, 0x30, 0x33, 0x38, 0xa4, 0x13, 0x40, 0x33, 0x3a, 0x10, 0x10, +0xa4, 0x13, 0x38, 0x33, 0x39, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x13, 0x00, +0x33, 0x1d, 0xa4, 0x13, 0x10, 0x33, 0x1f, 0x10, 0x10, 0xa4, 0x13, 0x08, +0x33, 0x1e, 0x91, 0x10, 0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x33, +0x6b, 0x80, 0x33, 0x6d, 0x10, 0x10, 0x80, 0x33, 0x6c, 0x90, 0x50, 0x90, +0x28, 0x80, 0x33, 0x50, 0x80, 0x33, 0x52, 0x10, 0x10, 0x80, 0x33, 0x51, +0x90, 0xb8, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x13, 0x18, 0x33, 0x35, 0xa4, +0x13, 0x28, 0x33, 0x37, 0x10, 0x10, 0xa4, 0x13, 0x20, 0x33, 0x36, 0x90, +0x70, 0x90, 0x38, 0xa4, 0x12, 0xe8, 0x33, 0x1a, 0xa4, 0x12, 0xf8, 0x33, +0x1c, 0x10, 0x10, 0xa4, 0x12, 0xf0, 0x33, 0x1b, 0xe4, 0xe1, 0x4f, 0x40, +0x35, 0x47, 0x98, 0xb8, 0x01, 0x68, 0x10, 0x10, 0x10, 0x10, 0x90, 0x50, +0x90, 0x28, 0x80, 0x33, 0x17, 0x80, 0x33, 0x19, 0x10, 0x10, 0x80, 0x33, +0x18, 0x90, 0x60, 0x90, 0x30, 0x60, 0xa0, 0x97, 0x00, 0x60, 0xa0, 0x96, +0xc0, 0x90, 0x30, 0x60, 0xa0, 0x96, 0x80, 0x60, 0xa0, 0x96, 0x40, 0xe4, +0xe1, 0x3c, 0x40, 0x35, 0x05, 0x96, 0xe8, 0x94, 0x80, 0x9a, 0x30, 0x04, +0x40, 0x91, 0x10, 0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x33, 0x65, +0x80, 0x33, 0x6a, 0x10, 0x10, 0x80, 0x33, 0x69, 0x90, 0x50, 0x90, 0x28, +0x80, 0x33, 0x4a, 0x80, 0x33, 0x4f, 0x10, 0x10, 0x80, 0x33, 0x4e, 0x90, +0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x33, 0x2f, 0x80, 0x33, 0x34, 0x10, +0x10, 0x80, 0x33, 0x33, 0x90, 0x50, 0x90, 0x28, 0x80, 0x33, 0x11, 0x80, +0x33, 0x16, 0x10, 0x10, 0x80, 0x33, 0x15, 0x91, 0x10, 0x90, 0x88, 0x90, +0x50, 0x90, 0x28, 0x80, 0x33, 0x62, 0x80, 0x33, 0x64, 0x10, 0x10, 0x80, +0x33, 0x63, 0x90, 0x50, 0x90, 0x28, 0x80, 0x33, 0x47, 0x80, 0x33, 0x49, +0x10, 0x10, 0x80, 0x33, 0x48, 0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, +0x33, 0x2c, 0x80, 0x33, 0x2e, 0x10, 0x10, 0x80, 0x33, 0x2d, 0x90, 0x50, +0x90, 0x28, 0x80, 0x33, 0x0e, 0x80, 0x33, 0x10, 0x10, 0x10, 0x80, 0x33, +0x0f, 0xe4, 0xe1, 0x4e, 0xc0, 0x35, 0x45, 0x88, 0x02, 0x28, 0x91, 0x10, +0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x33, 0x66, 0x80, 0x33, 0x68, +0x10, 0x10, 0x80, 0x33, 0x67, 0x90, 0x50, 0x90, 0x28, 0x80, 0x33, 0x4b, +0x80, 0x33, 0x4d, 0x10, 0x10, 0x80, 0x33, 0x4c, 0x90, 0x88, 0x90, 0x50, +0x90, 0x28, 0x80, 0x33, 0x30, 0x80, 0x33, 0x32, 0x10, 0x10, 0x80, 0x33, +0x31, 0x90, 0x50, 0x90, 0x28, 0x80, 0x33, 0x12, 0x80, 0x33, 0x14, 0x10, +0x10, 0x80, 0x33, 0x13, 0xe4, 0xe1, 0x3b, 0x40, 0x35, 0x01, 0x93, 0x40, +0x99, 0x90, 0x03, 0x00, 0x90, 0xc0, 0x90, 0x60, 0x90, 0x28, 0x81, 0x32, +0x9e, 0x10, 0x10, 0x80, 0x32, 0x9d, 0x90, 0x28, 0x81, 0x32, 0x9a, 0x10, +0x10, 0x80, 0x32, 0x99, 0x90, 0x60, 0x90, 0x28, 0x81, 0x32, 0x96, 0x10, +0x10, 0x80, 0x32, 0x95, 0x90, 0x28, 0x81, 0x32, 0x92, 0x10, 0x10, 0x80, +0x32, 0x91, 0x90, 0xc0, 0x90, 0x60, 0x90, 0x28, 0x81, 0x32, 0x9b, 0x10, +0x10, 0x80, 0x32, 0x9c, 0x90, 0x28, 0x81, 0x32, 0x97, 0x10, 0x10, 0x80, +0x32, 0x98, 0x90, 0x60, 0x90, 0x28, 0x81, 0x32, 0x93, 0x10, 0x10, 0x80, +0x32, 0x94, 0x90, 0x28, 0x81, 0x32, 0x8f, 0x10, 0x10, 0x80, 0x32, 0x90, +0xe4, 0xe1, 0x4e, 0x40, 0x35, 0x43, 0x88, 0x00, 0x88, 0x10, 0x10, 0x10, +0x10, 0x90, 0x28, 0x81, 0x32, 0x8d, 0x10, 0x10, 0x80, 0x32, 0x8e, 0xe4, +0xe1, 0x3a, 0x40, 0x34, 0xfd, 0xa0, 0x0e, 0x80, 0xa0, 0x09, 0x08, 0x94, +0x80, 0x9a, 0x30, 0x04, 0x40, 0x91, 0x10, 0x90, 0x88, 0x90, 0x50, 0x90, +0x28, 0x80, 0x33, 0x0d, 0x80, 0x33, 0x0c, 0x10, 0x10, 0x80, 0x33, 0x0b, +0x90, 0x50, 0x90, 0x28, 0x80, 0x32, 0xf2, 0x80, 0x32, 0xf1, 0x10, 0x10, +0x80, 0x32, 0xf0, 0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x32, 0xd7, +0x80, 0x32, 0xd6, 0x10, 0x10, 0x80, 0x32, 0xd5, 0x90, 0x50, 0x90, 0x28, +0x80, 0x32, 0xbc, 0x80, 0x32, 0xbb, 0x10, 0x10, 0x80, 0x32, 0xba, 0x91, +0x10, 0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x33, 0x08, 0x80, 0x33, +0x0a, 0x10, 0x10, 0x80, 0x33, 0x09, 0x90, 0x50, 0x90, 0x28, 0x80, 0x32, +0xed, 0x80, 0x32, 0xef, 0x10, 0x10, 0x80, 0x32, 0xee, 0x90, 0x88, 0x90, +0x50, 0x90, 0x28, 0x80, 0x32, 0xd2, 0x80, 0x32, 0xd4, 0x10, 0x10, 0x80, +0x32, 0xd3, 0x90, 0x50, 0x90, 0x28, 0x80, 0x32, 0xb7, 0x80, 0x32, 0xb9, +0x10, 0x10, 0x80, 0x32, 0xb8, 0xe4, 0xe1, 0x47, 0x40, 0x35, 0x31, 0x9a, +0x30, 0x04, 0x40, 0x91, 0x10, 0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, +0x33, 0x05, 0x80, 0x33, 0x07, 0x10, 0x10, 0x80, 0x33, 0x06, 0x90, 0x50, +0x90, 0x28, 0x80, 0x32, 0xea, 0x80, 0x32, 0xec, 0x10, 0x10, 0x80, 0x32, +0xeb, 0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x32, 0xcf, 0x80, 0x32, +0xd1, 0x10, 0x10, 0x80, 0x32, 0xd0, 0x90, 0x50, 0x90, 0x28, 0x80, 0x32, +0xb4, 0x80, 0x32, 0xb6, 0x10, 0x10, 0x80, 0x32, 0xb5, 0x91, 0x10, 0x90, +0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x33, 0x02, 0x80, 0x33, 0x04, 0x10, +0x10, 0x80, 0x33, 0x03, 0x90, 0x50, 0x90, 0x28, 0x80, 0x32, 0xe7, 0x80, +0x32, 0xe9, 0x10, 0x10, 0x80, 0x32, 0xe8, 0x90, 0x88, 0x90, 0x50, 0x90, +0x28, 0x80, 0x32, 0xcc, 0x80, 0x32, 0xce, 0x10, 0x10, 0x80, 0x32, 0xcd, +0x90, 0x50, 0x90, 0x28, 0x80, 0x32, 0xb1, 0x80, 0x32, 0xb3, 0x10, 0x10, +0x80, 0x32, 0xb2, 0xe4, 0xe1, 0x36, 0xc0, 0x34, 0xe5, 0x94, 0x80, 0x9a, +0x30, 0x04, 0x40, 0x91, 0x10, 0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, +0x32, 0xff, 0x80, 0x33, 0x01, 0x10, 0x10, 0x80, 0x33, 0x00, 0x90, 0x50, +0x90, 0x28, 0x80, 0x32, 0xe4, 0x80, 0x32, 0xe6, 0x10, 0x10, 0x80, 0x32, +0xe5, 0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x32, 0xc9, 0x80, 0x32, +0xcb, 0x10, 0x10, 0x80, 0x32, 0xca, 0x90, 0x50, 0x90, 0x28, 0x80, 0x32, +0xae, 0x80, 0x32, 0xb0, 0x10, 0x10, 0x80, 0x32, 0xaf, 0x91, 0x10, 0x90, +0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x32, 0xfc, 0x80, 0x32, 0xfe, 0x10, +0x10, 0x80, 0x32, 0xfd, 0x90, 0x50, 0x90, 0x28, 0x80, 0x32, 0xe1, 0x80, +0x32, 0xe3, 0x10, 0x10, 0x80, 0x32, 0xe2, 0x90, 0x88, 0x90, 0x50, 0x90, +0x28, 0x80, 0x32, 0xc6, 0x80, 0x32, 0xc8, 0x10, 0x10, 0x80, 0x32, 0xc7, +0x90, 0x50, 0x90, 0x28, 0x80, 0x32, 0xab, 0x80, 0x32, 0xad, 0x10, 0x10, +0x80, 0x32, 0xac, 0xe4, 0xe1, 0x46, 0x40, 0x35, 0x2d, 0x88, 0x00, 0xb0, +0x10, 0x10, 0x10, 0x10, 0x90, 0x50, 0x90, 0x28, 0x80, 0x32, 0xa8, 0x80, +0x32, 0xaa, 0x10, 0x10, 0x80, 0x32, 0xa9, 0xe4, 0xe1, 0x36, 0x40, 0x34, +0xe3, 0x96, 0xe8, 0x94, 0x80, 0x9a, 0x30, 0x04, 0x40, 0x91, 0x10, 0x90, +0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x32, 0xf6, 0x80, 0x32, 0xfb, 0x10, +0x10, 0x80, 0x32, 0xfa, 0x90, 0x50, 0x90, 0x28, 0x80, 0x32, 0xdb, 0x80, +0x32, 0xe0, 0x10, 0x10, 0x80, 0x32, 0xdf, 0x90, 0x88, 0x90, 0x50, 0x90, +0x28, 0x80, 0x32, 0xc0, 0x80, 0x32, 0xc5, 0x10, 0x10, 0x80, 0x32, 0xc4, +0x90, 0x50, 0x90, 0x28, 0x80, 0x32, 0xa2, 0x80, 0x32, 0xa7, 0x10, 0x10, +0x80, 0x32, 0xa6, 0x91, 0x10, 0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, +0x32, 0xf3, 0x80, 0x32, 0xf5, 0x10, 0x10, 0x80, 0x32, 0xf4, 0x90, 0x50, +0x90, 0x28, 0x80, 0x32, 0xd8, 0x80, 0x32, 0xda, 0x10, 0x10, 0x80, 0x32, +0xd9, 0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x32, 0xbd, 0x80, 0x32, +0xbf, 0x10, 0x10, 0x80, 0x32, 0xbe, 0x90, 0x50, 0x90, 0x28, 0x80, 0x32, +0x9f, 0x80, 0x32, 0xa1, 0x10, 0x10, 0x80, 0x32, 0xa0, 0xe4, 0xe1, 0x45, +0x40, 0x35, 0x29, 0x88, 0x02, 0x28, 0x91, 0x10, 0x90, 0x88, 0x90, 0x50, +0x90, 0x28, 0x80, 0x32, 0xf7, 0x80, 0x32, 0xf9, 0x10, 0x10, 0x80, 0x32, +0xf8, 0x90, 0x50, 0x90, 0x28, 0x80, 0x32, 0xdc, 0x80, 0x32, 0xde, 0x10, +0x10, 0x80, 0x32, 0xdd, 0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x32, +0xc1, 0x80, 0x32, 0xc3, 0x10, 0x10, 0x80, 0x32, 0xc2, 0x90, 0x50, 0x90, +0x28, 0x80, 0x32, 0xa3, 0x80, 0x32, 0xa5, 0x10, 0x10, 0x80, 0x32, 0xa4, +0xe4, 0xe1, 0x35, 0xc0, 0x34, 0xe1, 0x90, 0x40, 0xe5, 0x21, 0x44, 0x40, +0x35, 0x25, 0xe5, 0x21, 0x35, 0x40, 0x34, 0xdf, 0x9e, 0xb4, 0x20, 0x08, +0x93, 0x70, 0x91, 0xd8, 0xd5, 0x07, 0x80, 0xd0, 0xc4, 0x40, 0x90, 0x48, +0x80, 0x8c, 0x37, 0x58, 0x84, 0x36, 0xf5, 0xa4, 0x35, 0x38, 0x36, 0xbf, +0x90, 0x28, 0x24, 0x34, 0x78, 0xa4, 0x32, 0xf8, 0x36, 0x77, 0xd0, 0xc4, +0x40, 0x90, 0x48, 0x80, 0x8c, 0x37, 0x38, 0x84, 0x36, 0xf3, 0xa4, 0x35, +0x28, 0x36, 0xbd, 0x90, 0x28, 0x24, 0x34, 0x68, 0xa4, 0x32, 0xe8, 0x36, +0x75, 0xd5, 0x06, 0x80, 0xd0, 0xc3, 0x40, 0x90, 0x28, 0x80, 0x36, 0xdf, +0xa4, 0x35, 0x08, 0x36, 0xb9, 0x90, 0x28, 0x24, 0x34, 0x48, 0xa4, 0x32, +0xc8, 0x36, 0x71, 0xd0, 0xc3, 0x40, 0x90, 0x28, 0x80, 0x36, 0xdb, 0xa4, +0x34, 0xf8, 0x36, 0xb7, 0x90, 0x28, 0x24, 0x34, 0x38, 0xa4, 0x32, 0xb8, +0x36, 0x6f, 0x91, 0x98, 0xd5, 0x06, 0x80, 0xd0, 0xc3, 0x40, 0x90, 0x28, +0x80, 0x36, 0xd3, 0xa4, 0x34, 0xd8, 0x36, 0xb3, 0x90, 0x28, 0x24, 0x34, +0x18, 0xa4, 0x32, 0x98, 0x36, 0x6b, 0xd0, 0xc3, 0x40, 0x90, 0x28, 0x80, +0x36, 0xcf, 0xa4, 0x34, 0xc8, 0x36, 0xb1, 0x90, 0x28, 0x24, 0x34, 0x08, +0xa4, 0x32, 0x88, 0x36, 0x69, 0xd5, 0x06, 0x80, 0xd0, 0xc3, 0x40, 0x90, +0x28, 0x80, 0x36, 0xc7, 0xa4, 0x34, 0xa8, 0x36, 0xad, 0x90, 0x28, 0x24, +0x33, 0xe8, 0xa4, 0x32, 0x68, 0x36, 0x65, 0xd0, 0xc3, 0x40, 0x90, 0x28, +0x80, 0x36, 0xc3, 0xa4, 0x34, 0x98, 0x36, 0xab, 0x90, 0x28, 0x24, 0x33, +0xd8, 0xa4, 0x32, 0x58, 0x36, 0x63, 0x93, 0x70, 0x91, 0xd8, 0xd5, 0x07, +0x80, 0xd0, 0xc4, 0x40, 0x90, 0x48, 0x80, 0x8c, 0x37, 0x78, 0x84, 0x36, +0xf7, 0xa4, 0x35, 0x48, 0x36, 0xc1, 0x90, 0x28, 0x24, 0x34, 0x88, 0xa4, +0x33, 0x08, 0x36, 0x79, 0xd0, 0xc4, 0x40, 0x90, 0x48, 0x80, 0x8c, 0x37, +0x48, 0x84, 0x36, 0xf4, 0xa4, 0x35, 0x30, 0x36, 0xbe, 0x90, 0x28, 0x24, +0x34, 0x70, 0xa4, 0x32, 0xf0, 0x36, 0x76, 0xd5, 0x06, 0x80, 0xd0, 0xc3, +0x40, 0x90, 0x28, 0x80, 0x36, 0xe3, 0xa4, 0x35, 0x18, 0x36, 0xbb, 0x90, +0x28, 0x24, 0x34, 0x58, 0xa4, 0x32, 0xd8, 0x36, 0x73, 0xd0, 0xc3, 0x40, +0x90, 0x28, 0x80, 0x36, 0xdd, 0xa4, 0x35, 0x00, 0x36, 0xb8, 0x90, 0x28, +0x24, 0x34, 0x40, 0xa4, 0x32, 0xc0, 0x36, 0x70, 0x91, 0x98, 0xd5, 0x06, +0x80, 0xd0, 0xc3, 0x40, 0x90, 0x28, 0x80, 0x36, 0xd7, 0xa4, 0x34, 0xe8, +0x36, 0xb5, 0x90, 0x28, 0x24, 0x34, 0x28, 0xa4, 0x32, 0xa8, 0x36, 0x6d, +0xd0, 0xc3, 0x40, 0x90, 0x28, 0x80, 0x36, 0xd1, 0xa4, 0x34, 0xd0, 0x36, +0xb2, 0x90, 0x28, 0x24, 0x34, 0x10, 0xa4, 0x32, 0x90, 0x36, 0x6a, 0xd5, +0x06, 0x80, 0xd0, 0xc3, 0x40, 0x90, 0x28, 0x80, 0x36, 0xcb, 0xa4, 0x34, +0xb8, 0x36, 0xaf, 0x90, 0x28, 0x24, 0x33, 0xf8, 0xa4, 0x32, 0x78, 0x36, +0x67, 0xd0, 0xc3, 0x40, 0x90, 0x28, 0x80, 0x36, 0xc5, 0xa4, 0x34, 0xa0, +0x36, 0xac, 0x90, 0x28, 0x24, 0x33, 0xe0, 0xa4, 0x32, 0x60, 0x36, 0x64, +0x99, 0x08, 0x01, 0xf0, 0x81, 0x90, 0x78, 0xd4, 0xc2, 0x00, 0xa4, 0x1f, +0xb0, 0x33, 0xee, 0xa4, 0x1f, 0x30, 0x33, 0xde, 0xd4, 0xc2, 0x00, 0xa4, +0x1f, 0x40, 0x33, 0xf0, 0xa4, 0x1e, 0xc0, 0x33, 0xe0, 0x81, 0x90, 0x78, +0xd4, 0xc2, 0x00, 0xa4, 0x1f, 0x60, 0x33, 0xf4, 0xa4, 0x1e, 0xe0, 0x33, +0xe4, 0xd4, 0xc2, 0x00, 0xa4, 0x1f, 0x50, 0x33, 0xf2, 0xa4, 0x1e, 0xd0, +0x33, 0xe2, 0xa8, 0x0b, 0x18, 0x13, 0xa8, 0x96, 0x80, 0x93, 0x40, 0x99, +0x90, 0x03, 0x00, 0x90, 0xc0, 0x90, 0x60, 0x90, 0x38, 0xa4, 0x12, 0xb8, +0x32, 0x58, 0x24, 0x12, 0xb0, 0x90, 0x38, 0xa4, 0x11, 0xe0, 0x32, 0x3d, +0x24, 0x11, 0xd8, 0x90, 0x60, 0x90, 0x38, 0xa4, 0x11, 0x08, 0x32, 0x22, +0x24, 0x11, 0x00, 0x90, 0x38, 0xa4, 0x10, 0x30, 0x32, 0x07, 0x24, 0x10, +0x28, 0x90, 0xc0, 0x90, 0x60, 0x90, 0x38, 0xa4, 0x12, 0xa8, 0x32, 0x53, +0x24, 0x12, 0xa0, 0x90, 0x38, 0xa4, 0x11, 0xd0, 0x32, 0x38, 0x24, 0x11, +0xc8, 0x90, 0x60, 0x90, 0x38, 0xa4, 0x10, 0xf8, 0x32, 0x1d, 0x24, 0x10, +0xf0, 0x90, 0x38, 0xa4, 0x10, 0x20, 0x32, 0x02, 0x24, 0x10, 0x18, 0xe4, +0xe1, 0x91, 0x40, 0x36, 0x47, 0x99, 0x90, 0x03, 0x00, 0x90, 0xc0, 0x90, +0x60, 0x90, 0x38, 0xa4, 0x12, 0x90, 0x32, 0x50, 0x24, 0x12, 0x88, 0x90, +0x38, 0xa4, 0x11, 0xb8, 0x32, 0x35, 0x24, 0x11, 0xb0, 0x90, 0x60, 0x90, +0x38, 0xa4, 0x10, 0xe0, 0x32, 0x1a, 0x24, 0x10, 0xd8, 0x90, 0x38, 0xa4, +0x10, 0x08, 0x31, 0xff, 0x24, 0x10, 0x00, 0x90, 0xc0, 0x90, 0x60, 0x90, +0x38, 0xa4, 0x12, 0x78, 0x32, 0x4d, 0x24, 0x12, 0x70, 0x90, 0x38, 0xa4, +0x11, 0xa0, 0x32, 0x32, 0x24, 0x11, 0x98, 0x90, 0x60, 0x90, 0x38, 0xa4, +0x10, 0xc8, 0x32, 0x17, 0x24, 0x10, 0xc0, 0x90, 0x38, 0xa4, 0x0f, 0xf0, +0x31, 0xfc, 0x24, 0x0f, 0xe8, 0xe4, 0xe1, 0x8f, 0xc0, 0x36, 0x41, 0x93, +0x78, 0x99, 0x90, 0x03, 0x00, 0x90, 0xc0, 0x90, 0x60, 0x90, 0x38, 0xa4, +0x12, 0x60, 0x32, 0x4a, 0x24, 0x12, 0x58, 0x90, 0x38, 0xa4, 0x11, 0x88, +0x32, 0x2f, 0x24, 0x11, 0x80, 0x90, 0x60, 0x90, 0x38, 0xa4, 0x10, 0xb0, +0x32, 0x14, 0x24, 0x10, 0xa8, 0x90, 0x38, 0xa4, 0x0f, 0xd8, 0x31, 0xf9, +0x24, 0x0f, 0xd0, 0x90, 0xc0, 0x90, 0x60, 0x90, 0x38, 0xa4, 0x12, 0x48, +0x32, 0x47, 0x24, 0x12, 0x40, 0x90, 0x38, 0xa4, 0x11, 0x70, 0x32, 0x2c, +0x24, 0x11, 0x68, 0x90, 0x60, 0x90, 0x38, 0xa4, 0x10, 0x98, 0x32, 0x11, +0x24, 0x10, 0x90, 0x90, 0x38, 0xa4, 0x0f, 0xc0, 0x31, 0xf6, 0x24, 0x0f, +0xb8, 0xec, 0xa0, 0xff, 0x00, 0x02, 0x00, 0x33, 0xfe, 0xa4, 0x31, 0xc8, +0x36, 0x3b, 0x88, 0x00, 0x88, 0x10, 0x10, 0x10, 0x10, 0x90, 0x38, 0xa4, +0x0f, 0xa8, 0x31, 0xf3, 0x24, 0x0f, 0xa0, 0xe9, 0x60, 0xfe, 0x40, 0x02, +0x00, 0x33, 0xfa, 0xe3, 0x61, 0x8c, 0xc0, 0x36, 0x35, 0x95, 0x08, 0x93, +0x40, 0x99, 0x90, 0x03, 0x00, 0x90, 0xc0, 0x90, 0x60, 0x90, 0x38, 0xa4, +0x12, 0x30, 0x32, 0x41, 0x24, 0x12, 0x28, 0x90, 0x38, 0xa4, 0x11, 0x58, +0x32, 0x26, 0x24, 0x11, 0x50, 0x90, 0x60, 0x90, 0x38, 0xa4, 0x10, 0x80, +0x32, 0x0b, 0x24, 0x10, 0x78, 0x90, 0x38, 0xa4, 0x0f, 0x90, 0x31, 0xed, +0x24, 0x0f, 0x88, 0x90, 0xc0, 0x90, 0x60, 0x90, 0x38, 0xa4, 0x12, 0x00, +0x32, 0x3e, 0x24, 0x11, 0xf8, 0x90, 0x38, 0xa4, 0x11, 0x28, 0x32, 0x23, +0x24, 0x11, 0x20, 0x90, 0x60, 0x90, 0x38, 0xa4, 0x10, 0x50, 0x32, 0x08, +0x24, 0x10, 0x48, 0x90, 0x38, 0xa4, 0x0f, 0x60, 0x31, 0xea, 0x24, 0x0f, +0x58, 0xe4, 0xe1, 0x91, 0x80, 0x36, 0x49, 0x88, 0x01, 0x88, 0x90, 0xc0, +0x90, 0x60, 0x90, 0x38, 0xa4, 0x12, 0x20, 0x32, 0x42, 0x24, 0x12, 0x18, +0x90, 0x38, 0xa4, 0x11, 0x48, 0x32, 0x27, 0x24, 0x11, 0x40, 0x90, 0x60, +0x90, 0x38, 0xa4, 0x10, 0x70, 0x32, 0x0c, 0x24, 0x10, 0x68, 0x90, 0x38, +0xa4, 0x0f, 0x80, 0x31, 0xee, 0x24, 0x0f, 0x78, 0xe4, 0xe1, 0x90, 0x00, +0x36, 0x43, 0x92, 0xd0, 0x99, 0x50, 0x02, 0x80, 0x90, 0xa0, 0x90, 0x50, +0x90, 0x28, 0x80, 0x31, 0xe9, 0x24, 0x0f, 0x40, 0x90, 0x28, 0x80, 0x31, +0xe5, 0x24, 0x0f, 0x20, 0x90, 0x50, 0x90, 0x28, 0x80, 0x31, 0xe1, 0x24, +0x0f, 0x00, 0x90, 0x28, 0x80, 0x31, 0xdd, 0x24, 0x0e, 0xe0, 0x90, 0xa0, +0x90, 0x50, 0x90, 0x28, 0x80, 0x31, 0xe6, 0x24, 0x0f, 0x38, 0x90, 0x28, +0x80, 0x31, 0xe2, 0x24, 0x0f, 0x18, 0x90, 0x50, 0x90, 0x28, 0x80, 0x31, +0xde, 0x24, 0x0e, 0xf8, 0x90, 0x28, 0x80, 0x31, 0xda, 0x24, 0x0e, 0xd8, +0xec, 0xe1, 0x8e, 0xa1, 0x00, 0x00, 0x36, 0x3d, 0x88, 0x00, 0x78, 0x10, +0x10, 0x10, 0x10, 0x90, 0x28, 0x80, 0x31, 0xd8, 0x24, 0x0e, 0xc8, 0xec, +0xe1, 0x8d, 0x20, 0xfe, 0x00, 0x36, 0x37, 0xe5, 0xa1, 0x34, 0xc0, 0x34, +0xd1, 0xa0, 0x2a, 0x10, 0xa8, 0x16, 0x60, 0x29, 0xd8, 0xa0, 0x0c, 0x48, +0xa0, 0x0a, 0xc8, 0x95, 0x60, 0x92, 0xb0, 0x91, 0x40, 0x90, 0x88, 0x90, +0x50, 0x90, 0x28, 0x80, 0x31, 0xa1, 0x80, 0x31, 0xa0, 0x10, 0x10, 0x80, +0x31, 0x9f, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x08, 0x98, 0x31, 0xb3, 0xa4, +0x08, 0x90, 0x31, 0xb2, 0x10, 0x10, 0xa4, 0x08, 0x88, 0x31, 0xb1, 0x90, +0xb8, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x09, 0xb8, 0x31, 0xd7, 0xa4, 0x09, +0xb0, 0x31, 0xd6, 0x10, 0x10, 0xa4, 0x09, 0xa8, 0x31, 0xd5, 0x90, 0x70, +0x90, 0x38, 0xa4, 0x09, 0x28, 0x31, 0xc5, 0xa4, 0x09, 0x20, 0x31, 0xc4, +0x10, 0x10, 0xa4, 0x09, 0x18, 0x31, 0xc3, 0x91, 0x40, 0x90, 0x88, 0x90, +0x50, 0x90, 0x28, 0x80, 0x31, 0x9c, 0x80, 0x31, 0x9e, 0x10, 0x10, 0x80, +0x31, 0x9d, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x08, 0x70, 0x31, 0xae, 0xa4, +0x08, 0x80, 0x31, 0xb0, 0x10, 0x10, 0xa4, 0x08, 0x78, 0x31, 0xaf, 0x90, +0xb8, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x09, 0x90, 0x31, 0xd2, 0xa4, 0x09, +0xa0, 0x31, 0xd4, 0x10, 0x10, 0xa4, 0x09, 0x98, 0x31, 0xd3, 0x90, 0x70, +0x90, 0x38, 0xa4, 0x09, 0x00, 0x31, 0xc0, 0xa4, 0x09, 0x10, 0x31, 0xc2, +0x10, 0x10, 0xa4, 0x09, 0x08, 0x31, 0xc1, 0x92, 0xb0, 0x91, 0x40, 0x90, +0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x31, 0x99, 0x80, 0x31, 0x9b, 0x10, +0x10, 0x80, 0x31, 0x9a, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x08, 0x58, 0x31, +0xab, 0xa4, 0x08, 0x68, 0x31, 0xad, 0x10, 0x10, 0xa4, 0x08, 0x60, 0x31, +0xac, 0x90, 0xb8, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x09, 0x78, 0x31, 0xcf, +0xa4, 0x09, 0x88, 0x31, 0xd1, 0x10, 0x10, 0xa4, 0x09, 0x80, 0x31, 0xd0, +0x90, 0x70, 0x90, 0x38, 0xa4, 0x08, 0xe8, 0x31, 0xbd, 0xa4, 0x08, 0xf8, +0x31, 0xbf, 0x10, 0x10, 0xa4, 0x08, 0xf0, 0x31, 0xbe, 0x91, 0x40, 0x90, +0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x31, 0x96, 0x80, 0x31, 0x98, 0x10, +0x10, 0x80, 0x31, 0x97, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x08, 0x40, 0x31, +0xa8, 0xa4, 0x08, 0x50, 0x31, 0xaa, 0x10, 0x10, 0xa4, 0x08, 0x48, 0x31, +0xa9, 0x90, 0xb8, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x09, 0x60, 0x31, 0xcc, +0xa4, 0x09, 0x70, 0x31, 0xce, 0x10, 0x10, 0xa4, 0x09, 0x68, 0x31, 0xcd, +0x90, 0x70, 0x90, 0x38, 0xa4, 0x08, 0xd0, 0x31, 0xba, 0xa4, 0x08, 0xe0, +0x31, 0xbc, 0x10, 0x10, 0xa4, 0x08, 0xd8, 0x31, 0xbb, 0x10, 0x10, 0x90, +0xa8, 0x10, 0x10, 0x10, 0x10, 0x90, 0x50, 0x90, 0x28, 0x80, 0x31, 0x8d, +0x80, 0x31, 0x8f, 0x10, 0x10, 0x80, 0x31, 0x8e, 0x90, 0x60, 0x90, 0x30, +0x60, 0xa0, 0x2a, 0xc0, 0x60, 0xa0, 0x2a, 0x80, 0x90, 0x30, 0x60, 0xa0, +0x2a, 0x40, 0x60, 0xa0, 0x2a, 0x00, 0x97, 0xf0, 0x95, 0x60, 0x92, 0xb0, +0x91, 0x40, 0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x31, 0x93, 0x80, +0x31, 0x95, 0x10, 0x10, 0x80, 0x31, 0x94, 0x90, 0x70, 0x90, 0x38, 0xa4, +0x08, 0x28, 0x31, 0xa5, 0xa4, 0x08, 0x38, 0x31, 0xa7, 0x10, 0x10, 0xa4, +0x08, 0x30, 0x31, 0xa6, 0x90, 0xb8, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x09, +0x48, 0x31, 0xc9, 0xa4, 0x09, 0x58, 0x31, 0xcb, 0x10, 0x10, 0xa4, 0x09, +0x50, 0x31, 0xca, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x08, 0xb8, 0x31, 0xb7, +0xa4, 0x08, 0xc8, 0x31, 0xb9, 0x10, 0x10, 0xa4, 0x08, 0xc0, 0x31, 0xb8, +0x91, 0x40, 0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x31, 0x90, 0x80, +0x31, 0x92, 0x10, 0x10, 0x80, 0x31, 0x91, 0x90, 0x70, 0x90, 0x38, 0xa4, +0x08, 0x10, 0x31, 0xa2, 0xa4, 0x08, 0x20, 0x31, 0xa4, 0x10, 0x10, 0xa4, +0x08, 0x18, 0x31, 0xa3, 0x90, 0xb8, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x09, +0x30, 0x31, 0xc6, 0xa4, 0x09, 0x40, 0x31, 0xc8, 0x10, 0x10, 0xa4, 0x09, +0x38, 0x31, 0xc7, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x08, 0xa0, 0x31, 0xb4, +0xa4, 0x08, 0xb0, 0x31, 0xb6, 0x10, 0x10, 0xa4, 0x08, 0xa8, 0x31, 0xb5, +0x10, 0x10, 0x91, 0x40, 0x90, 0xa0, 0x90, 0x50, 0x90, 0x28, 0x80, 0x30, +0xcb, 0x80, 0x30, 0xca, 0x90, 0x28, 0x80, 0x30, 0xc9, 0x80, 0x30, 0xc8, +0x90, 0x50, 0x90, 0x28, 0x80, 0x30, 0xc4, 0x80, 0x30, 0xc7, 0x90, 0x28, +0x80, 0x30, 0xc6, 0x80, 0x30, 0xc5, 0x90, 0xa0, 0x90, 0x50, 0x90, 0x28, +0x80, 0x30, 0xbc, 0x80, 0x30, 0xc3, 0x90, 0x28, 0x80, 0x30, 0xc2, 0x80, +0x30, 0xc1, 0x90, 0x50, 0x90, 0x28, 0x80, 0x30, 0xbd, 0x80, 0x30, 0xc0, +0x90, 0x28, 0x80, 0x30, 0xbf, 0x80, 0x30, 0xbe, 0x91, 0x88, 0x80, 0x90, +0xc0, 0x90, 0x60, 0x90, 0x28, 0x81, 0x31, 0x3b, 0x10, 0x10, 0x80, 0x31, +0x3a, 0x90, 0x28, 0x81, 0x31, 0x3d, 0x10, 0x10, 0x80, 0x31, 0x3c, 0x90, +0x60, 0x90, 0x28, 0x81, 0x31, 0x41, 0x10, 0x10, 0x80, 0x31, 0x40, 0x90, +0x28, 0x81, 0x31, 0x3f, 0x10, 0x10, 0x80, 0x31, 0x3e, 0x80, 0x10, 0x10, +0x10, 0x10, 0x90, 0x28, 0x81, 0x31, 0x38, 0x10, 0x10, 0x80, 0x31, 0x39, +0xa0, 0x0b, 0x90, 0xa0, 0x0a, 0xc8, 0x95, 0x60, 0x92, 0xb0, 0x91, 0x40, +0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x31, 0x56, 0x80, 0x31, 0x55, +0x10, 0x10, 0x80, 0x31, 0x54, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x06, 0xe8, +0x31, 0x68, 0xa4, 0x06, 0xe0, 0x31, 0x67, 0x10, 0x10, 0xa4, 0x06, 0xd8, +0x31, 0x66, 0x90, 0xb8, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x08, 0x08, 0x31, +0x8c, 0xa4, 0x08, 0x00, 0x31, 0x8b, 0x10, 0x10, 0xa4, 0x07, 0xf8, 0x31, +0x8a, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x07, 0x78, 0x31, 0x7a, 0xa4, 0x07, +0x70, 0x31, 0x79, 0x10, 0x10, 0xa4, 0x07, 0x68, 0x31, 0x78, 0x91, 0x40, +0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x31, 0x51, 0x80, 0x31, 0x53, +0x10, 0x10, 0x80, 0x31, 0x52, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x06, 0xc0, +0x31, 0x63, 0xa4, 0x06, 0xd0, 0x31, 0x65, 0x10, 0x10, 0xa4, 0x06, 0xc8, +0x31, 0x64, 0x90, 0xb8, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x07, 0xe0, 0x31, +0x87, 0xa4, 0x07, 0xf0, 0x31, 0x89, 0x10, 0x10, 0xa4, 0x07, 0xe8, 0x31, +0x88, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x07, 0x50, 0x31, 0x75, 0xa4, 0x07, +0x60, 0x31, 0x77, 0x10, 0x10, 0xa4, 0x07, 0x58, 0x31, 0x76, 0x92, 0xb0, +0x91, 0x40, 0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x31, 0x4e, 0x80, +0x31, 0x50, 0x10, 0x10, 0x80, 0x31, 0x4f, 0x90, 0x70, 0x90, 0x38, 0xa4, +0x06, 0xa8, 0x31, 0x60, 0xa4, 0x06, 0xb8, 0x31, 0x62, 0x10, 0x10, 0xa4, +0x06, 0xb0, 0x31, 0x61, 0x90, 0xb8, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x07, +0xc8, 0x31, 0x84, 0xa4, 0x07, 0xd8, 0x31, 0x86, 0x10, 0x10, 0xa4, 0x07, +0xd0, 0x31, 0x85, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x07, 0x38, 0x31, 0x72, +0xa4, 0x07, 0x48, 0x31, 0x74, 0x10, 0x10, 0xa4, 0x07, 0x40, 0x31, 0x73, +0x91, 0x40, 0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, 0x31, 0x4b, 0x80, +0x31, 0x4d, 0x10, 0x10, 0x80, 0x31, 0x4c, 0x90, 0x70, 0x90, 0x38, 0xa4, +0x06, 0x90, 0x31, 0x5d, 0xa4, 0x06, 0xa0, 0x31, 0x5f, 0x10, 0x10, 0xa4, +0x06, 0x98, 0x31, 0x5e, 0x90, 0xb8, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x07, +0xb0, 0x31, 0x81, 0xa4, 0x07, 0xc0, 0x31, 0x83, 0x10, 0x10, 0xa4, 0x07, +0xb8, 0x31, 0x82, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x07, 0x20, 0x31, 0x6f, +0xa4, 0x07, 0x30, 0x31, 0x71, 0x10, 0x10, 0xa4, 0x07, 0x28, 0x31, 0x70, +0x10, 0x10, 0x80, 0x10, 0x10, 0x10, 0x10, 0x90, 0x50, 0x90, 0x28, 0x80, +0x31, 0x42, 0x80, 0x31, 0x44, 0x10, 0x10, 0x80, 0x31, 0x43, 0x80, 0x95, +0x60, 0x92, 0xb0, 0x91, 0x40, 0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, +0x31, 0x48, 0x80, 0x31, 0x4a, 0x10, 0x10, 0x80, 0x31, 0x49, 0x90, 0x70, +0x90, 0x38, 0xa4, 0x06, 0x78, 0x31, 0x5a, 0xa4, 0x06, 0x88, 0x31, 0x5c, +0x10, 0x10, 0xa4, 0x06, 0x80, 0x31, 0x5b, 0x90, 0xb8, 0x90, 0x70, 0x90, +0x38, 0xa4, 0x07, 0x98, 0x31, 0x7e, 0xa4, 0x07, 0xa8, 0x31, 0x80, 0x10, +0x10, 0xa4, 0x07, 0xa0, 0x31, 0x7f, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x07, +0x08, 0x31, 0x6c, 0xa4, 0x07, 0x18, 0x31, 0x6e, 0x10, 0x10, 0xa4, 0x07, +0x10, 0x31, 0x6d, 0x91, 0x40, 0x90, 0x88, 0x90, 0x50, 0x90, 0x28, 0x80, +0x31, 0x45, 0x80, 0x31, 0x47, 0x10, 0x10, 0x80, 0x31, 0x46, 0x90, 0x70, +0x90, 0x38, 0xa4, 0x06, 0x60, 0x31, 0x57, 0xa4, 0x06, 0x70, 0x31, 0x59, +0x10, 0x10, 0xa4, 0x06, 0x68, 0x31, 0x58, 0x90, 0xb8, 0x90, 0x70, 0x90, +0x38, 0xa4, 0x07, 0x80, 0x31, 0x7b, 0xa4, 0x07, 0x90, 0x31, 0x7d, 0x10, +0x10, 0xa4, 0x07, 0x88, 0x31, 0x7c, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x06, +0xf0, 0x31, 0x69, 0xa4, 0x07, 0x00, 0x31, 0x6b, 0x10, 0x10, 0xa4, 0x06, +0xf8, 0x31, 0x6a, 0x10, 0x10, 0x91, 0x40, 0x90, 0xa0, 0x90, 0x50, 0x90, +0x28, 0x80, 0x30, 0xbb, 0x80, 0x30, 0xba, 0x90, 0x28, 0x80, 0x30, 0xb9, +0x80, 0x30, 0xb8, 0x90, 0x50, 0x90, 0x28, 0x80, 0x30, 0xb4, 0x80, 0x30, +0xb7, 0x90, 0x28, 0x80, 0x30, 0xb6, 0x80, 0x30, 0xb5, 0x90, 0xa0, 0x90, +0x50, 0x90, 0x28, 0x80, 0x30, 0xac, 0x80, 0x30, 0xb3, 0x90, 0x28, 0x80, +0x30, 0xb2, 0x80, 0x30, 0xb1, 0x90, 0x50, 0x90, 0x28, 0x80, 0x30, 0xad, +0x80, 0x30, 0xb0, 0x90, 0x28, 0x80, 0x30, 0xaf, 0x80, 0x30, 0xae, 0xc3, +0xc0, 0x30, 0x42, 0x9c, 0xe8, 0x07, 0x60, 0x91, 0x90, 0x90, 0xf0, 0x10, +0x10, 0x80, 0x88, 0x00, 0x80, 0x90, 0x50, 0x90, 0x28, 0x80, 0x33, 0xbc, +0x80, 0x33, 0xbd, 0x81, 0x33, 0xb3, 0xd0, 0x41, 0x80, 0x24, 0x1e, 0xb0, +0x24, 0x1e, 0xb8, 0x10, 0x10, 0x80, 0x90, 0x58, 0x80, 0x90, 0x28, 0x24, +0x1d, 0xb0, 0x24, 0x1d, 0xb8, 0x81, 0x24, 0x1d, 0x70, 0x92, 0x68, 0x91, +0x00, 0x80, 0x90, 0x90, 0x90, 0x30, 0x80, 0x24, 0x1e, 0x20, 0x90, 0x38, +0xa4, 0x1e, 0x18, 0x33, 0xca, 0x80, 0x33, 0xc9, 0x80, 0x90, 0x28, 0x80, +0x33, 0xd3, 0xa4, 0x1e, 0x00, 0x33, 0xd2, 0x80, 0x90, 0xc0, 0x90, 0x60, +0x90, 0x28, 0x80, 0x33, 0xcd, 0xa4, 0x1e, 0x10, 0x33, 0xcc, 0x90, 0x28, +0x80, 0x33, 0xc8, 0xa4, 0x1e, 0x08, 0x33, 0xc7, 0x90, 0x50, 0x90, 0x28, +0x80, 0x33, 0xd1, 0x80, 0x33, 0xd0, 0x90, 0x28, 0x24, 0x1e, 0xa8, 0x24, +0x1e, 0xa0, 0x90, 0x58, 0x80, 0x10, 0x10, 0x80, 0x10, 0x10, 0x80, 0x33, +0xbf, 0x80, 0x90, 0x40, 0x10, 0x10, 0x80, 0x24, 0x1d, 0x80, 0x80, 0x10, +0x10, 0x80, 0x33, 0xbe, 0x91, 0x58, 0x91, 0x00, 0x90, 0x80, 0x81, 0x90, +0x50, 0x90, 0x28, 0x80, 0x33, 0xba, 0x80, 0x33, 0xbb, 0x81, 0x33, 0xb2, +0x81, 0x90, 0x50, 0x90, 0x28, 0x80, 0x33, 0xb8, 0x80, 0x33, 0xb9, 0x81, +0x33, 0xb1, 0x83, 0x90, 0x28, 0x24, 0x1d, 0xa0, 0x24, 0x1d, 0xa8, 0x90, +0xe8, 0x81, 0x90, 0x88, 0x90, 0x38, 0x10, 0x10, 0x80, 0x33, 0xcb, 0x90, +0x28, 0x80, 0x33, 0xc6, 0x80, 0x33, 0xc5, 0x80, 0x90, 0x28, 0x80, 0x33, +0xcf, 0x80, 0x33, 0xce, 0x82, 0x10, 0x10, 0x80, 0x24, 0x1d, 0x78, 0x97, +0x10, 0x9e, 0x10, 0x06, 0x98, 0x93, 0x00, 0x91, 0x80, 0x90, 0xc0, 0x90, +0x60, 0x90, 0x38, 0xa4, 0x03, 0x80, 0x30, 0x71, 0x24, 0x03, 0x78, 0x90, +0x38, 0xa4, 0x04, 0x10, 0x30, 0x83, 0x24, 0x04, 0x08, 0x90, 0x60, 0x90, +0x38, 0xa4, 0x05, 0x30, 0x30, 0xa7, 0x24, 0x05, 0x28, 0x90, 0x38, 0xa4, +0x04, 0xa0, 0x30, 0x95, 0x24, 0x04, 0x98, 0x90, 0xc0, 0x90, 0x60, 0x90, +0x38, 0xa4, 0x03, 0x70, 0x30, 0x6c, 0x24, 0x03, 0x68, 0x90, 0x38, 0xa4, +0x04, 0x00, 0x30, 0x7e, 0x24, 0x03, 0xf8, 0x90, 0x60, 0x90, 0x38, 0xa4, +0x05, 0x20, 0x30, 0xa2, 0x24, 0x05, 0x18, 0x90, 0x38, 0xa4, 0x04, 0x90, +0x30, 0x90, 0x24, 0x04, 0x88, 0x91, 0x80, 0x90, 0xc0, 0x90, 0x60, 0x90, +0x38, 0xa4, 0x03, 0x58, 0x30, 0x69, 0x24, 0x03, 0x50, 0x90, 0x38, 0xa4, +0x03, 0xe8, 0x30, 0x7b, 0x24, 0x03, 0xe0, 0x90, 0x60, 0x90, 0x38, 0xa4, +0x05, 0x08, 0x30, 0x9f, 0x24, 0x05, 0x00, 0x90, 0x38, 0xa4, 0x04, 0x78, +0x30, 0x8d, 0x24, 0x04, 0x70, 0x90, 0xc0, 0x90, 0x60, 0x90, 0x38, 0xa4, +0x03, 0x40, 0x30, 0x66, 0x24, 0x03, 0x38, 0x90, 0x38, 0xa4, 0x03, 0xd0, +0x30, 0x78, 0x24, 0x03, 0xc8, 0x90, 0x60, 0x90, 0x38, 0xa4, 0x04, 0xf0, +0x30, 0x9c, 0x24, 0x04, 0xe8, 0x90, 0x38, 0xa4, 0x04, 0x60, 0x30, 0x8a, +0x24, 0x04, 0x58, 0x10, 0x10, 0x80, 0x10, 0x10, 0x10, 0x10, 0x90, 0x38, +0xa4, 0x02, 0xf8, 0x30, 0x5d, 0x24, 0x02, 0xf0, 0xd7, 0x42, 0x00, 0xa4, +0x31, 0x78, 0x36, 0x31, 0xa4, 0x31, 0x58, 0x36, 0x2d, 0x9c, 0xe0, 0x06, +0x90, 0x93, 0x00, 0x91, 0x80, 0x90, 0xc0, 0x90, 0x60, 0x90, 0x38, 0xa4, +0x03, 0x28, 0x30, 0x63, 0x24, 0x03, 0x20, 0x90, 0x38, 0xa4, 0x03, 0xb8, +0x30, 0x75, 0x24, 0x03, 0xb0, 0x90, 0x60, 0x90, 0x38, 0xa4, 0x04, 0xd8, +0x30, 0x99, 0x24, 0x04, 0xd0, 0x90, 0x38, 0xa4, 0x04, 0x48, 0x30, 0x87, +0x24, 0x04, 0x40, 0x90, 0xc0, 0x90, 0x60, 0x90, 0x38, 0xa4, 0x03, 0x10, +0x30, 0x60, 0x24, 0x03, 0x08, 0x90, 0x38, 0xa4, 0x03, 0xa0, 0x30, 0x72, +0x24, 0x03, 0x98, 0x90, 0x60, 0x90, 0x38, 0xa4, 0x04, 0xc0, 0x30, 0x96, +0x24, 0x04, 0xb8, 0x90, 0x38, 0xa4, 0x04, 0x30, 0x30, 0x84, 0x24, 0x04, +0x28, 0x10, 0x10, 0x90, 0xe0, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x02, 0x88, +0x30, 0x52, 0xa4, 0x02, 0x78, 0x30, 0x50, 0x90, 0x38, 0xa4, 0x02, 0x70, +0x30, 0x4b, 0xa4, 0x02, 0x60, 0x30, 0x4d, 0x90, 0x70, 0x90, 0x38, 0xa4, +0x02, 0x50, 0x30, 0x43, 0xa4, 0x02, 0x40, 0x30, 0x49, 0x90, 0x38, 0xa4, +0x02, 0x38, 0x30, 0x44, 0xa4, 0x02, 0x28, 0x30, 0x46, 0x91, 0x48, 0x80, +0x90, 0xa0, 0x90, 0x50, 0x90, 0x28, 0x80, 0x30, 0x56, 0x24, 0x02, 0xa8, +0x90, 0x28, 0x80, 0x30, 0x58, 0x24, 0x02, 0xb8, 0x90, 0x50, 0x90, 0x28, +0x80, 0x30, 0x5c, 0x24, 0x02, 0xd8, 0x90, 0x28, 0x80, 0x30, 0x5a, 0x24, +0x02, 0xc8, 0x80, 0x10, 0x10, 0x10, 0x10, 0x90, 0x28, 0x80, 0x30, 0x53, +0x24, 0x02, 0xa0, 0xd7, 0x42, 0x00, 0xa4, 0x31, 0x80, 0x36, 0x32, 0xa4, +0x31, 0x60, 0x36, 0x2e, 0xa0, 0x14, 0x90, 0xa0, 0x10, 0xb8, 0xa0, 0x0c, +0x88, 0x9e, 0x88, 0x09, 0xd0, 0x94, 0xf0, 0x90, 0xb0, 0x88, 0x00, 0x68, +0x84, 0x10, 0x10, 0xc9, 0xe1, 0x2c, 0x40, 0x85, 0x34, 0xcd, 0xcb, 0x61, +0x25, 0x00, 0x85, 0x34, 0xa3, 0x9a, 0x00, 0x03, 0xf8, 0x91, 0x98, 0x80, +0x91, 0x10, 0x90, 0xa0, 0x90, 0x68, 0x90, 0x20, 0x38, 0x96, 0xc9, 0xe2, +0x25, 0x00, 0x85, 0x34, 0xcb, 0xa4, 0x44, 0x90, 0x38, 0x93, 0x90, 0x38, +0xa4, 0x44, 0x58, 0x38, 0x8c, 0xa4, 0x44, 0x48, 0x38, 0x8a, 0x90, 0x48, +0x10, 0x10, 0xa4, 0x44, 0x10, 0x38, 0x83, 0x10, 0x10, 0x80, 0x38, 0x7f, +0x81, 0x10, 0x10, 0x80, 0xa4, 0x43, 0xe0, 0x38, 0x7d, 0x91, 0xb0, 0x91, +0x60, 0x90, 0xe0, 0x90, 0x70, 0x90, 0x38, 0xa4, 0x44, 0x80, 0x38, 0x91, +0xa4, 0x44, 0x70, 0x38, 0x8f, 0x90, 0x38, 0xa4, 0x44, 0x38, 0x38, 0x88, +0xa4, 0x44, 0x28, 0x38, 0x86, 0x90, 0x48, 0x10, 0x10, 0xa4, 0x44, 0x00, +0x38, 0x81, 0x10, 0x10, 0x80, 0x38, 0x7e, 0x90, 0x28, 0x80, 0x38, 0x77, +0x80, 0x38, 0x76, 0x81, 0x10, 0x10, 0x80, 0xa4, 0x43, 0xd0, 0x38, 0x7b, +0xcb, 0x61, 0x24, 0xc0, 0x85, 0x34, 0xa2, 0x90, 0xd8, 0x88, 0x00, 0x90, +0x84, 0x90, 0x38, 0xc1, 0xc0, 0x85, 0x38, 0x9a, 0xc9, 0xe1, 0x2c, 0x00, +0x85, 0x34, 0xc9, 0xcb, 0x61, 0x24, 0x80, 0x85, 0x34, 0xa1, 0x88, 0x00, +0x68, 0x84, 0x10, 0x10, 0xc9, 0xe1, 0x2b, 0xc0, 0x85, 0x34, 0xc7, 0xcb, +0x61, 0x24, 0x40, 0x85, 0x34, 0xa0, 0x91, 0xf8, 0x90, 0xb0, 0x88, 0x00, +0x68, 0x84, 0x10, 0x10, 0xc9, 0xe1, 0x2b, 0x40, 0x85, 0x34, 0xc3, 0xcb, +0x61, 0x23, 0xc0, 0x85, 0x34, 0x9e, 0x88, 0x01, 0x00, 0x90, 0xa0, 0x81, +0x90, 0x70, 0x80, 0x90, 0x20, 0x38, 0x8d, 0xc9, 0xe1, 0x2b, 0x00, 0x85, +0x34, 0xc1, 0x81, 0x38, 0x84, 0x81, 0x10, 0x10, 0x80, 0xa4, 0x43, 0xc0, +0x38, 0x79, 0xcb, 0x61, 0x23, 0x80, 0x85, 0x34, 0x9d, 0x90, 0xb0, 0x88, +0x00, 0x68, 0x84, 0x10, 0x10, 0xc9, 0xe1, 0x2a, 0xc0, 0x85, 0x34, 0xbf, +0xcb, 0x61, 0x23, 0x40, 0x85, 0x34, 0x9c, 0x88, 0x00, 0x68, 0x84, 0x10, +0x10, 0xc9, 0xe1, 0x2a, 0x80, 0x85, 0x34, 0xbd, 0xcb, 0x61, 0x23, 0x00, +0x85, 0x34, 0x9b, 0x92, 0x38, 0x81, 0x91, 0x68, 0x91, 0x18, 0x90, 0x80, +0x90, 0x40, 0x80, 0xa4, 0x45, 0x48, 0x38, 0xaa, 0x80, 0xa4, 0x45, 0x40, +0x38, 0xa7, 0x90, 0x28, 0x81, 0x38, 0xa6, 0x90, 0x38, 0xa4, 0x45, 0x20, +0x38, 0xa5, 0xa4, 0x45, 0x10, 0x38, 0xa3, 0x90, 0x28, 0x80, 0x38, 0xa1, +0x80, 0x38, 0xa0, 0x80, 0x90, 0x40, 0x10, 0x10, 0x80, 0x24, 0x44, 0xf8, +0x10, 0x10, 0x90, 0x38, 0xa4, 0x44, 0xe8, 0x38, 0x9e, 0xa4, 0x44, 0xd8, +0x38, 0x9c, 0x90, 0x50, 0x80, 0xc9, 0xa2, 0x26, 0x00, 0x85, 0x38, 0x99, +0x80, 0x38, 0x97, 0x9a, 0xd0, 0x03, 0xe0, 0x91, 0x60, 0x90, 0xb0, 0x88, +0x00, 0x68, 0x84, 0x10, 0x10, 0xc9, 0xe1, 0x2a, 0x00, 0x85, 0x34, 0xb9, +0xcb, 0x61, 0x22, 0x80, 0x85, 0x34, 0x99, 0x88, 0x00, 0x68, 0x84, 0x10, +0x10, 0xc9, 0xe1, 0x29, 0xc0, 0x85, 0x34, 0xb7, 0xcb, 0x61, 0x22, 0x40, +0x85, 0x34, 0x98, 0x90, 0xb0, 0x88, 0x00, 0x68, 0x84, 0x10, 0x10, 0xc9, +0xe1, 0x29, 0x80, 0x85, 0x34, 0xb5, 0xcb, 0x61, 0x22, 0x00, 0x85, 0x34, +0x97, 0x88, 0x00, 0x68, 0x84, 0x10, 0x10, 0xc9, 0xe1, 0x29, 0x40, 0x85, +0x34, 0xb3, 0xcb, 0x61, 0x21, 0xc0, 0x85, 0x34, 0x96, 0x90, 0x90, 0x90, +0x48, 0xcb, 0xa1, 0x20, 0x00, 0x85, 0x34, 0x85, 0xcb, 0xa1, 0x1f, 0xc0, +0x85, 0x34, 0x84, 0x90, 0x48, 0xcb, 0xa1, 0x1f, 0x80, 0x85, 0x34, 0x83, +0xcb, 0xa1, 0x1f, 0x40, 0x85, 0x34, 0x82, 0xcb, 0xa2, 0x1d, 0x00, 0x80, +0x38, 0x75, 0x92, 0x40, 0x91, 0x20, 0x90, 0x90, 0x90, 0x48, 0x8c, 0x23, +0x60, 0x84, 0x24, 0x23, 0xd8, 0x8c, 0x23, 0x58, 0x84, 0x24, 0x23, 0xd0, +0x90, 0x48, 0x8c, 0x23, 0x50, 0x84, 0x24, 0x23, 0xc8, 0x8c, 0x23, 0x48, +0x84, 0x24, 0x23, 0xc0, 0x90, 0x90, 0x90, 0x48, 0x8c, 0x23, 0x38, 0x84, +0x24, 0x23, 0xb0, 0x8c, 0x23, 0x30, 0x84, 0x24, 0x23, 0xa8, 0x90, 0x48, +0x8c, 0x23, 0x28, 0x84, 0x24, 0x23, 0xa0, 0x8c, 0x23, 0x20, 0x84, 0x24, +0x23, 0x98, 0x91, 0x20, 0x90, 0x90, 0x90, 0x48, 0x8c, 0x23, 0x10, 0x84, +0x24, 0x23, 0x88, 0x8c, 0x23, 0x08, 0x84, 0x24, 0x23, 0x80, 0x90, 0x48, +0x8c, 0x23, 0x00, 0x84, 0x24, 0x23, 0x78, 0x8c, 0x22, 0xf8, 0x84, 0x24, +0x23, 0x70, 0x90, 0x38, 0xa4, 0x22, 0xe0, 0x34, 0x5d, 0xa4, 0x22, 0xd0, +0x34, 0x5b, 0xa0, 0x0f, 0x50, 0xa0, 0x09, 0x08, 0x9a, 0x30, 0x04, 0x40, +0x91, 0x90, 0x90, 0xc8, 0x98, 0x50, 0x00, 0x80, 0xe5, 0x22, 0x1c, 0x00, +0x38, 0x6c, 0xe5, 0x22, 0x18, 0x00, 0x38, 0x6a, 0xcb, 0x61, 0x12, 0x40, +0x85, 0x34, 0x58, 0x98, 0x50, 0x00, 0x80, 0xe5, 0x22, 0x14, 0x00, 0x38, +0x4c, 0xe5, 0x22, 0x10, 0x00, 0x38, 0x4a, 0xcb, 0x61, 0x12, 0x00, 0x85, +0x34, 0x57, 0x90, 0x48, 0xcb, 0xa1, 0x11, 0xc0, 0x85, 0x34, 0x56, 0xcb, +0xa1, 0x11, 0x80, 0x85, 0x34, 0x55, 0x91, 0x90, 0x90, 0xc8, 0x98, 0x50, +0x00, 0x80, 0xe5, 0x22, 0x09, 0x00, 0x38, 0x30, 0xe5, 0x22, 0x03, 0x00, +0x38, 0x18, 0xcb, 0x61, 0x11, 0x00, 0x85, 0x34, 0x53, 0x98, 0x50, 0x00, +0x80, 0xe5, 0x21, 0xfd, 0x00, 0x38, 0x00, 0xe5, 0x21, 0xf7, 0x00, 0x37, +0xe8, 0xcb, 0x61, 0x10, 0xc0, 0x85, 0x34, 0x52, 0x90, 0x48, 0xcb, 0xa1, +0x10, 0x80, 0x85, 0x34, 0x51, 0xcb, 0xa1, 0x10, 0x40, 0x85, 0x34, 0x50, +0x92, 0x20, 0x91, 0x30, 0x90, 0xb8, 0xd5, 0x03, 0x00, 0xc0, 0xc0, 0x81, +0x8c, 0x01, 0xa0, 0x84, 0x30, 0x3e, 0xc0, 0xc0, 0x81, 0x8c, 0x01, 0x80, +0x84, 0x30, 0x3c, 0xd5, 0x02, 0x00, 0xc0, 0xc0, 0x81, 0x30, 0x28, 0xc0, +0xc0, 0x81, 0x30, 0x24, 0x90, 0x78, 0xd5, 0x02, 0x00, 0xc0, 0xc0, 0x81, +0x30, 0x1c, 0xc0, 0xc0, 0x81, 0x30, 0x18, 0xd5, 0x02, 0x00, 0xc0, 0xc0, +0x81, 0x30, 0x10, 0xc0, 0xc0, 0x81, 0x30, 0x0c, 0x91, 0x70, 0x90, 0xd8, +0xd5, 0x03, 0x80, 0xc8, 0xe1, 0xf3, 0x00, 0x81, 0x8c, 0x01, 0xc0, 0x84, +0x30, 0x40, 0xc8, 0xe1, 0xf4, 0x00, 0x81, 0x8c, 0x01, 0x90, 0x84, 0x30, +0x3d, 0xd5, 0x02, 0x80, 0xc8, 0xe1, 0xf2, 0x80, 0x81, 0x30, 0x2c, 0xc8, +0xe1, 0xef, 0x80, 0x81, 0x30, 0x26, 0x90, 0x98, 0xd5, 0x02, 0x80, 0xc8, +0xe1, 0xe9, 0x80, 0x81, 0x30, 0x20, 0xc8, 0xe1, 0xea, 0x80, 0x81, 0x30, +0x1a, 0xd5, 0x02, 0x80, 0xc8, 0xe1, 0xe9, 0x00, 0x81, 0x30, 0x14, 0xc8, +0xe1, 0xe6, 0x00, 0x81, 0x30, 0x0e, 0x9a, 0x30, 0x04, 0x40, 0x91, 0x90, +0x90, 0xc8, 0x98, 0x50, 0x00, 0x80, 0xe5, 0x22, 0x16, 0x00, 0x38, 0x54, +0xe5, 0x22, 0x17, 0x00, 0x38, 0x66, 0xcb, 0x61, 0x0f, 0xc0, 0x85, 0x34, +0x4e, 0x98, 0x50, 0x00, 0x80, 0xe5, 0x22, 0x0e, 0x00, 0x38, 0x34, 0xe5, +0x22, 0x0f, 0x00, 0x38, 0x46, 0xcb, 0x61, 0x0f, 0x80, 0x85, 0x34, 0x4d, +0x90, 0x48, 0xcb, 0xa1, 0x0f, 0x40, 0x85, 0x34, 0x4c, 0xcb, 0xa1, 0x0f, +0x00, 0x85, 0x34, 0x4b, 0x91, 0x90, 0x90, 0xc8, 0x98, 0x50, 0x00, 0x80, +0xe5, 0x22, 0x07, 0x00, 0x38, 0x28, 0xe5, 0x22, 0x01, 0x00, 0x38, 0x10, +0xcb, 0x61, 0x0d, 0x40, 0x85, 0x34, 0x3a, 0x98, 0x50, 0x00, 0x80, 0xe5, +0x21, 0xfb, 0x00, 0x37, 0xf8, 0xe5, 0x21, 0xf5, 0x00, 0x37, 0xe0, 0xcb, +0x61, 0x0d, 0x00, 0x85, 0x34, 0x39, 0x90, 0x48, 0xcb, 0xa1, 0x0c, 0xc0, +0x85, 0x34, 0x38, 0xcb, 0xa1, 0x0c, 0x80, 0x85, 0x34, 0x37, 0x91, 0x00, +0x90, 0x80, 0x90, 0x40, 0xe5, 0x20, 0x02, 0x40, 0x30, 0x0a, 0xe5, 0x20, +0x01, 0x80, 0x30, 0x07, 0x90, 0x40, 0xe5, 0x20, 0x00, 0xc0, 0x30, 0x04, +0xe5, 0x20, 0x00, 0x00, 0x30, 0x01, 0x90, 0x80, 0x90, 0x40, 0xe5, 0x21, +0xed, 0x00, 0x37, 0xae, 0xe5, 0x21, 0xee, 0x40, 0x37, 0xc4, 0x90, 0x40, +0xe5, 0x21, 0xe3, 0x80, 0x37, 0x88, 0xe5, 0x21, 0xe4, 0xc0, 0x37, 0x9e, +0x80, 0x99, 0x28, 0x02, 0xf0, 0x8c, 0x21, 0x48, 0x90, 0x80, 0x90, 0x40, +0xe5, 0x22, 0x19, 0x00, 0x38, 0x62, 0xe5, 0x22, 0x17, 0x80, 0x38, 0x68, +0x90, 0x40, 0xe5, 0x22, 0x11, 0x00, 0x38, 0x42, 0xe5, 0x22, 0x0f, 0x80, +0x38, 0x48, 0x91, 0x48, 0x90, 0xc8, 0x98, 0x50, 0x00, 0x80, 0xe5, 0x22, +0x08, 0x00, 0x38, 0x2c, 0xe5, 0x22, 0x02, 0x00, 0x38, 0x14, 0xcb, 0x61, +0x0b, 0x00, 0x85, 0x34, 0x30, 0x90, 0x40, 0xe5, 0x21, 0xfc, 0x00, 0x37, +0xfc, 0xe5, 0x21, 0xf6, 0x00, 0x37, 0xe4, 0x90, 0x48, 0xcb, 0xa1, 0x0a, +0x80, 0x85, 0x34, 0x2e, 0xcb, 0xa1, 0x0a, 0xc0, 0x85, 0x34, 0x2f, 0x10, +0x10, 0x90, 0x80, 0x90, 0x40, 0xe5, 0x21, 0xf0, 0x80, 0x37, 0xc0, 0xe5, +0x21, 0xef, 0x00, 0x37, 0xc8, 0x90, 0x40, 0xe5, 0x21, 0xe7, 0x00, 0x37, +0x9a, 0xe5, 0x21, 0xe5, 0x80, 0x37, 0xa2, +}; + +static const struct ia64_dis_names ia64_dis_names[] = { +{ 0x51, 40, 0, 9 }, +{ 0x31, 40, 1, 19 }, +{ 0x11, 41, 0, 18 }, +{ 0x29, 40, 0, 11 }, +{ 0x19, 40, 1, 23 }, +{ 0x9, 41, 0, 22 }, +{ 0x15, 40, 0, 13 }, +{ 0xd, 40, 1, 27 }, +{ 0x5, 41, 0, 26 }, +{ 0xb, 40, 0, 15 }, +{ 0x7, 40, 1, 31 }, +{ 0x3, 41, 0, 30 }, +{ 0x51, 38, 1, 57 }, +{ 0x50, 38, 0, 33 }, +{ 0xd1, 38, 1, 56 }, +{ 0xd0, 38, 0, 32 }, +{ 0x31, 38, 1, 67 }, +{ 0x30, 38, 1, 43 }, +{ 0x11, 39, 1, 66 }, +{ 0x10, 39, 0, 42 }, +{ 0x71, 38, 1, 65 }, +{ 0x70, 38, 1, 41 }, +{ 0x31, 39, 1, 64 }, +{ 0x30, 39, 0, 40 }, +{ 0x29, 38, 1, 59 }, +{ 0x28, 38, 0, 35 }, +{ 0x69, 38, 1, 58 }, +{ 0x68, 38, 0, 34 }, +{ 0x19, 38, 1, 71 }, +{ 0x18, 38, 1, 47 }, +{ 0x9, 39, 1, 70 }, +{ 0x8, 39, 0, 46 }, +{ 0x39, 38, 1, 69 }, +{ 0x38, 38, 1, 45 }, +{ 0x19, 39, 1, 68 }, +{ 0x18, 39, 0, 44 }, +{ 0x15, 38, 1, 61 }, +{ 0x14, 38, 0, 37 }, +{ 0x35, 38, 1, 60 }, +{ 0x34, 38, 0, 36 }, +{ 0xd, 38, 1, 75 }, +{ 0xc, 38, 1, 51 }, +{ 0x5, 39, 1, 74 }, +{ 0x4, 39, 0, 50 }, +{ 0x1d, 38, 1, 73 }, +{ 0x1c, 38, 1, 49 }, +{ 0xd, 39, 1, 72 }, +{ 0xc, 39, 0, 48 }, +{ 0xb, 38, 1, 63 }, +{ 0xa, 38, 0, 39 }, +{ 0x1b, 38, 1, 62 }, +{ 0x1a, 38, 0, 38 }, +{ 0x7, 38, 1, 79 }, +{ 0x6, 38, 1, 55 }, +{ 0x3, 39, 1, 78 }, +{ 0x2, 39, 0, 54 }, +{ 0xf, 38, 1, 77 }, +{ 0xe, 38, 1, 53 }, +{ 0x7, 39, 1, 76 }, +{ 0x6, 39, 0, 52 }, +{ 0x8, 37, 0, 81 }, +{ 0x18, 37, 0, 80 }, +{ 0x1, 37, 1, 85 }, +{ 0x2, 37, 0, 84 }, +{ 0x3, 37, 1, 83 }, +{ 0x4, 37, 0, 82 }, +{ 0x1, 284, 0, 86 }, +{ 0x20, 237, 0, 96 }, +{ 0x220, 237, 0, 92 }, +{ 0x1220, 237, 0, 89 }, +{ 0xa20, 237, 0, 90 }, +{ 0x620, 237, 0, 91 }, +{ 0x120, 237, 0, 93 }, +{ 0xa0, 237, 0, 94 }, +{ 0x60, 237, 0, 95 }, +{ 0x10, 237, 0, 100 }, +{ 0x90, 237, 0, 97 }, +{ 0x50, 237, 0, 98 }, +{ 0x30, 237, 0, 99 }, +{ 0x8, 237, 0, 101 }, +{ 0x4, 237, 0, 102 }, +{ 0x2, 237, 0, 103 }, +{ 0x1, 237, 0, 104 }, +{ 0x1, 357, 0, 106 }, +{ 0x3, 357, 0, 105 }, +{ 0x2, 363, 0, 107 }, +{ 0x1, 363, 0, 108 }, +{ 0x2, 359, 0, 109 }, +{ 0x1, 359, 0, 110 }, +{ 0x2, 361, 0, 111 }, +{ 0x1, 361, 0, 112 }, +{ 0x2, 365, 0, 113 }, +{ 0x1, 365, 0, 114 }, +{ 0x1, 216, 0, 141 }, +{ 0x5, 216, 0, 139 }, +{ 0x3, 216, 0, 140 }, +{ 0x140, 225, 0, 117 }, +{ 0x540, 225, 0, 115 }, +{ 0x340, 225, 0, 116 }, +{ 0xc0, 225, 0, 129 }, +{ 0x2c0, 225, 0, 127 }, +{ 0x1c0, 225, 0, 128 }, +{ 0x20, 225, 0, 144 }, +{ 0xa0, 225, 0, 142 }, +{ 0x60, 225, 0, 143 }, +{ 0x10, 225, 0, 156 }, +{ 0x50, 225, 0, 154 }, +{ 0x30, 225, 0, 155 }, +{ 0x8, 225, 0, 168 }, +{ 0x28, 225, 0, 166 }, +{ 0x18, 225, 0, 167 }, +{ 0x4, 225, 0, 178 }, +{ 0x2, 225, 0, 179 }, +{ 0x1, 225, 0, 180 }, +{ 0x140, 219, 0, 120 }, +{ 0x540, 219, 0, 118 }, +{ 0x340, 219, 0, 119 }, +{ 0xc0, 219, 0, 132 }, +{ 0x2c0, 219, 0, 130 }, +{ 0x1c0, 219, 0, 131 }, +{ 0x20, 219, 0, 147 }, +{ 0xa0, 219, 0, 145 }, +{ 0x60, 219, 0, 146 }, +{ 0x10, 219, 0, 159 }, +{ 0x50, 219, 0, 157 }, +{ 0x30, 219, 0, 158 }, +{ 0x8, 219, 0, 171 }, +{ 0x28, 219, 0, 169 }, +{ 0x18, 219, 0, 170 }, +{ 0x4, 219, 0, 181 }, +{ 0x2, 219, 0, 182 }, +{ 0x1, 219, 0, 183 }, +{ 0x140, 222, 0, 123 }, +{ 0x540, 222, 0, 121 }, +{ 0x340, 222, 0, 122 }, +{ 0xc0, 222, 0, 135 }, +{ 0x2c0, 222, 0, 133 }, +{ 0x1c0, 222, 0, 134 }, +{ 0x20, 222, 0, 150 }, +{ 0xa0, 222, 0, 148 }, +{ 0x60, 222, 0, 149 }, +{ 0x10, 222, 0, 162 }, +{ 0x50, 222, 0, 160 }, +{ 0x30, 222, 0, 161 }, +{ 0x8, 222, 0, 174 }, +{ 0x28, 222, 0, 172 }, +{ 0x18, 222, 0, 173 }, +{ 0x4, 222, 0, 184 }, +{ 0x2, 222, 0, 185 }, +{ 0x1, 222, 0, 186 }, +{ 0x140, 234, 0, 126 }, +{ 0x540, 234, 0, 124 }, +{ 0x340, 234, 0, 125 }, +{ 0xc0, 234, 0, 138 }, +{ 0x2c0, 234, 0, 136 }, +{ 0x1c0, 234, 0, 137 }, +{ 0x20, 234, 0, 153 }, +{ 0xa0, 234, 0, 151 }, +{ 0x60, 234, 0, 152 }, +{ 0x10, 234, 0, 165 }, +{ 0x50, 234, 0, 163 }, +{ 0x30, 234, 0, 164 }, +{ 0x8, 234, 0, 177 }, +{ 0x28, 234, 0, 175 }, +{ 0x18, 234, 0, 176 }, +{ 0x4, 234, 0, 187 }, +{ 0x2, 234, 0, 188 }, +{ 0x1, 234, 0, 189 }, +{ 0x8, 338, 0, 190 }, +{ 0x4, 338, 0, 191 }, +{ 0x2, 338, 0, 192 }, +{ 0x1, 338, 0, 193 }, +{ 0x20, 236, 0, 201 }, +{ 0x220, 236, 0, 197 }, +{ 0x1220, 236, 0, 194 }, +{ 0xa20, 236, 0, 195 }, +{ 0x620, 236, 0, 196 }, +{ 0x120, 236, 0, 198 }, +{ 0xa0, 236, 0, 199 }, +{ 0x60, 236, 0, 200 }, +{ 0x10, 236, 0, 205 }, +{ 0x90, 236, 0, 202 }, +{ 0x50, 236, 0, 203 }, +{ 0x30, 236, 0, 204 }, +{ 0x8, 236, 0, 206 }, +{ 0x4, 236, 0, 207 }, +{ 0x2, 236, 0, 208 }, +{ 0x1, 236, 0, 209 }, +{ 0x20, 235, 0, 217 }, +{ 0x220, 235, 0, 213 }, +{ 0x1220, 235, 0, 210 }, +{ 0xa20, 235, 0, 211 }, +{ 0x620, 235, 0, 212 }, +{ 0x120, 235, 0, 214 }, +{ 0xa0, 235, 0, 215 }, +{ 0x60, 235, 0, 216 }, +{ 0x10, 235, 0, 221 }, +{ 0x90, 235, 0, 218 }, +{ 0x50, 235, 0, 219 }, +{ 0x30, 235, 0, 220 }, +{ 0x8, 235, 0, 222 }, +{ 0x4, 235, 0, 223 }, +{ 0x2, 235, 0, 224 }, +{ 0x1, 235, 0, 225 }, +{ 0x140, 227, 0, 228 }, +{ 0x540, 227, 0, 226 }, +{ 0x340, 227, 0, 227 }, +{ 0xc0, 227, 0, 237 }, +{ 0x2c0, 227, 0, 235 }, +{ 0x1c0, 227, 0, 236 }, +{ 0x20, 227, 0, 246 }, +{ 0xa0, 227, 0, 244 }, +{ 0x60, 227, 0, 245 }, +{ 0x10, 227, 0, 255 }, +{ 0x50, 227, 0, 253 }, +{ 0x30, 227, 0, 254 }, +{ 0x8, 227, 0, 264 }, +{ 0x28, 227, 0, 262 }, +{ 0x18, 227, 0, 263 }, +{ 0x4, 227, 0, 271 }, +{ 0x2, 227, 0, 272 }, +{ 0x1, 227, 0, 273 }, +{ 0x140, 229, 0, 231 }, +{ 0x540, 229, 0, 229 }, +{ 0x340, 229, 0, 230 }, +{ 0xc0, 229, 0, 240 }, +{ 0x2c0, 229, 0, 238 }, +{ 0x1c0, 229, 0, 239 }, +{ 0x20, 229, 0, 249 }, +{ 0xa0, 229, 0, 247 }, +{ 0x60, 229, 0, 248 }, +{ 0x10, 229, 0, 258 }, +{ 0x50, 229, 0, 256 }, +{ 0x30, 229, 0, 257 }, +{ 0x8, 229, 0, 267 }, +{ 0x28, 229, 0, 265 }, +{ 0x18, 229, 0, 266 }, +{ 0x4, 229, 0, 274 }, +{ 0x2, 229, 0, 275 }, +{ 0x1, 229, 0, 276 }, +{ 0x140, 231, 0, 234 }, +{ 0x540, 231, 0, 232 }, +{ 0x340, 231, 0, 233 }, +{ 0xc0, 231, 0, 243 }, +{ 0x2c0, 231, 0, 241 }, +{ 0x1c0, 231, 0, 242 }, +{ 0x20, 231, 0, 252 }, +{ 0xa0, 231, 0, 250 }, +{ 0x60, 231, 0, 251 }, +{ 0x10, 231, 0, 261 }, +{ 0x50, 231, 0, 259 }, +{ 0x30, 231, 0, 260 }, +{ 0x8, 231, 0, 270 }, +{ 0x28, 231, 0, 268 }, +{ 0x18, 231, 0, 269 }, +{ 0x4, 231, 0, 277 }, +{ 0x2, 231, 0, 278 }, +{ 0x1, 231, 0, 279 }, +{ 0x140, 226, 0, 282 }, +{ 0x540, 226, 0, 280 }, +{ 0x340, 226, 0, 281 }, +{ 0xc0, 226, 0, 291 }, +{ 0x2c0, 226, 0, 289 }, +{ 0x1c0, 226, 0, 290 }, +{ 0x20, 226, 0, 300 }, +{ 0xa0, 226, 0, 298 }, +{ 0x60, 226, 0, 299 }, +{ 0x10, 226, 0, 309 }, +{ 0x50, 226, 0, 307 }, +{ 0x30, 226, 0, 308 }, +{ 0x8, 226, 0, 318 }, +{ 0x28, 226, 0, 316 }, +{ 0x18, 226, 0, 317 }, +{ 0x4, 226, 0, 325 }, +{ 0x2, 226, 0, 326 }, +{ 0x1, 226, 0, 327 }, +{ 0x140, 228, 0, 285 }, +{ 0x540, 228, 0, 283 }, +{ 0x340, 228, 0, 284 }, +{ 0xc0, 228, 0, 294 }, +{ 0x2c0, 228, 0, 292 }, +{ 0x1c0, 228, 0, 293 }, +{ 0x20, 228, 0, 303 }, +{ 0xa0, 228, 0, 301 }, +{ 0x60, 228, 0, 302 }, +{ 0x10, 228, 0, 312 }, +{ 0x50, 228, 0, 310 }, +{ 0x30, 228, 0, 311 }, +{ 0x8, 228, 0, 321 }, +{ 0x28, 228, 0, 319 }, +{ 0x18, 228, 0, 320 }, +{ 0x4, 228, 0, 328 }, +{ 0x2, 228, 0, 329 }, +{ 0x1, 228, 0, 330 }, +{ 0x140, 230, 0, 288 }, +{ 0x540, 230, 0, 286 }, +{ 0x340, 230, 0, 287 }, +{ 0xc0, 230, 0, 297 }, +{ 0x2c0, 230, 0, 295 }, +{ 0x1c0, 230, 0, 296 }, +{ 0x20, 230, 0, 306 }, +{ 0xa0, 230, 0, 304 }, +{ 0x60, 230, 0, 305 }, +{ 0x10, 230, 0, 315 }, +{ 0x50, 230, 0, 313 }, +{ 0x30, 230, 0, 314 }, +{ 0x8, 230, 0, 324 }, +{ 0x28, 230, 0, 322 }, +{ 0x18, 230, 0, 323 }, +{ 0x4, 230, 0, 331 }, +{ 0x2, 230, 0, 332 }, +{ 0x1, 230, 0, 333 }, +{ 0x1, 356, 0, 335 }, +{ 0x3, 356, 0, 334 }, +{ 0x2, 362, 0, 336 }, +{ 0x1, 362, 0, 337 }, +{ 0x2, 358, 0, 338 }, +{ 0x1, 358, 0, 339 }, +{ 0x2, 360, 0, 340 }, +{ 0x1, 360, 0, 341 }, +{ 0x2, 364, 0, 342 }, +{ 0x1, 364, 0, 343 }, +{ 0x1, 215, 0, 370 }, +{ 0x5, 215, 0, 368 }, +{ 0x3, 215, 0, 369 }, +{ 0x140, 224, 0, 346 }, +{ 0x540, 224, 0, 344 }, +{ 0x340, 224, 0, 345 }, +{ 0xc0, 224, 0, 358 }, +{ 0x2c0, 224, 0, 356 }, +{ 0x1c0, 224, 0, 357 }, +{ 0x20, 224, 0, 373 }, +{ 0xa0, 224, 0, 371 }, +{ 0x60, 224, 0, 372 }, +{ 0x10, 224, 0, 385 }, +{ 0x50, 224, 0, 383 }, +{ 0x30, 224, 0, 384 }, +{ 0x8, 224, 0, 397 }, +{ 0x28, 224, 0, 395 }, +{ 0x18, 224, 0, 396 }, +{ 0x4, 224, 0, 407 }, +{ 0x2, 224, 0, 408 }, +{ 0x1, 224, 0, 409 }, +{ 0x140, 218, 0, 349 }, +{ 0x540, 218, 0, 347 }, +{ 0x340, 218, 0, 348 }, +{ 0xc0, 218, 0, 361 }, +{ 0x2c0, 218, 0, 359 }, +{ 0x1c0, 218, 0, 360 }, +{ 0x20, 218, 0, 376 }, +{ 0xa0, 218, 0, 374 }, +{ 0x60, 218, 0, 375 }, +{ 0x10, 218, 0, 388 }, +{ 0x50, 218, 0, 386 }, +{ 0x30, 218, 0, 387 }, +{ 0x8, 218, 0, 400 }, +{ 0x28, 218, 0, 398 }, +{ 0x18, 218, 0, 399 }, +{ 0x4, 218, 0, 410 }, +{ 0x2, 218, 0, 411 }, +{ 0x1, 218, 0, 412 }, +{ 0x140, 221, 0, 352 }, +{ 0x540, 221, 0, 350 }, +{ 0x340, 221, 0, 351 }, +{ 0xc0, 221, 0, 364 }, +{ 0x2c0, 221, 0, 362 }, +{ 0x1c0, 221, 0, 363 }, +{ 0x20, 221, 0, 379 }, +{ 0xa0, 221, 0, 377 }, +{ 0x60, 221, 0, 378 }, +{ 0x10, 221, 0, 391 }, +{ 0x50, 221, 0, 389 }, +{ 0x30, 221, 0, 390 }, +{ 0x8, 221, 0, 403 }, +{ 0x28, 221, 0, 401 }, +{ 0x18, 221, 0, 402 }, +{ 0x4, 221, 0, 413 }, +{ 0x2, 221, 0, 414 }, +{ 0x1, 221, 0, 415 }, +{ 0x140, 233, 0, 355 }, +{ 0x540, 233, 0, 353 }, +{ 0x340, 233, 0, 354 }, +{ 0xc0, 233, 0, 367 }, +{ 0x2c0, 233, 0, 365 }, +{ 0x1c0, 233, 0, 366 }, +{ 0x20, 233, 0, 382 }, +{ 0xa0, 233, 0, 380 }, +{ 0x60, 233, 0, 381 }, +{ 0x10, 233, 0, 394 }, +{ 0x50, 233, 0, 392 }, +{ 0x30, 233, 0, 393 }, +{ 0x8, 233, 0, 406 }, +{ 0x28, 233, 0, 404 }, +{ 0x18, 233, 0, 405 }, +{ 0x4, 233, 0, 416 }, +{ 0x2, 233, 0, 417 }, +{ 0x1, 233, 0, 418 }, +{ 0x1, 214, 0, 445 }, +{ 0x5, 214, 0, 443 }, +{ 0x3, 214, 0, 444 }, +{ 0x140, 223, 0, 421 }, +{ 0x540, 223, 0, 419 }, +{ 0x340, 223, 0, 420 }, +{ 0xc0, 223, 0, 433 }, +{ 0x2c0, 223, 0, 431 }, +{ 0x1c0, 223, 0, 432 }, +{ 0x20, 223, 0, 448 }, +{ 0xa0, 223, 0, 446 }, +{ 0x60, 223, 0, 447 }, +{ 0x10, 223, 0, 460 }, +{ 0x50, 223, 0, 458 }, +{ 0x30, 223, 0, 459 }, +{ 0x8, 223, 0, 472 }, +{ 0x28, 223, 0, 470 }, +{ 0x18, 223, 0, 471 }, +{ 0x4, 223, 0, 482 }, +{ 0x2, 223, 0, 483 }, +{ 0x1, 223, 0, 484 }, +{ 0x140, 217, 0, 424 }, +{ 0x540, 217, 0, 422 }, +{ 0x340, 217, 0, 423 }, +{ 0xc0, 217, 0, 436 }, +{ 0x2c0, 217, 0, 434 }, +{ 0x1c0, 217, 0, 435 }, +{ 0x20, 217, 0, 451 }, +{ 0xa0, 217, 0, 449 }, +{ 0x60, 217, 0, 450 }, +{ 0x10, 217, 0, 463 }, +{ 0x50, 217, 0, 461 }, +{ 0x30, 217, 0, 462 }, +{ 0x8, 217, 0, 475 }, +{ 0x28, 217, 0, 473 }, +{ 0x18, 217, 0, 474 }, +{ 0x4, 217, 0, 485 }, +{ 0x2, 217, 0, 486 }, +{ 0x1, 217, 0, 487 }, +{ 0x140, 220, 0, 427 }, +{ 0x540, 220, 0, 425 }, +{ 0x340, 220, 0, 426 }, +{ 0xc0, 220, 0, 439 }, +{ 0x2c0, 220, 0, 437 }, +{ 0x1c0, 220, 0, 438 }, +{ 0x20, 220, 0, 454 }, +{ 0xa0, 220, 0, 452 }, +{ 0x60, 220, 0, 453 }, +{ 0x10, 220, 0, 466 }, +{ 0x50, 220, 0, 464 }, +{ 0x30, 220, 0, 465 }, +{ 0x8, 220, 0, 478 }, +{ 0x28, 220, 0, 476 }, +{ 0x18, 220, 0, 477 }, +{ 0x4, 220, 0, 488 }, +{ 0x2, 220, 0, 489 }, +{ 0x1, 220, 0, 490 }, +{ 0x140, 232, 0, 430 }, +{ 0x540, 232, 0, 428 }, +{ 0x340, 232, 0, 429 }, +{ 0xc0, 232, 0, 442 }, +{ 0x2c0, 232, 0, 440 }, +{ 0x1c0, 232, 0, 441 }, +{ 0x20, 232, 0, 457 }, +{ 0xa0, 232, 0, 455 }, +{ 0x60, 232, 0, 456 }, +{ 0x10, 232, 0, 469 }, +{ 0x50, 232, 0, 467 }, +{ 0x30, 232, 0, 468 }, +{ 0x8, 232, 0, 481 }, +{ 0x28, 232, 0, 479 }, +{ 0x18, 232, 0, 480 }, +{ 0x4, 232, 0, 491 }, +{ 0x2, 232, 0, 492 }, +{ 0x1, 232, 0, 493 }, +{ 0x8, 355, 0, 495 }, +{ 0x18, 355, 0, 494 }, +{ 0x4, 355, 0, 497 }, +{ 0xc, 355, 0, 496 }, +{ 0x2, 355, 0, 504 }, +{ 0x1, 355, 0, 505 }, +{ 0x4, 353, 0, 499 }, +{ 0xc, 353, 0, 498 }, +{ 0x2, 353, 0, 506 }, +{ 0x1, 353, 0, 507 }, +{ 0x4, 351, 0, 501 }, +{ 0xc, 351, 0, 500 }, +{ 0x2, 351, 0, 508 }, +{ 0x1, 351, 0, 509 }, +{ 0x4, 349, 0, 503 }, +{ 0xc, 349, 0, 502 }, +{ 0x2, 349, 0, 510 }, +{ 0x1, 349, 0, 511 }, +{ 0xa00, 213, 0, 526 }, +{ 0x2a00, 213, 0, 524 }, +{ 0x1a00, 213, 0, 525 }, +{ 0x600, 213, 0, 538 }, +{ 0x2600, 213, 0, 514 }, +{ 0xa600, 213, 0, 512 }, +{ 0x6600, 213, 0, 513 }, +{ 0x1600, 213, 0, 536 }, +{ 0xe00, 213, 0, 537 }, +{ 0x100, 213, 0, 550 }, +{ 0x500, 213, 0, 548 }, +{ 0x300, 213, 0, 549 }, +{ 0x80, 213, 0, 553 }, +{ 0x280, 213, 0, 551 }, +{ 0x180, 213, 0, 552 }, +{ 0x40, 213, 0, 565 }, +{ 0x140, 213, 0, 563 }, +{ 0xc0, 213, 0, 564 }, +{ 0x20, 213, 0, 577 }, +{ 0xa0, 213, 0, 575 }, +{ 0x60, 213, 0, 576 }, +{ 0x10, 213, 0, 589 }, +{ 0x50, 213, 0, 587 }, +{ 0x30, 213, 0, 588 }, +{ 0x8, 213, 0, 601 }, +{ 0x28, 213, 0, 599 }, +{ 0x18, 213, 0, 600 }, +{ 0x4, 213, 0, 611 }, +{ 0x2, 213, 0, 612 }, +{ 0x1, 213, 0, 613 }, +{ 0x500, 210, 0, 529 }, +{ 0x1500, 210, 0, 527 }, +{ 0xd00, 210, 0, 528 }, +{ 0x300, 210, 0, 541 }, +{ 0x1300, 210, 0, 517 }, +{ 0x5300, 210, 0, 515 }, +{ 0x3300, 210, 0, 516 }, +{ 0xb00, 210, 0, 539 }, +{ 0x700, 210, 0, 540 }, +{ 0x80, 210, 0, 556 }, +{ 0x280, 210, 0, 554 }, +{ 0x180, 210, 0, 555 }, +{ 0x40, 210, 0, 568 }, +{ 0x140, 210, 0, 566 }, +{ 0xc0, 210, 0, 567 }, +{ 0x20, 210, 0, 580 }, +{ 0xa0, 210, 0, 578 }, +{ 0x60, 210, 0, 579 }, +{ 0x10, 210, 0, 592 }, +{ 0x50, 210, 0, 590 }, +{ 0x30, 210, 0, 591 }, +{ 0x8, 210, 0, 604 }, +{ 0x28, 210, 0, 602 }, +{ 0x18, 210, 0, 603 }, +{ 0x4, 210, 0, 614 }, +{ 0x2, 210, 0, 615 }, +{ 0x1, 210, 0, 616 }, +{ 0x500, 207, 0, 532 }, +{ 0x1500, 207, 0, 530 }, +{ 0xd00, 207, 0, 531 }, +{ 0x300, 207, 0, 544 }, +{ 0x1300, 207, 0, 520 }, +{ 0x5300, 207, 0, 518 }, +{ 0x3300, 207, 0, 519 }, +{ 0xb00, 207, 0, 542 }, +{ 0x700, 207, 0, 543 }, +{ 0x80, 207, 0, 559 }, +{ 0x280, 207, 0, 557 }, +{ 0x180, 207, 0, 558 }, +{ 0x40, 207, 0, 571 }, +{ 0x140, 207, 0, 569 }, +{ 0xc0, 207, 0, 570 }, +{ 0x20, 207, 0, 583 }, +{ 0xa0, 207, 0, 581 }, +{ 0x60, 207, 0, 582 }, +{ 0x10, 207, 0, 595 }, +{ 0x50, 207, 0, 593 }, +{ 0x30, 207, 0, 594 }, +{ 0x8, 207, 0, 607 }, +{ 0x28, 207, 0, 605 }, +{ 0x18, 207, 0, 606 }, +{ 0x4, 207, 0, 617 }, +{ 0x2, 207, 0, 618 }, +{ 0x1, 207, 0, 619 }, +{ 0x500, 204, 0, 535 }, +{ 0x1500, 204, 0, 533 }, +{ 0xd00, 204, 0, 534 }, +{ 0x300, 204, 0, 547 }, +{ 0x1300, 204, 0, 523 }, +{ 0x5300, 204, 0, 521 }, +{ 0x3300, 204, 0, 522 }, +{ 0xb00, 204, 0, 545 }, +{ 0x700, 204, 0, 546 }, +{ 0x80, 204, 0, 562 }, +{ 0x280, 204, 0, 560 }, +{ 0x180, 204, 0, 561 }, +{ 0x40, 204, 0, 574 }, +{ 0x140, 204, 0, 572 }, +{ 0xc0, 204, 0, 573 }, +{ 0x20, 204, 0, 586 }, +{ 0xa0, 204, 0, 584 }, +{ 0x60, 204, 0, 585 }, +{ 0x10, 204, 0, 598 }, +{ 0x50, 204, 0, 596 }, +{ 0x30, 204, 0, 597 }, +{ 0x8, 204, 0, 610 }, +{ 0x28, 204, 0, 608 }, +{ 0x18, 204, 0, 609 }, +{ 0x4, 204, 0, 620 }, +{ 0x2, 204, 0, 621 }, +{ 0x1, 204, 0, 622 }, +{ 0x8, 195, 0, 623 }, +{ 0x4, 195, 0, 624 }, +{ 0x2, 195, 0, 625 }, +{ 0x1, 195, 0, 626 }, +{ 0x2, 133, 0, 629 }, +{ 0xa, 133, 0, 627 }, +{ 0x6, 133, 0, 628 }, +{ 0x1, 133, 0, 635 }, +{ 0x5, 133, 0, 633 }, +{ 0x3, 133, 0, 634 }, +{ 0x2, 132, 0, 632 }, +{ 0xa, 132, 0, 630 }, +{ 0x6, 132, 0, 631 }, +{ 0x1, 132, 0, 638 }, +{ 0x5, 132, 0, 636 }, +{ 0x3, 132, 0, 637 }, +{ 0x4, 388, 0, 639 }, +{ 0x2, 388, 0, 640 }, +{ 0x1, 388, 0, 641 }, +{ 0x4, 387, 0, 642 }, +{ 0x2, 387, 0, 643 }, +{ 0x1, 387, 0, 644 }, +{ 0x4, 386, 0, 645 }, +{ 0x2, 386, 0, 646 }, +{ 0x1, 386, 0, 647 }, +{ 0x4, 385, 0, 648 }, +{ 0x2, 385, 0, 649 }, +{ 0x1, 385, 0, 650 }, +{ 0x2, 95, 0, 653 }, +{ 0xa, 95, 0, 651 }, +{ 0x6, 95, 0, 652 }, +{ 0x1, 95, 0, 665 }, +{ 0x5, 95, 0, 663 }, +{ 0x3, 95, 0, 664 }, +{ 0x2, 94, 0, 656 }, +{ 0xa, 94, 0, 654 }, +{ 0x6, 94, 0, 655 }, +{ 0x1, 94, 0, 668 }, +{ 0x5, 94, 0, 666 }, +{ 0x3, 94, 0, 667 }, +{ 0x2, 93, 0, 659 }, +{ 0xa, 93, 0, 657 }, +{ 0x6, 93, 0, 658 }, +{ 0x1, 93, 0, 671 }, +{ 0x5, 93, 0, 669 }, +{ 0x3, 93, 0, 670 }, +{ 0x2, 92, 0, 662 }, +{ 0xa, 92, 0, 660 }, +{ 0x6, 92, 0, 661 }, +{ 0x1, 92, 0, 674 }, +{ 0x5, 92, 0, 672 }, +{ 0x3, 92, 0, 673 }, +{ 0x8, 354, 0, 676 }, +{ 0x18, 354, 0, 675 }, +{ 0x4, 354, 0, 678 }, +{ 0xc, 354, 0, 677 }, +{ 0x2, 354, 0, 685 }, +{ 0x1, 354, 0, 686 }, +{ 0x4, 352, 0, 680 }, +{ 0xc, 352, 0, 679 }, +{ 0x2, 352, 0, 687 }, +{ 0x1, 352, 0, 688 }, +{ 0x4, 350, 0, 682 }, +{ 0xc, 350, 0, 681 }, +{ 0x2, 350, 0, 689 }, +{ 0x1, 350, 0, 690 }, +{ 0x4, 348, 0, 684 }, +{ 0xc, 348, 0, 683 }, +{ 0x2, 348, 0, 691 }, +{ 0x1, 348, 0, 692 }, +{ 0xa00, 212, 0, 707 }, +{ 0x2a00, 212, 0, 705 }, +{ 0x1a00, 212, 0, 706 }, +{ 0x600, 212, 0, 719 }, +{ 0x2600, 212, 0, 695 }, +{ 0xa600, 212, 0, 693 }, +{ 0x6600, 212, 0, 694 }, +{ 0x1600, 212, 0, 717 }, +{ 0xe00, 212, 0, 718 }, +{ 0x100, 212, 0, 731 }, +{ 0x500, 212, 0, 729 }, +{ 0x300, 212, 0, 730 }, +{ 0x80, 212, 0, 734 }, +{ 0x280, 212, 0, 732 }, +{ 0x180, 212, 0, 733 }, +{ 0x40, 212, 0, 746 }, +{ 0x140, 212, 0, 744 }, +{ 0xc0, 212, 0, 745 }, +{ 0x20, 212, 0, 758 }, +{ 0xa0, 212, 0, 756 }, +{ 0x60, 212, 0, 757 }, +{ 0x10, 212, 0, 770 }, +{ 0x50, 212, 0, 768 }, +{ 0x30, 212, 0, 769 }, +{ 0x8, 212, 0, 782 }, +{ 0x28, 212, 0, 780 }, +{ 0x18, 212, 0, 781 }, +{ 0x4, 212, 0, 792 }, +{ 0x2, 212, 0, 793 }, +{ 0x1, 212, 0, 794 }, +{ 0x500, 209, 0, 710 }, +{ 0x1500, 209, 0, 708 }, +{ 0xd00, 209, 0, 709 }, +{ 0x300, 209, 0, 722 }, +{ 0x1300, 209, 0, 698 }, +{ 0x5300, 209, 0, 696 }, +{ 0x3300, 209, 0, 697 }, +{ 0xb00, 209, 0, 720 }, +{ 0x700, 209, 0, 721 }, +{ 0x80, 209, 0, 737 }, +{ 0x280, 209, 0, 735 }, +{ 0x180, 209, 0, 736 }, +{ 0x40, 209, 0, 749 }, +{ 0x140, 209, 0, 747 }, +{ 0xc0, 209, 0, 748 }, +{ 0x20, 209, 0, 761 }, +{ 0xa0, 209, 0, 759 }, +{ 0x60, 209, 0, 760 }, +{ 0x10, 209, 0, 773 }, +{ 0x50, 209, 0, 771 }, +{ 0x30, 209, 0, 772 }, +{ 0x8, 209, 0, 785 }, +{ 0x28, 209, 0, 783 }, +{ 0x18, 209, 0, 784 }, +{ 0x4, 209, 0, 795 }, +{ 0x2, 209, 0, 796 }, +{ 0x1, 209, 0, 797 }, +{ 0x500, 206, 0, 713 }, +{ 0x1500, 206, 0, 711 }, +{ 0xd00, 206, 0, 712 }, +{ 0x300, 206, 0, 725 }, +{ 0x1300, 206, 0, 701 }, +{ 0x5300, 206, 0, 699 }, +{ 0x3300, 206, 0, 700 }, +{ 0xb00, 206, 0, 723 }, +{ 0x700, 206, 0, 724 }, +{ 0x80, 206, 0, 740 }, +{ 0x280, 206, 0, 738 }, +{ 0x180, 206, 0, 739 }, +{ 0x40, 206, 0, 752 }, +{ 0x140, 206, 0, 750 }, +{ 0xc0, 206, 0, 751 }, +{ 0x20, 206, 0, 764 }, +{ 0xa0, 206, 0, 762 }, +{ 0x60, 206, 0, 763 }, +{ 0x10, 206, 0, 776 }, +{ 0x50, 206, 0, 774 }, +{ 0x30, 206, 0, 775 }, +{ 0x8, 206, 0, 788 }, +{ 0x28, 206, 0, 786 }, +{ 0x18, 206, 0, 787 }, +{ 0x4, 206, 0, 798 }, +{ 0x2, 206, 0, 799 }, +{ 0x1, 206, 0, 800 }, +{ 0x500, 203, 0, 716 }, +{ 0x1500, 203, 0, 714 }, +{ 0xd00, 203, 0, 715 }, +{ 0x300, 203, 0, 728 }, +{ 0x1300, 203, 0, 704 }, +{ 0x5300, 203, 0, 702 }, +{ 0x3300, 203, 0, 703 }, +{ 0xb00, 203, 0, 726 }, +{ 0x700, 203, 0, 727 }, +{ 0x80, 203, 0, 743 }, +{ 0x280, 203, 0, 741 }, +{ 0x180, 203, 0, 742 }, +{ 0x40, 203, 0, 755 }, +{ 0x140, 203, 0, 753 }, +{ 0xc0, 203, 0, 754 }, +{ 0x20, 203, 0, 767 }, +{ 0xa0, 203, 0, 765 }, +{ 0x60, 203, 0, 766 }, +{ 0x10, 203, 0, 779 }, +{ 0x50, 203, 0, 777 }, +{ 0x30, 203, 0, 778 }, +{ 0x8, 203, 0, 791 }, +{ 0x28, 203, 0, 789 }, +{ 0x18, 203, 0, 790 }, +{ 0x4, 203, 0, 801 }, +{ 0x2, 203, 0, 802 }, +{ 0x1, 203, 0, 803 }, +{ 0xa00, 211, 0, 818 }, +{ 0x2a00, 211, 0, 816 }, +{ 0x1a00, 211, 0, 817 }, +{ 0x600, 211, 0, 830 }, +{ 0x2600, 211, 0, 806 }, +{ 0xa600, 211, 0, 804 }, +{ 0x6600, 211, 0, 805 }, +{ 0x1600, 211, 0, 828 }, +{ 0xe00, 211, 0, 829 }, +{ 0x100, 211, 0, 842 }, +{ 0x500, 211, 0, 840 }, +{ 0x300, 211, 0, 841 }, +{ 0x80, 211, 0, 845 }, +{ 0x280, 211, 0, 843 }, +{ 0x180, 211, 0, 844 }, +{ 0x40, 211, 0, 857 }, +{ 0x140, 211, 0, 855 }, +{ 0xc0, 211, 0, 856 }, +{ 0x20, 211, 0, 869 }, +{ 0xa0, 211, 0, 867 }, +{ 0x60, 211, 0, 868 }, +{ 0x10, 211, 0, 881 }, +{ 0x50, 211, 0, 879 }, +{ 0x30, 211, 0, 880 }, +{ 0x8, 211, 0, 893 }, +{ 0x28, 211, 0, 891 }, +{ 0x18, 211, 0, 892 }, +{ 0x4, 211, 0, 903 }, +{ 0x2, 211, 0, 904 }, +{ 0x1, 211, 0, 905 }, +{ 0x500, 208, 0, 821 }, +{ 0x1500, 208, 0, 819 }, +{ 0xd00, 208, 0, 820 }, +{ 0x300, 208, 0, 833 }, +{ 0x1300, 208, 0, 809 }, +{ 0x5300, 208, 0, 807 }, +{ 0x3300, 208, 0, 808 }, +{ 0xb00, 208, 0, 831 }, +{ 0x700, 208, 0, 832 }, +{ 0x80, 208, 0, 848 }, +{ 0x280, 208, 0, 846 }, +{ 0x180, 208, 0, 847 }, +{ 0x40, 208, 0, 860 }, +{ 0x140, 208, 0, 858 }, +{ 0xc0, 208, 0, 859 }, +{ 0x20, 208, 0, 872 }, +{ 0xa0, 208, 0, 870 }, +{ 0x60, 208, 0, 871 }, +{ 0x10, 208, 0, 884 }, +{ 0x50, 208, 0, 882 }, +{ 0x30, 208, 0, 883 }, +{ 0x8, 208, 0, 896 }, +{ 0x28, 208, 0, 894 }, +{ 0x18, 208, 0, 895 }, +{ 0x4, 208, 0, 906 }, +{ 0x2, 208, 0, 907 }, +{ 0x1, 208, 0, 908 }, +{ 0x500, 205, 0, 824 }, +{ 0x1500, 205, 0, 822 }, +{ 0xd00, 205, 0, 823 }, +{ 0x300, 205, 0, 836 }, +{ 0x1300, 205, 0, 812 }, +{ 0x5300, 205, 0, 810 }, +{ 0x3300, 205, 0, 811 }, +{ 0xb00, 205, 0, 834 }, +{ 0x700, 205, 0, 835 }, +{ 0x80, 205, 0, 851 }, +{ 0x280, 205, 0, 849 }, +{ 0x180, 205, 0, 850 }, +{ 0x40, 205, 0, 863 }, +{ 0x140, 205, 0, 861 }, +{ 0xc0, 205, 0, 862 }, +{ 0x20, 205, 0, 875 }, +{ 0xa0, 205, 0, 873 }, +{ 0x60, 205, 0, 874 }, +{ 0x10, 205, 0, 887 }, +{ 0x50, 205, 0, 885 }, +{ 0x30, 205, 0, 886 }, +{ 0x8, 205, 0, 899 }, +{ 0x28, 205, 0, 897 }, +{ 0x18, 205, 0, 898 }, +{ 0x4, 205, 0, 909 }, +{ 0x2, 205, 0, 910 }, +{ 0x1, 205, 0, 911 }, +{ 0x500, 202, 0, 827 }, +{ 0x1500, 202, 0, 825 }, +{ 0xd00, 202, 0, 826 }, +{ 0x300, 202, 0, 839 }, +{ 0x1300, 202, 0, 815 }, +{ 0x5300, 202, 0, 813 }, +{ 0x3300, 202, 0, 814 }, +{ 0xb00, 202, 0, 837 }, +{ 0x700, 202, 0, 838 }, +{ 0x80, 202, 0, 854 }, +{ 0x280, 202, 0, 852 }, +{ 0x180, 202, 0, 853 }, +{ 0x40, 202, 0, 866 }, +{ 0x140, 202, 0, 864 }, +{ 0xc0, 202, 0, 865 }, +{ 0x20, 202, 0, 878 }, +{ 0xa0, 202, 0, 876 }, +{ 0x60, 202, 0, 877 }, +{ 0x10, 202, 0, 890 }, +{ 0x50, 202, 0, 888 }, +{ 0x30, 202, 0, 889 }, +{ 0x8, 202, 0, 902 }, +{ 0x28, 202, 0, 900 }, +{ 0x18, 202, 0, 901 }, +{ 0x4, 202, 0, 912 }, +{ 0x2, 202, 0, 913 }, +{ 0x1, 202, 0, 914 }, +{ 0x1, 49, 0, 917 }, +{ 0x3, 48, 0, 918 }, +{ 0x1, 374, 0, 919 }, +{ 0x1, 380, 0, 920 }, +{ 0x2, 334, 0, 923 }, +{ 0x1, 334, 0, 924 }, +{ 0x2, 332, 0, 925 }, +{ 0x1, 332, 0, 926 }, +{ 0x1, 331, 0, 927 }, +{ 0x1, 276, 0, 932 }, +{ 0x1, 275, 0, 933 }, +{ 0x1, 274, 0, 934 }, +{ 0x1, 273, 0, 935 }, +{ 0x1, 201, 0, 936 }, +{ 0x1, 200, 0, 937 }, +{ 0x1, 272, 0, 938 }, +{ 0x1, 271, 0, 939 }, +{ 0x1, 270, 0, 940 }, +{ 0x1, 269, 0, 941 }, +{ 0x1, 268, 0, 942 }, +{ 0x1, 267, 0, 943 }, +{ 0x1, 266, 0, 944 }, +{ 0x2, 199, 0, 945 }, +{ 0x1, 199, 0, 946 }, +{ 0x2, 314, 0, 952 }, +{ 0x1, 314, 0, 953 }, +{ 0x1, 265, 0, 954 }, +{ 0x1, 264, 0, 955 }, +{ 0x1, 263, 0, 956 }, +{ 0x1, 262, 0, 957 }, +{ 0x1, 8, 0, 958 }, +{ 0x1, 261, 0, 959 }, +{ 0x1, 260, 0, 960 }, +{ 0x1, 259, 0, 961 }, +{ 0x1, 258, 0, 962 }, +{ 0x1, 336, 0, 963 }, +{ 0x1, 347, 0, 964 }, +{ 0x1, 337, 0, 965 }, +{ 0x1, 369, 0, 966 }, +{ 0x1, 257, 0, 969 }, +{ 0x1, 198, 0, 970 }, +{ 0x1, 134, 0, 973 }, +{ 0x2, 239, 0, 977 }, +{ 0x1, 239, 0, 978 }, +{ 0x1, 193, 0, 979 }, +{ 0x5, 47, 0, 981 }, +{ 0x3, 47, 0, 982 }, +{ 0x5, 46, 0, 983 }, +{ 0x3, 46, 0, 984 }, +{ 0x1, 313, 0, 985 }, +{ 0x1, 321, 0, 986 }, +{ 0x1, 319, 0, 987 }, +{ 0x1, 340, 0, 988 }, +{ 0x1, 320, 0, 989 }, +{ 0x1, 318, 0, 990 }, +{ 0x2, 326, 0, 991 }, +{ 0x1, 326, 0, 993 }, +{ 0x2, 324, 0, 992 }, +{ 0x1, 324, 0, 994 }, +{ 0x2, 344, 0, 995 }, +{ 0x1, 344, 0, 998 }, +{ 0x2, 325, 0, 996 }, +{ 0x1, 325, 0, 999 }, +{ 0x2, 323, 0, 997 }, +{ 0x1, 323, 0, 1000 }, +{ 0x1, 286, 0, 1001 }, +{ 0x1, 285, 0, 1002 }, +{ 0x1, 317, 0, 1003 }, +{ 0x1, 308, 0, 1004 }, +{ 0x1, 310, 0, 1005 }, +{ 0x1, 307, 0, 1006 }, +{ 0x1, 309, 0, 1007 }, +{ 0x2, 384, 0, 1008 }, +{ 0x1, 384, 0, 1011 }, +{ 0x2, 383, 0, 1009 }, +{ 0x1, 383, 0, 1012 }, +{ 0x2, 382, 0, 1010 }, +{ 0x1, 382, 0, 1013 }, +{ 0x1, 296, 0, 1014 }, +{ 0x2, 295, 0, 1015 }, +{ 0x1, 295, 0, 1016 }, +{ 0x2, 242, 0, 1017 }, +{ 0x1, 242, 0, 1020 }, +{ 0x2, 241, 0, 1018 }, +{ 0x1, 241, 0, 1021 }, +{ 0x2, 240, 0, 1019 }, +{ 0x1, 240, 0, 1022 }, +{ 0x2, 311, 0, 1023 }, +{ 0x1, 311, 0, 1024 }, +{ 0x2, 312, 0, 1025 }, +{ 0x1, 312, 0, 1026 }, +{ 0xa, 378, 1, 1032 }, +{ 0xa, 379, 0, 1031 }, +{ 0x1a, 378, 1, 1028 }, +{ 0x32, 379, 0, 1027 }, +{ 0x6, 378, 1, 1036 }, +{ 0x6, 379, 0, 1035 }, +{ 0x1, 378, 1, 1042 }, +{ 0x1, 379, 0, 1041 }, +{ 0x9, 378, 1, 1034 }, +{ 0x9, 379, 0, 1033 }, +{ 0x19, 378, 1, 1030 }, +{ 0x31, 379, 0, 1029 }, +{ 0x5, 378, 1, 1038 }, +{ 0x5, 379, 0, 1037 }, +{ 0x3, 378, 1, 1040 }, +{ 0x3, 379, 0, 1039 }, +{ 0xa, 375, 1, 1048 }, +{ 0xa, 376, 0, 1047 }, +{ 0x1a, 375, 1, 1044 }, +{ 0x32, 376, 0, 1043 }, +{ 0x6, 375, 1, 1052 }, +{ 0x6, 376, 0, 1051 }, +{ 0x1, 375, 1, 1058 }, +{ 0x1, 376, 0, 1057 }, +{ 0x9, 375, 1, 1050 }, +{ 0x9, 376, 0, 1049 }, +{ 0x19, 375, 1, 1046 }, +{ 0x31, 376, 0, 1045 }, +{ 0x5, 375, 1, 1054 }, +{ 0x5, 376, 0, 1053 }, +{ 0x3, 375, 1, 1056 }, +{ 0x3, 376, 0, 1055 }, +{ 0x1, 102, 0, 1059 }, +{ 0x1, 101, 0, 1060 }, +{ 0x1, 339, 1, 1062 }, +{ 0x1, 100, 0, 1061 }, +{ 0x2, 343, 1, 1064 }, +{ 0x2, 104, 0, 1063 }, +{ 0x1, 343, 1, 1066 }, +{ 0x1, 104, 0, 1065 }, +{ 0x1, 345, 0, 1067 }, +{ 0x1, 99, 0, 1068 }, +{ 0x2, 98, 0, 1069 }, +{ 0x2, 97, 0, 1070 }, +{ 0x1, 396, 1, 1076 }, +{ 0x1, 197, 0, 971 }, +{ 0x1, 395, 0, 1077 }, +{ 0x1, 394, 1, 1078 }, +{ 0x1, 196, 0, 980 }, +{ 0x1, 256, 0, 1079 }, +{ 0x1, 255, 1, 1080 }, +{ 0x1, 238, 0, 972 }, +{ 0x1, 254, 0, 1081 }, +{ 0x1, 253, 1, 1082 }, +{ 0x1, 373, 0, 974 }, +{ 0x1, 252, 1, 1083 }, +{ 0x1, 346, 0, 976 }, +{ 0x1, 251, 0, 1084 }, +{ 0x1, 250, 0, 1085 }, +{ 0x1, 249, 1, 1086 }, +{ 0x2, 346, 0, 975 }, +{ 0x10, 248, 0, 1090 }, +{ 0x90, 248, 0, 1088 }, +{ 0x190, 248, 0, 1087 }, +{ 0x50, 248, 0, 1089 }, +{ 0x30, 248, 0, 1092 }, +{ 0x70, 248, 0, 1091 }, +{ 0x8, 248, 0, 1094 }, +{ 0x18, 248, 0, 1093 }, +{ 0x4, 248, 0, 1095 }, +{ 0x1, 248, 0, 1098 }, +{ 0x3, 248, 0, 1097 }, +{ 0x1, 247, 1, 1099 }, +{ 0x2, 248, 0, 1096 }, +{ 0x3, 45, 0, 1100 }, +{ 0x1, 289, 1, 1101 }, +{ 0x1, 290, 1, 967 }, +{ 0x1, 291, 0, 87 }, +{ 0x1, 33, 1, 1102 }, +{ 0x1, 34, 1, 968 }, +{ 0x1, 35, 0, 88 }, +{ 0x1, 187, 0, 1103 }, +{ 0x4, 389, 0, 1104 }, +{ 0x2, 389, 0, 1105 }, +{ 0x1, 389, 1, 1107 }, +{ 0x1, 390, 0, 1106 }, +{ 0x8, 391, 0, 1108 }, +{ 0x4, 391, 0, 1109 }, +{ 0x1, 391, 1, 1111 }, +{ 0x2, 391, 0, 1110 }, +{ 0x8, 176, 0, 1112 }, +{ 0x4, 176, 0, 1113 }, +{ 0x2, 176, 0, 1114 }, +{ 0x1, 176, 1, 1116 }, +{ 0x1, 177, 0, 1115 }, +{ 0x10, 178, 0, 1117 }, +{ 0x8, 178, 0, 1118 }, +{ 0x4, 178, 0, 1119 }, +{ 0x1, 178, 1, 1121 }, +{ 0x2, 178, 0, 1120 }, +{ 0x220, 148, 0, 1122 }, +{ 0x120, 148, 0, 1123 }, +{ 0xa0, 148, 0, 1124 }, +{ 0x60, 148, 1, 1126 }, +{ 0x4, 149, 0, 1125 }, +{ 0x110, 148, 0, 1132 }, +{ 0x90, 148, 0, 1133 }, +{ 0x50, 148, 0, 1134 }, +{ 0x30, 148, 1, 1136 }, +{ 0x2, 149, 0, 1135 }, +{ 0x8, 148, 0, 1137 }, +{ 0x4, 148, 0, 1138 }, +{ 0x2, 148, 0, 1139 }, +{ 0x1, 148, 1, 1141 }, +{ 0x1, 149, 0, 1140 }, +{ 0x440, 150, 0, 1127 }, +{ 0x240, 150, 0, 1128 }, +{ 0x140, 150, 0, 1129 }, +{ 0xc0, 150, 1, 1131 }, +{ 0x40, 150, 0, 1130 }, +{ 0x220, 150, 0, 1142 }, +{ 0x120, 150, 0, 1143 }, +{ 0xa0, 150, 0, 1144 }, +{ 0x60, 150, 1, 1146 }, +{ 0x20, 150, 0, 1145 }, +{ 0x10, 150, 0, 1147 }, +{ 0x8, 150, 0, 1148 }, +{ 0x4, 150, 0, 1149 }, +{ 0x1, 150, 1, 1151 }, +{ 0x2, 150, 0, 1150 }, +{ 0x8, 172, 0, 1152 }, +{ 0x4, 172, 0, 1153 }, +{ 0x2, 172, 0, 1154 }, +{ 0x1, 172, 1, 1156 }, +{ 0x1, 173, 0, 1155 }, +{ 0x220, 144, 0, 1157 }, +{ 0x120, 144, 0, 1158 }, +{ 0xa0, 144, 0, 1159 }, +{ 0x60, 144, 1, 1161 }, +{ 0x4, 145, 0, 1160 }, +{ 0x110, 144, 0, 1167 }, +{ 0x90, 144, 0, 1168 }, +{ 0x50, 144, 0, 1169 }, +{ 0x30, 144, 1, 1171 }, +{ 0x2, 145, 0, 1170 }, +{ 0x8, 144, 0, 1172 }, +{ 0x4, 144, 0, 1173 }, +{ 0x2, 144, 0, 1174 }, +{ 0x1, 144, 1, 1176 }, +{ 0x1, 145, 0, 1175 }, +{ 0x440, 190, 0, 1162 }, +{ 0x240, 190, 0, 1163 }, +{ 0x140, 190, 0, 1164 }, +{ 0xc0, 190, 1, 1166 }, +{ 0x40, 190, 0, 1165 }, +{ 0x220, 190, 0, 1177 }, +{ 0x120, 190, 0, 1178 }, +{ 0xa0, 190, 0, 1179 }, +{ 0x60, 190, 1, 1181 }, +{ 0x20, 190, 0, 1180 }, +{ 0x10, 190, 0, 1182 }, +{ 0x8, 190, 0, 1183 }, +{ 0x4, 190, 0, 1184 }, +{ 0x1, 190, 1, 1186 }, +{ 0x2, 190, 0, 1185 }, +{ 0x8, 164, 0, 1187 }, +{ 0x4, 164, 0, 1188 }, +{ 0x2, 164, 0, 1189 }, +{ 0x1, 164, 1, 1191 }, +{ 0x1, 165, 0, 1190 }, +{ 0x10, 171, 0, 1192 }, +{ 0x8, 171, 0, 1193 }, +{ 0x4, 171, 0, 1194 }, +{ 0x1, 171, 1, 1196 }, +{ 0x2, 171, 0, 1195 }, +{ 0x220, 135, 0, 1197 }, +{ 0x120, 135, 0, 1198 }, +{ 0xa0, 135, 0, 1199 }, +{ 0x60, 135, 1, 1201 }, +{ 0x4, 136, 0, 1200 }, +{ 0x110, 135, 0, 1222 }, +{ 0x90, 135, 0, 1223 }, +{ 0x50, 135, 0, 1224 }, +{ 0x30, 135, 1, 1226 }, +{ 0x2, 136, 0, 1225 }, +{ 0x8, 135, 0, 1227 }, +{ 0x4, 135, 0, 1228 }, +{ 0x2, 135, 0, 1229 }, +{ 0x1, 135, 1, 1231 }, +{ 0x1, 136, 0, 1230 }, +{ 0x440, 143, 0, 1202 }, +{ 0x240, 143, 0, 1203 }, +{ 0x140, 143, 0, 1204 }, +{ 0xc0, 143, 1, 1206 }, +{ 0x40, 143, 0, 1205 }, +{ 0x220, 143, 0, 1232 }, +{ 0x120, 143, 0, 1233 }, +{ 0xa0, 143, 0, 1234 }, +{ 0x60, 143, 1, 1236 }, +{ 0x20, 143, 0, 1235 }, +{ 0x10, 143, 0, 1237 }, +{ 0x8, 143, 0, 1238 }, +{ 0x4, 143, 0, 1239 }, +{ 0x1, 143, 1, 1241 }, +{ 0x2, 143, 0, 1240 }, +{ 0x440, 106, 0, 1207 }, +{ 0x240, 106, 0, 1208 }, +{ 0x140, 106, 0, 1209 }, +{ 0xc0, 106, 1, 1211 }, +{ 0x40, 106, 0, 1210 }, +{ 0x220, 106, 0, 1242 }, +{ 0x120, 106, 0, 1243 }, +{ 0xa0, 106, 0, 1244 }, +{ 0x60, 106, 1, 1246 }, +{ 0x20, 106, 0, 1245 }, +{ 0x10, 106, 0, 1247 }, +{ 0x8, 106, 0, 1248 }, +{ 0x1, 106, 1, 1251 }, +{ 0x2, 106, 0, 1250 }, +{ 0x440, 151, 1, 1217 }, +{ 0x441, 131, 0, 1212 }, +{ 0x240, 151, 1, 1218 }, +{ 0x241, 131, 0, 1213 }, +{ 0x140, 151, 1, 1219 }, +{ 0x141, 131, 0, 1214 }, +{ 0xc0, 151, 1, 1221 }, +{ 0x40, 151, 1, 1220 }, +{ 0xc1, 131, 1, 1216 }, +{ 0x41, 131, 0, 1215 }, +{ 0x220, 151, 1, 1262 }, +{ 0x221, 131, 0, 1252 }, +{ 0x120, 151, 1, 1263 }, +{ 0x121, 131, 0, 1253 }, +{ 0xa0, 151, 1, 1264 }, +{ 0xa1, 131, 0, 1254 }, +{ 0x60, 151, 1, 1266 }, +{ 0x20, 151, 1, 1265 }, +{ 0x61, 131, 1, 1256 }, +{ 0x21, 131, 0, 1255 }, +{ 0x10, 151, 1, 1267 }, +{ 0x11, 131, 0, 1257 }, +{ 0x8, 151, 1, 1268 }, +{ 0x9, 131, 0, 1258 }, +{ 0x4, 151, 1, 1269 }, +{ 0x5, 131, 0, 1259 }, +{ 0x1, 151, 1, 1271 }, +{ 0x2, 151, 1, 1270 }, +{ 0x3, 131, 1, 1261 }, +{ 0x1, 131, 0, 1260 }, +{ 0x1, 116, 1, 1275 }, +{ 0x1, 117, 0, 1274 }, +{ 0x3, 116, 1, 1273 }, +{ 0x3, 117, 0, 1272 }, +{ 0x1108, 120, 1, 1356 }, +{ 0x1108, 124, 0, 1276 }, +{ 0x908, 120, 1, 1357 }, +{ 0x908, 124, 0, 1277 }, +{ 0x508, 120, 1, 1358 }, +{ 0x508, 124, 0, 1278 }, +{ 0x308, 120, 1, 1360 }, +{ 0x18, 121, 1, 1359 }, +{ 0x308, 124, 1, 1280 }, +{ 0x18, 125, 0, 1279 }, +{ 0x88, 120, 1, 1376 }, +{ 0x88, 124, 0, 1316 }, +{ 0x48, 120, 1, 1377 }, +{ 0x48, 124, 0, 1317 }, +{ 0x28, 120, 1, 1378 }, +{ 0x28, 124, 0, 1318 }, +{ 0x18, 120, 1, 1380 }, +{ 0x8, 121, 1, 1379 }, +{ 0x18, 124, 1, 1320 }, +{ 0x8, 125, 0, 1319 }, +{ 0x884, 120, 1, 1361 }, +{ 0x442, 122, 1, 1306 }, +{ 0x884, 124, 1, 1291 }, +{ 0x442, 126, 0, 1281 }, +{ 0x484, 120, 1, 1362 }, +{ 0x242, 122, 1, 1307 }, +{ 0x484, 124, 1, 1292 }, +{ 0x242, 126, 0, 1282 }, +{ 0x284, 120, 1, 1363 }, +{ 0x142, 122, 1, 1308 }, +{ 0x284, 124, 1, 1293 }, +{ 0x142, 126, 0, 1283 }, +{ 0x184, 120, 1, 1365 }, +{ 0xc, 121, 1, 1364 }, +{ 0xc2, 122, 1, 1310 }, +{ 0x6, 123, 1, 1309 }, +{ 0x184, 124, 1, 1295 }, +{ 0xc, 125, 1, 1294 }, +{ 0xc2, 126, 1, 1285 }, +{ 0x6, 127, 0, 1284 }, +{ 0x44, 120, 1, 1381 }, +{ 0x22, 122, 1, 1346 }, +{ 0x44, 124, 1, 1331 }, +{ 0x22, 126, 0, 1321 }, +{ 0x24, 120, 1, 1382 }, +{ 0x12, 122, 1, 1347 }, +{ 0x24, 124, 1, 1332 }, +{ 0x12, 126, 0, 1322 }, +{ 0x14, 120, 1, 1383 }, +{ 0xa, 122, 1, 1348 }, +{ 0x14, 124, 1, 1333 }, +{ 0xa, 126, 0, 1323 }, +{ 0xc, 120, 1, 1385 }, +{ 0x4, 121, 1, 1384 }, +{ 0x6, 122, 1, 1350 }, +{ 0x2, 123, 1, 1349 }, +{ 0xc, 124, 1, 1335 }, +{ 0x4, 125, 1, 1334 }, +{ 0x6, 126, 1, 1325 }, +{ 0x2, 127, 0, 1324 }, +{ 0x442, 120, 1, 1366 }, +{ 0x221, 122, 1, 1311 }, +{ 0x442, 124, 1, 1296 }, +{ 0x221, 126, 0, 1286 }, +{ 0x242, 120, 1, 1367 }, +{ 0x121, 122, 1, 1312 }, +{ 0x242, 124, 1, 1297 }, +{ 0x121, 126, 0, 1287 }, +{ 0x142, 120, 1, 1368 }, +{ 0xa1, 122, 1, 1313 }, +{ 0x142, 124, 1, 1298 }, +{ 0xa1, 126, 0, 1288 }, +{ 0xc2, 120, 1, 1370 }, +{ 0x6, 121, 1, 1369 }, +{ 0x61, 122, 1, 1315 }, +{ 0x3, 123, 1, 1314 }, +{ 0xc2, 124, 1, 1300 }, +{ 0x6, 125, 1, 1299 }, +{ 0x61, 126, 1, 1290 }, +{ 0x3, 127, 0, 1289 }, +{ 0x22, 120, 1, 1386 }, +{ 0x11, 122, 1, 1351 }, +{ 0x22, 124, 1, 1336 }, +{ 0x11, 126, 0, 1326 }, +{ 0x12, 120, 1, 1387 }, +{ 0x9, 122, 1, 1352 }, +{ 0x12, 124, 1, 1337 }, +{ 0x9, 126, 0, 1327 }, +{ 0xa, 120, 1, 1388 }, +{ 0x5, 122, 1, 1353 }, +{ 0xa, 124, 1, 1338 }, +{ 0x5, 126, 0, 1328 }, +{ 0x6, 120, 1, 1390 }, +{ 0x2, 121, 1, 1389 }, +{ 0x3, 122, 1, 1355 }, +{ 0x1, 123, 1, 1354 }, +{ 0x6, 124, 1, 1340 }, +{ 0x2, 125, 1, 1339 }, +{ 0x3, 126, 1, 1330 }, +{ 0x1, 127, 0, 1329 }, +{ 0x221, 120, 1, 1371 }, +{ 0x221, 124, 0, 1301 }, +{ 0x121, 120, 1, 1372 }, +{ 0x121, 124, 0, 1302 }, +{ 0xa1, 120, 1, 1373 }, +{ 0xa1, 124, 0, 1303 }, +{ 0x61, 120, 1, 1375 }, +{ 0x3, 121, 1, 1374 }, +{ 0x61, 124, 1, 1305 }, +{ 0x3, 125, 0, 1304 }, +{ 0x11, 120, 1, 1391 }, +{ 0x11, 124, 0, 1341 }, +{ 0x9, 120, 1, 1392 }, +{ 0x9, 124, 0, 1342 }, +{ 0x5, 120, 1, 1393 }, +{ 0x5, 124, 0, 1343 }, +{ 0x3, 120, 1, 1395 }, +{ 0x1, 121, 1, 1394 }, +{ 0x3, 124, 1, 1345 }, +{ 0x1, 125, 0, 1344 }, +{ 0x442, 162, 0, 1396 }, +{ 0x242, 162, 0, 1397 }, +{ 0x142, 162, 0, 1398 }, +{ 0xc2, 162, 1, 1400 }, +{ 0x6, 163, 1, 1399 }, +{ 0x1, 381, 0, 921 }, +{ 0x22, 162, 0, 1406 }, +{ 0x12, 162, 0, 1407 }, +{ 0xa, 162, 0, 1408 }, +{ 0x6, 162, 1, 1410 }, +{ 0x2, 163, 1, 1409 }, +{ 0x2, 315, 0, 950 }, +{ 0x221, 162, 0, 1401 }, +{ 0x121, 162, 0, 1402 }, +{ 0xa1, 162, 0, 1403 }, +{ 0x61, 162, 1, 1405 }, +{ 0x3, 163, 1, 1404 }, +{ 0x1, 377, 0, 922 }, +{ 0x11, 162, 0, 1411 }, +{ 0x9, 162, 0, 1412 }, +{ 0x5, 162, 0, 1413 }, +{ 0x3, 162, 1, 1415 }, +{ 0x1, 163, 1, 1414 }, +{ 0x1, 315, 0, 951 }, +{ 0x4, 168, 0, 1416 }, +{ 0x1, 168, 0, 1418 }, +{ 0x1, 175, 0, 1419 }, +{ 0x1, 174, 1, 1420 }, +{ 0x2, 168, 0, 1417 }, +{ 0x1, 153, 0, 1421 }, +{ 0x880, 159, 0, 1422 }, +{ 0x480, 159, 0, 1423 }, +{ 0x280, 159, 0, 1424 }, +{ 0x180, 159, 1, 1426 }, +{ 0x80, 160, 0, 1425 }, +{ 0x440, 159, 1, 1437 }, +{ 0x88, 161, 0, 1427 }, +{ 0x240, 159, 1, 1438 }, +{ 0x48, 161, 0, 1428 }, +{ 0x140, 159, 1, 1439 }, +{ 0x28, 161, 0, 1429 }, +{ 0xc0, 159, 1, 1441 }, +{ 0x40, 160, 1, 1440 }, +{ 0x18, 161, 1, 1431 }, +{ 0x8, 161, 0, 1430 }, +{ 0x220, 159, 1, 1442 }, +{ 0x44, 161, 0, 1432 }, +{ 0x120, 159, 1, 1443 }, +{ 0x24, 161, 0, 1433 }, +{ 0xa0, 159, 1, 1444 }, +{ 0x14, 161, 0, 1434 }, +{ 0x60, 159, 1, 1446 }, +{ 0x20, 160, 1, 1445 }, +{ 0xc, 161, 1, 1436 }, +{ 0x4, 161, 0, 1435 }, +{ 0x110, 159, 0, 1447 }, +{ 0x90, 159, 0, 1448 }, +{ 0x50, 159, 0, 1449 }, +{ 0x30, 159, 1, 1451 }, +{ 0x10, 160, 1, 1450 }, +{ 0x1, 333, 0, 915 }, +{ 0x88, 159, 0, 1452 }, +{ 0x48, 159, 0, 1453 }, +{ 0x28, 159, 0, 1454 }, +{ 0x18, 159, 1, 1456 }, +{ 0x8, 160, 1, 1455 }, +{ 0xc, 316, 0, 947 }, +{ 0x44, 159, 1, 1467 }, +{ 0x22, 161, 0, 1457 }, +{ 0x24, 159, 1, 1468 }, +{ 0x12, 161, 0, 1458 }, +{ 0x14, 159, 1, 1469 }, +{ 0xa, 161, 0, 1459 }, +{ 0xc, 159, 1, 1471 }, +{ 0x4, 160, 1, 1470 }, +{ 0x6, 161, 1, 1461 }, +{ 0x2, 161, 1, 1460 }, +{ 0x6, 316, 0, 948 }, +{ 0x22, 159, 1, 1472 }, +{ 0x11, 161, 0, 1462 }, +{ 0x12, 159, 1, 1473 }, +{ 0x9, 161, 0, 1463 }, +{ 0xa, 159, 1, 1474 }, +{ 0x5, 161, 0, 1464 }, +{ 0x6, 159, 1, 1476 }, +{ 0x2, 160, 1, 1475 }, +{ 0x3, 161, 1, 1466 }, +{ 0x1, 161, 1, 1465 }, +{ 0x3, 316, 0, 949 }, +{ 0x11, 159, 0, 1477 }, +{ 0x9, 159, 0, 1478 }, +{ 0x5, 159, 0, 1479 }, +{ 0x3, 159, 1, 1481 }, +{ 0x1, 160, 1, 1480 }, +{ 0x1, 113, 0, 916 }, +{ 0x8, 155, 0, 1482 }, +{ 0x4, 155, 0, 1483 }, +{ 0x2, 155, 0, 1484 }, +{ 0x1, 155, 1, 1486 }, +{ 0x1, 156, 1, 1485 }, +{ 0x1, 280, 0, 928 }, +{ 0x8, 157, 0, 1487 }, +{ 0x4, 157, 0, 1488 }, +{ 0x2, 157, 0, 1489 }, +{ 0x1, 157, 1, 1491 }, +{ 0x1, 158, 1, 1490 }, +{ 0x1, 279, 0, 929 }, +{ 0x8, 166, 0, 1492 }, +{ 0x4, 166, 0, 1493 }, +{ 0x2, 166, 0, 1494 }, +{ 0x1, 166, 1, 1496 }, +{ 0x1, 167, 1, 1495 }, +{ 0x1, 278, 0, 930 }, +{ 0x8, 169, 0, 1497 }, +{ 0x4, 169, 0, 1498 }, +{ 0x2, 169, 0, 1499 }, +{ 0x1, 169, 1, 1501 }, +{ 0x1, 170, 1, 1500 }, +{ 0x1, 277, 0, 931 }, +{ 0x8, 181, 0, 1502 }, +{ 0x4, 181, 0, 1503 }, +{ 0x2, 181, 0, 1504 }, +{ 0x1, 181, 1, 1506 }, +{ 0x1, 182, 0, 1505 }, +{ 0x8, 179, 0, 1507 }, +{ 0x4, 179, 0, 1508 }, +{ 0x2, 179, 0, 1509 }, +{ 0x1, 179, 1, 1511 }, +{ 0x1, 180, 0, 1510 }, +{ 0x1, 288, 0, 1512 }, +{ 0x1, 32, 0, 1513 }, +{ 0x8, 114, 0, 1514 }, +{ 0x4, 114, 0, 1515 }, +{ 0x2, 114, 0, 1516 }, +{ 0x1, 114, 1, 1518 }, +{ 0x1, 115, 0, 1517 }, +{ 0x8, 118, 0, 1519 }, +{ 0x4, 118, 0, 1520 }, +{ 0x2, 118, 0, 1521 }, +{ 0x1, 118, 1, 1523 }, +{ 0x1, 119, 0, 1522 }, +{ 0x8, 188, 0, 1524 }, +{ 0x4, 188, 0, 1525 }, +{ 0x2, 188, 0, 1526 }, +{ 0x1, 188, 1, 1528 }, +{ 0x1, 189, 0, 1527 }, +{ 0x1, 130, 0, 1529 }, +{ 0x442, 128, 0, 1530 }, +{ 0x242, 128, 0, 1531 }, +{ 0x142, 128, 0, 1532 }, +{ 0xc2, 128, 1, 1534 }, +{ 0x6, 129, 0, 1533 }, +{ 0x22, 128, 0, 1540 }, +{ 0x12, 128, 0, 1541 }, +{ 0xa, 128, 0, 1542 }, +{ 0x6, 128, 1, 1544 }, +{ 0x2, 129, 1, 1543 }, +{ 0x1, 98, 0, 1071 }, +{ 0x221, 128, 0, 1535 }, +{ 0x121, 128, 0, 1536 }, +{ 0xa1, 128, 0, 1537 }, +{ 0x61, 128, 1, 1539 }, +{ 0x3, 129, 0, 1538 }, +{ 0x11, 128, 0, 1545 }, +{ 0x9, 128, 0, 1546 }, +{ 0x5, 128, 0, 1547 }, +{ 0x3, 128, 1, 1549 }, +{ 0x1, 129, 1, 1548 }, +{ 0x1, 97, 0, 1072 }, +{ 0x1, 194, 0, 1550 }, +{ 0x1, 152, 0, 1551 }, +{ 0x1, 112, 0, 1552 }, +{ 0x1, 111, 0, 1553 }, +{ 0x4, 191, 0, 1554 }, +{ 0x2, 191, 0, 1555 }, +{ 0x1, 191, 0, 1556 }, +{ 0x1, 154, 0, 1557 }, +{ 0x2, 192, 0, 1558 }, +{ 0x1, 192, 0, 1559 }, +{ 0x4, 142, 0, 1560 }, +{ 0x2, 142, 0, 1561 }, +{ 0x1, 142, 0, 1562 }, +{ 0x4, 139, 0, 1563 }, +{ 0x1, 147, 0, 1566 }, +{ 0x1, 146, 1, 1567 }, +{ 0x2, 139, 0, 1564 }, +{ 0x1, 105, 0, 1568 }, +{ 0x1, 246, 1, 1569 }, +{ 0x1, 139, 0, 1565 }, +{ 0x8, 107, 0, 1570 }, +{ 0x4, 107, 0, 1571 }, +{ 0x2, 107, 0, 1572 }, +{ 0x1, 107, 1, 1574 }, +{ 0x1, 108, 0, 1573 }, +{ 0x8, 109, 0, 1575 }, +{ 0x4, 109, 0, 1576 }, +{ 0x2, 109, 0, 1577 }, +{ 0x1, 109, 1, 1579 }, +{ 0x1, 110, 1, 1578 }, +{ 0x1, 372, 0, 1073 }, +{ 0x8, 137, 0, 1580 }, +{ 0x4, 137, 0, 1581 }, +{ 0x2, 137, 0, 1582 }, +{ 0x1, 137, 1, 1584 }, +{ 0x1, 138, 1, 1583 }, +{ 0x1, 371, 0, 1074 }, +{ 0x8, 140, 0, 1585 }, +{ 0x4, 140, 0, 1586 }, +{ 0x2, 140, 0, 1587 }, +{ 0x1, 140, 1, 1589 }, +{ 0x1, 141, 1, 1588 }, +{ 0x1, 370, 0, 1075 }, +{ 0x8, 185, 0, 1590 }, +{ 0x4, 185, 0, 1591 }, +{ 0x2, 185, 0, 1592 }, +{ 0x1, 185, 1, 1594 }, +{ 0x1, 186, 0, 1593 }, +{ 0x8, 183, 0, 1595 }, +{ 0x4, 183, 0, 1596 }, +{ 0x2, 183, 0, 1597 }, +{ 0x1, 183, 1, 1599 }, +{ 0x1, 184, 0, 1598 }, +{ 0x8, 43, 0, 1604 }, +{ 0x18, 43, 0, 1600 }, +{ 0x4, 43, 0, 1605 }, +{ 0xc, 43, 0, 1601 }, +{ 0x2, 43, 0, 1606 }, +{ 0x6, 43, 0, 1602 }, +{ 0x1, 43, 0, 1607 }, +{ 0x3, 43, 0, 1603 }, +{ 0x51, 29, 0, 1609 }, +{ 0xd1, 29, 0, 1608 }, +{ 0x31, 29, 1, 1619 }, +{ 0x11, 30, 0, 1618 }, +{ 0x71, 29, 1, 1617 }, +{ 0x31, 30, 0, 1616 }, +{ 0x29, 29, 0, 1611 }, +{ 0x69, 29, 0, 1610 }, +{ 0x19, 29, 1, 1623 }, +{ 0x9, 30, 0, 1622 }, +{ 0x39, 29, 1, 1621 }, +{ 0x19, 30, 0, 1620 }, +{ 0x15, 29, 0, 1613 }, +{ 0x35, 29, 0, 1612 }, +{ 0xd, 29, 1, 1627 }, +{ 0x5, 30, 0, 1626 }, +{ 0x1d, 29, 1, 1625 }, +{ 0xd, 30, 0, 1624 }, +{ 0xb, 29, 0, 1615 }, +{ 0x1b, 29, 0, 1614 }, +{ 0x7, 29, 1, 1631 }, +{ 0x3, 30, 0, 1630 }, +{ 0xf, 29, 1, 1629 }, +{ 0x7, 30, 0, 1628 }, +{ 0xa2, 27, 0, 1633 }, +{ 0x1a2, 27, 0, 1632 }, +{ 0x62, 27, 1, 1643 }, +{ 0x22, 28, 0, 1642 }, +{ 0xe2, 27, 1, 1641 }, +{ 0x62, 28, 0, 1640 }, +{ 0x52, 27, 0, 1635 }, +{ 0xd2, 27, 0, 1634 }, +{ 0x32, 27, 1, 1647 }, +{ 0x12, 28, 0, 1646 }, +{ 0x72, 27, 1, 1645 }, +{ 0x32, 28, 0, 1644 }, +{ 0x2a, 27, 0, 1637 }, +{ 0x6a, 27, 0, 1636 }, +{ 0x1a, 27, 1, 1651 }, +{ 0xa, 28, 0, 1650 }, +{ 0x3a, 27, 1, 1649 }, +{ 0x1a, 28, 0, 1648 }, +{ 0x16, 27, 0, 1639 }, +{ 0x36, 27, 0, 1638 }, +{ 0xe, 27, 1, 1655 }, +{ 0x6, 28, 0, 1654 }, +{ 0x1e, 27, 1, 1653 }, +{ 0xe, 28, 0, 1652 }, +{ 0x51, 27, 0, 1657 }, +{ 0xd1, 27, 0, 1656 }, +{ 0x31, 27, 1, 1667 }, +{ 0x11, 28, 0, 1666 }, +{ 0x71, 27, 1, 1665 }, +{ 0x31, 28, 0, 1664 }, +{ 0x29, 27, 0, 1659 }, +{ 0x69, 27, 0, 1658 }, +{ 0x19, 27, 1, 1671 }, +{ 0x9, 28, 0, 1670 }, +{ 0x39, 27, 1, 1669 }, +{ 0x19, 28, 0, 1668 }, +{ 0x15, 27, 0, 1661 }, +{ 0x35, 27, 0, 1660 }, +{ 0xd, 27, 1, 1675 }, +{ 0x5, 28, 0, 1674 }, +{ 0x1d, 27, 1, 1673 }, +{ 0xd, 28, 0, 1672 }, +{ 0xb, 27, 0, 1663 }, +{ 0x1b, 27, 0, 1662 }, +{ 0x7, 27, 1, 1679 }, +{ 0x3, 28, 0, 1678 }, +{ 0xf, 27, 1, 1677 }, +{ 0x7, 28, 0, 1676 }, +{ 0x51, 25, 0, 1681 }, +{ 0xd1, 25, 0, 1680 }, +{ 0x31, 25, 1, 1691 }, +{ 0x11, 26, 0, 1690 }, +{ 0x71, 25, 1, 1689 }, +{ 0x31, 26, 0, 1688 }, +{ 0x29, 25, 0, 1683 }, +{ 0x69, 25, 0, 1682 }, +{ 0x19, 25, 1, 1695 }, +{ 0x9, 26, 0, 1694 }, +{ 0x39, 25, 1, 1693 }, +{ 0x19, 26, 0, 1692 }, +{ 0x15, 25, 0, 1685 }, +{ 0x35, 25, 0, 1684 }, +{ 0xd, 25, 1, 1699 }, +{ 0x5, 26, 0, 1698 }, +{ 0x1d, 25, 1, 1697 }, +{ 0xd, 26, 0, 1696 }, +{ 0xb, 25, 0, 1687 }, +{ 0x1b, 25, 0, 1686 }, +{ 0x7, 25, 1, 1703 }, +{ 0x3, 26, 0, 1702 }, +{ 0xf, 25, 1, 1701 }, +{ 0x7, 26, 0, 1700 }, +{ 0xa2, 23, 0, 1705 }, +{ 0x1a2, 23, 0, 1704 }, +{ 0x62, 23, 1, 1715 }, +{ 0x22, 24, 0, 1714 }, +{ 0xe2, 23, 1, 1713 }, +{ 0x62, 24, 0, 1712 }, +{ 0x52, 23, 0, 1707 }, +{ 0xd2, 23, 0, 1706 }, +{ 0x32, 23, 1, 1719 }, +{ 0x12, 24, 0, 1718 }, +{ 0x72, 23, 1, 1717 }, +{ 0x32, 24, 0, 1716 }, +{ 0x2a, 23, 0, 1709 }, +{ 0x6a, 23, 0, 1708 }, +{ 0x1a, 23, 1, 1723 }, +{ 0xa, 24, 0, 1722 }, +{ 0x3a, 23, 1, 1721 }, +{ 0x1a, 24, 0, 1720 }, +{ 0x16, 23, 0, 1711 }, +{ 0x36, 23, 0, 1710 }, +{ 0xe, 23, 1, 1727 }, +{ 0x6, 24, 0, 1726 }, +{ 0x1e, 23, 1, 1725 }, +{ 0xe, 24, 0, 1724 }, +{ 0x51, 23, 0, 1729 }, +{ 0xd1, 23, 0, 1728 }, +{ 0x31, 23, 1, 1739 }, +{ 0x11, 24, 0, 1738 }, +{ 0x71, 23, 1, 1737 }, +{ 0x31, 24, 0, 1736 }, +{ 0x29, 23, 0, 1731 }, +{ 0x69, 23, 0, 1730 }, +{ 0x19, 23, 1, 1743 }, +{ 0x9, 24, 0, 1742 }, +{ 0x39, 23, 1, 1741 }, +{ 0x19, 24, 0, 1740 }, +{ 0x15, 23, 0, 1733 }, +{ 0x35, 23, 0, 1732 }, +{ 0xd, 23, 1, 1747 }, +{ 0x5, 24, 0, 1746 }, +{ 0x1d, 23, 1, 1745 }, +{ 0xd, 24, 0, 1744 }, +{ 0xb, 23, 0, 1735 }, +{ 0x1b, 23, 0, 1734 }, +{ 0x7, 23, 1, 1751 }, +{ 0x3, 24, 0, 1750 }, +{ 0xf, 23, 1, 1749 }, +{ 0x7, 24, 0, 1748 }, +{ 0x51, 21, 1, 1777 }, +{ 0x50, 21, 0, 1753 }, +{ 0xd1, 21, 1, 1776 }, +{ 0xd0, 21, 0, 1752 }, +{ 0x31, 21, 1, 1787 }, +{ 0x30, 21, 1, 1763 }, +{ 0x11, 22, 1, 1786 }, +{ 0x10, 22, 0, 1762 }, +{ 0x71, 21, 1, 1785 }, +{ 0x70, 21, 1, 1761 }, +{ 0x31, 22, 1, 1784 }, +{ 0x30, 22, 0, 1760 }, +{ 0x29, 21, 1, 1779 }, +{ 0x28, 21, 0, 1755 }, +{ 0x69, 21, 1, 1778 }, +{ 0x68, 21, 0, 1754 }, +{ 0x19, 21, 1, 1791 }, +{ 0x18, 21, 1, 1767 }, +{ 0x9, 22, 1, 1790 }, +{ 0x8, 22, 0, 1766 }, +{ 0x39, 21, 1, 1789 }, +{ 0x38, 21, 1, 1765 }, +{ 0x19, 22, 1, 1788 }, +{ 0x18, 22, 0, 1764 }, +{ 0x15, 21, 1, 1781 }, +{ 0x14, 21, 0, 1757 }, +{ 0x35, 21, 1, 1780 }, +{ 0x34, 21, 0, 1756 }, +{ 0xd, 21, 1, 1795 }, +{ 0xc, 21, 1, 1771 }, +{ 0x5, 22, 1, 1794 }, +{ 0x4, 22, 0, 1770 }, +{ 0x1d, 21, 1, 1793 }, +{ 0x1c, 21, 1, 1769 }, +{ 0xd, 22, 1, 1792 }, +{ 0xc, 22, 0, 1768 }, +{ 0xb, 21, 1, 1783 }, +{ 0xa, 21, 0, 1759 }, +{ 0x1b, 21, 1, 1782 }, +{ 0x1a, 21, 0, 1758 }, +{ 0x7, 21, 1, 1799 }, +{ 0x6, 21, 1, 1775 }, +{ 0x3, 22, 1, 1798 }, +{ 0x2, 22, 0, 1774 }, +{ 0xf, 21, 1, 1797 }, +{ 0xe, 21, 1, 1773 }, +{ 0x7, 22, 1, 1796 }, +{ 0x6, 22, 0, 1772 }, +{ 0x8, 20, 0, 1801 }, +{ 0x18, 20, 0, 1800 }, +{ 0x1, 20, 1, 1805 }, +{ 0x2, 20, 0, 1804 }, +{ 0x3, 20, 1, 1803 }, +{ 0x4, 20, 0, 1802 }, +{ 0x1, 287, 0, 1806 }, +{ 0x14, 42, 0, 1809 }, +{ 0x34, 42, 0, 1807 }, +{ 0xc, 42, 0, 1810 }, +{ 0x1c, 42, 0, 1808 }, +{ 0x2, 42, 0, 1813 }, +{ 0x6, 42, 0, 1811 }, +{ 0x1, 42, 0, 1814 }, +{ 0x3, 42, 0, 1812 }, +{ 0x51, 18, 0, 1816 }, +{ 0xd1, 18, 0, 1815 }, +{ 0x31, 18, 1, 1826 }, +{ 0x11, 19, 0, 1825 }, +{ 0x71, 18, 1, 1824 }, +{ 0x31, 19, 0, 1823 }, +{ 0x29, 18, 0, 1818 }, +{ 0x69, 18, 0, 1817 }, +{ 0x19, 18, 1, 1830 }, +{ 0x9, 19, 0, 1829 }, +{ 0x39, 18, 1, 1828 }, +{ 0x19, 19, 0, 1827 }, +{ 0x15, 18, 0, 1820 }, +{ 0x35, 18, 0, 1819 }, +{ 0xd, 18, 1, 1834 }, +{ 0x5, 19, 0, 1833 }, +{ 0x1d, 18, 1, 1832 }, +{ 0xd, 19, 0, 1831 }, +{ 0xb, 18, 0, 1822 }, +{ 0x1b, 18, 0, 1821 }, +{ 0x7, 18, 1, 1838 }, +{ 0x3, 19, 0, 1837 }, +{ 0xf, 18, 1, 1836 }, +{ 0x7, 19, 0, 1835 }, +{ 0x1, 31, 0, 1839 }, +{ 0x1, 103, 0, 1840 }, +{ 0x2, 44, 0, 1841 }, +{ 0x1, 44, 0, 1842 }, +{ 0x1, 335, 0, 1843 }, +{ 0x2, 51, 0, 1844 }, +{ 0x1, 51, 0, 1845 }, +{ 0x1, 96, 0, 1846 }, +{ 0x51, 16, 0, 1848 }, +{ 0xd1, 16, 0, 1847 }, +{ 0x31, 16, 1, 1858 }, +{ 0x11, 17, 0, 1857 }, +{ 0x71, 16, 1, 1856 }, +{ 0x31, 17, 0, 1855 }, +{ 0x29, 16, 0, 1850 }, +{ 0x69, 16, 0, 1849 }, +{ 0x19, 16, 1, 1862 }, +{ 0x9, 17, 0, 1861 }, +{ 0x39, 16, 1, 1860 }, +{ 0x19, 17, 0, 1859 }, +{ 0x15, 16, 0, 1852 }, +{ 0x35, 16, 0, 1851 }, +{ 0xd, 16, 1, 1866 }, +{ 0x5, 17, 0, 1865 }, +{ 0x1d, 16, 1, 1864 }, +{ 0xd, 17, 0, 1863 }, +{ 0xb, 16, 0, 1854 }, +{ 0x1b, 16, 0, 1853 }, +{ 0x7, 16, 1, 1870 }, +{ 0x3, 17, 0, 1869 }, +{ 0xf, 16, 1, 1868 }, +{ 0x7, 17, 0, 1867 }, +{ 0xa20, 14, 0, 1872 }, +{ 0x1a20, 14, 0, 1871 }, +{ 0x620, 14, 1, 1882 }, +{ 0x220, 15, 0, 1881 }, +{ 0xe20, 14, 1, 1880 }, +{ 0x620, 15, 0, 1879 }, +{ 0x520, 14, 0, 1874 }, +{ 0xd20, 14, 0, 1873 }, +{ 0x320, 14, 1, 1886 }, +{ 0x120, 15, 0, 1885 }, +{ 0x720, 14, 1, 1884 }, +{ 0x320, 15, 0, 1883 }, +{ 0x2a0, 14, 0, 1876 }, +{ 0x6a0, 14, 0, 1875 }, +{ 0x1a0, 14, 1, 1890 }, +{ 0xa0, 15, 0, 1889 }, +{ 0x3a0, 14, 1, 1888 }, +{ 0x1a0, 15, 0, 1887 }, +{ 0x160, 14, 0, 1878 }, +{ 0x360, 14, 0, 1877 }, +{ 0xe0, 14, 1, 1894 }, +{ 0x60, 15, 0, 1893 }, +{ 0x1e0, 14, 1, 1892 }, +{ 0xe0, 15, 0, 1891 }, +{ 0x51, 14, 1, 1920 }, +{ 0x50, 14, 0, 1896 }, +{ 0xd1, 14, 1, 1919 }, +{ 0xd0, 14, 0, 1895 }, +{ 0x31, 14, 1, 1930 }, +{ 0x30, 14, 1, 1906 }, +{ 0x11, 15, 1, 1929 }, +{ 0x10, 15, 0, 1905 }, +{ 0x71, 14, 1, 1928 }, +{ 0x70, 14, 1, 1904 }, +{ 0x31, 15, 1, 1927 }, +{ 0x30, 15, 0, 1903 }, +{ 0x29, 14, 1, 1922 }, +{ 0x28, 14, 0, 1898 }, +{ 0x69, 14, 1, 1921 }, +{ 0x68, 14, 0, 1897 }, +{ 0x19, 14, 1, 1934 }, +{ 0x18, 14, 1, 1910 }, +{ 0x9, 15, 1, 1933 }, +{ 0x8, 15, 0, 1909 }, +{ 0x39, 14, 1, 1932 }, +{ 0x38, 14, 1, 1908 }, +{ 0x19, 15, 1, 1931 }, +{ 0x18, 15, 0, 1907 }, +{ 0x15, 14, 1, 1924 }, +{ 0x14, 14, 0, 1900 }, +{ 0x35, 14, 1, 1923 }, +{ 0x34, 14, 0, 1899 }, +{ 0xd, 14, 1, 1938 }, +{ 0xc, 14, 1, 1914 }, +{ 0x5, 15, 1, 1937 }, +{ 0x4, 15, 0, 1913 }, +{ 0x1d, 14, 1, 1936 }, +{ 0x1c, 14, 1, 1912 }, +{ 0xd, 15, 1, 1935 }, +{ 0xc, 15, 0, 1911 }, +{ 0xb, 14, 1, 1926 }, +{ 0xa, 14, 0, 1902 }, +{ 0x1b, 14, 1, 1925 }, +{ 0x1a, 14, 0, 1901 }, +{ 0x7, 14, 1, 1942 }, +{ 0x6, 14, 1, 1918 }, +{ 0x3, 15, 1, 1941 }, +{ 0x2, 15, 0, 1917 }, +{ 0xf, 14, 1, 1940 }, +{ 0xe, 14, 1, 1916 }, +{ 0x7, 15, 1, 1939 }, +{ 0x6, 15, 0, 1915 }, +{ 0x8, 13, 0, 1944 }, +{ 0x18, 13, 0, 1943 }, +{ 0x1, 13, 1, 1948 }, +{ 0x2, 13, 0, 1947 }, +{ 0x3, 13, 1, 1946 }, +{ 0x4, 13, 0, 1945 }, +{ 0x1, 84, 1, 2024 }, +{ 0x1, 85, 1, 2023 }, +{ 0x1, 86, 1, 2022 }, +{ 0x1, 87, 1, 2021 }, +{ 0x39, 40, 1, 21 }, +{ 0x19, 41, 0, 20 }, +{ 0x3, 84, 1, 2020 }, +{ 0x3, 85, 1, 2019 }, +{ 0x3, 86, 1, 2018 }, +{ 0x3, 87, 1, 2017 }, +{ 0x69, 40, 0, 10 }, +{ 0x14, 79, 1, 2014 }, +{ 0xa, 83, 1, 2013 }, +{ 0xd1, 40, 0, 8 }, +{ 0x34, 79, 1, 1950 }, +{ 0xe, 91, 0, 1949 }, +{ 0xc, 79, 1, 2094 }, +{ 0x6, 83, 0, 2093 }, +{ 0x2, 79, 1, 1956 }, +{ 0x2, 82, 0, 1955 }, +{ 0x12, 79, 1, 1954 }, +{ 0x6, 82, 0, 1953 }, +{ 0xa, 79, 1, 2016 }, +{ 0x5, 83, 1, 2015 }, +{ 0x71, 40, 1, 17 }, +{ 0x31, 41, 0, 16 }, +{ 0x1a, 79, 1, 1952 }, +{ 0x7, 91, 0, 1951 }, +{ 0x6, 79, 1, 2096 }, +{ 0x3, 83, 0, 2095 }, +{ 0x1, 79, 1, 2104 }, +{ 0x1, 80, 1, 2103 }, +{ 0x1, 81, 1, 2102 }, +{ 0x1, 82, 0, 2101 }, +{ 0x3, 79, 1, 2100 }, +{ 0x3, 80, 1, 2099 }, +{ 0x3, 81, 1, 2098 }, +{ 0x3, 82, 0, 2097 }, +{ 0x8, 60, 1, 2036 }, +{ 0x2, 63, 1, 2033 }, +{ 0x1, 65, 1, 2035 }, +{ 0x1, 66, 1, 2034 }, +{ 0xf, 40, 1, 29 }, +{ 0x7, 41, 0, 28 }, +{ 0x18, 60, 1, 2032 }, +{ 0x6, 63, 1, 2029 }, +{ 0x3, 65, 1, 2031 }, +{ 0x3, 66, 1, 2030 }, +{ 0x1b, 40, 0, 14 }, +{ 0x14, 60, 1, 2026 }, +{ 0xa, 64, 1, 2025 }, +{ 0x35, 40, 0, 12 }, +{ 0x34, 60, 1, 1958 }, +{ 0xe, 70, 0, 1957 }, +{ 0xc, 60, 1, 2106 }, +{ 0x6, 64, 0, 2105 }, +{ 0x2, 60, 1, 1964 }, +{ 0x4, 63, 0, 1963 }, +{ 0x12, 60, 1, 1962 }, +{ 0xc, 63, 0, 1961 }, +{ 0xa, 60, 1, 2028 }, +{ 0x5, 64, 1, 2027 }, +{ 0x1d, 40, 1, 25 }, +{ 0xd, 41, 0, 24 }, +{ 0x1a, 60, 1, 1960 }, +{ 0x7, 70, 0, 1959 }, +{ 0x6, 60, 1, 2108 }, +{ 0x3, 64, 0, 2107 }, +{ 0x1, 60, 1, 2116 }, +{ 0x1, 61, 1, 2115 }, +{ 0x1, 62, 1, 2114 }, +{ 0x1, 63, 0, 2113 }, +{ 0x3, 60, 1, 2112 }, +{ 0x3, 61, 1, 2111 }, +{ 0x3, 62, 1, 2110 }, +{ 0x3, 63, 0, 2109 }, +{ 0x28, 76, 1, 2040 }, +{ 0x44, 77, 1, 2037 }, +{ 0x88, 77, 1, 2039 }, +{ 0x28, 78, 0, 2038 }, +{ 0x68, 76, 1, 1968 }, +{ 0x188, 77, 1, 1967 }, +{ 0x38, 89, 1, 1966 }, +{ 0x38, 90, 0, 1965 }, +{ 0x18, 76, 1, 2120 }, +{ 0x14, 77, 1, 2117 }, +{ 0x28, 77, 1, 2119 }, +{ 0x18, 78, 0, 2118 }, +{ 0x14, 76, 1, 2044 }, +{ 0x24, 77, 1, 2043 }, +{ 0x48, 77, 1, 2041 }, +{ 0x14, 78, 0, 2042 }, +{ 0x34, 76, 1, 1972 }, +{ 0x64, 77, 1, 1971 }, +{ 0x1c, 89, 1, 1970 }, +{ 0x1c, 90, 0, 1969 }, +{ 0xc, 76, 1, 2124 }, +{ 0xc, 77, 1, 2123 }, +{ 0x18, 77, 1, 2121 }, +{ 0xc, 78, 0, 2122 }, +{ 0xa, 76, 1, 2048 }, +{ 0x11, 77, 1, 2045 }, +{ 0x22, 77, 1, 2047 }, +{ 0xa, 78, 0, 2046 }, +{ 0x1a, 76, 1, 1976 }, +{ 0x62, 77, 1, 1975 }, +{ 0xe, 89, 1, 1974 }, +{ 0xe, 90, 0, 1973 }, +{ 0x6, 76, 1, 2128 }, +{ 0x5, 77, 1, 2125 }, +{ 0xa, 77, 1, 2127 }, +{ 0x6, 78, 0, 2126 }, +{ 0x5, 76, 1, 2052 }, +{ 0x9, 77, 1, 2051 }, +{ 0x12, 77, 1, 2049 }, +{ 0x5, 78, 0, 2050 }, +{ 0xd, 76, 1, 1980 }, +{ 0x19, 77, 1, 1979 }, +{ 0x7, 89, 1, 1978 }, +{ 0x7, 90, 0, 1977 }, +{ 0x3, 76, 1, 2132 }, +{ 0x3, 77, 1, 2131 }, +{ 0x6, 77, 1, 2129 }, +{ 0x3, 78, 0, 2130 }, +{ 0x28, 57, 1, 2056 }, +{ 0x44, 58, 1, 2053 }, +{ 0x88, 58, 1, 2055 }, +{ 0x28, 59, 0, 2054 }, +{ 0x68, 57, 1, 1984 }, +{ 0x188, 58, 1, 1983 }, +{ 0x38, 68, 1, 1982 }, +{ 0x38, 69, 0, 1981 }, +{ 0x18, 57, 1, 2136 }, +{ 0x14, 58, 1, 2133 }, +{ 0x28, 58, 1, 2135 }, +{ 0x18, 59, 0, 2134 }, +{ 0x14, 57, 1, 2060 }, +{ 0x24, 58, 1, 2059 }, +{ 0x48, 58, 1, 2057 }, +{ 0x14, 59, 0, 2058 }, +{ 0x34, 57, 1, 1988 }, +{ 0x64, 58, 1, 1987 }, +{ 0x1c, 68, 1, 1986 }, +{ 0x1c, 69, 0, 1985 }, +{ 0xc, 57, 1, 2140 }, +{ 0xc, 58, 1, 2139 }, +{ 0x18, 58, 1, 2137 }, +{ 0xc, 59, 0, 2138 }, +{ 0xa, 57, 1, 2064 }, +{ 0x11, 58, 1, 2061 }, +{ 0x22, 58, 1, 2063 }, +{ 0xa, 59, 0, 2062 }, +{ 0x1a, 57, 1, 1992 }, +{ 0x62, 58, 1, 1991 }, +{ 0xe, 68, 1, 1990 }, +{ 0xe, 69, 0, 1989 }, +{ 0x6, 57, 1, 2144 }, +{ 0x5, 58, 1, 2141 }, +{ 0xa, 58, 1, 2143 }, +{ 0x6, 59, 0, 2142 }, +{ 0x5, 57, 1, 2068 }, +{ 0x9, 58, 1, 2067 }, +{ 0x12, 58, 1, 2065 }, +{ 0x5, 59, 0, 2066 }, +{ 0xd, 57, 1, 1996 }, +{ 0x19, 58, 1, 1995 }, +{ 0x7, 68, 1, 1994 }, +{ 0x7, 69, 0, 1993 }, +{ 0x3, 57, 1, 2148 }, +{ 0x3, 58, 1, 2147 }, +{ 0x6, 58, 1, 2145 }, +{ 0x3, 59, 0, 2146 }, +{ 0x8, 71, 1, 2080 }, +{ 0x2, 72, 1, 2079 }, +{ 0x2, 73, 1, 2078 }, +{ 0x2, 74, 0, 2077 }, +{ 0x18, 71, 1, 2076 }, +{ 0x6, 72, 1, 2075 }, +{ 0x6, 73, 1, 2074 }, +{ 0x6, 74, 0, 2073 }, +{ 0x14, 71, 1, 2070 }, +{ 0xa, 75, 0, 2069 }, +{ 0x34, 71, 1, 1998 }, +{ 0xe, 88, 0, 1997 }, +{ 0xc, 71, 1, 2150 }, +{ 0x6, 75, 0, 2149 }, +{ 0x2, 71, 1, 2004 }, +{ 0x4, 74, 0, 2003 }, +{ 0x12, 71, 1, 2002 }, +{ 0xc, 74, 0, 2001 }, +{ 0xa, 71, 1, 2072 }, +{ 0x5, 75, 0, 2071 }, +{ 0x1a, 71, 1, 2000 }, +{ 0x7, 88, 0, 1999 }, +{ 0x6, 71, 1, 2152 }, +{ 0x3, 75, 0, 2151 }, +{ 0x1, 71, 1, 2160 }, +{ 0x1, 72, 1, 2159 }, +{ 0x1, 73, 1, 2158 }, +{ 0x1, 74, 0, 2157 }, +{ 0x3, 71, 1, 2156 }, +{ 0x3, 72, 1, 2155 }, +{ 0x3, 73, 1, 2154 }, +{ 0x3, 74, 0, 2153 }, +{ 0x8, 52, 1, 2092 }, +{ 0x2, 53, 1, 2091 }, +{ 0x2, 54, 1, 2090 }, +{ 0x2, 55, 0, 2089 }, +{ 0x18, 52, 1, 2088 }, +{ 0x6, 53, 1, 2087 }, +{ 0x6, 54, 1, 2086 }, +{ 0x6, 55, 0, 2085 }, +{ 0x14, 52, 1, 2082 }, +{ 0xa, 56, 0, 2081 }, +{ 0x34, 52, 1, 2006 }, +{ 0xe, 67, 0, 2005 }, +{ 0xc, 52, 1, 2162 }, +{ 0x6, 56, 0, 2161 }, +{ 0x2, 52, 1, 2012 }, +{ 0x4, 55, 0, 2011 }, +{ 0x12, 52, 1, 2010 }, +{ 0xc, 55, 0, 2009 }, +{ 0xa, 52, 1, 2084 }, +{ 0x5, 56, 0, 2083 }, +{ 0x1a, 52, 1, 2008 }, +{ 0x7, 67, 0, 2007 }, +{ 0x6, 52, 1, 2164 }, +{ 0x3, 56, 0, 2163 }, +{ 0x1, 52, 1, 2172 }, +{ 0x1, 53, 1, 2171 }, +{ 0x1, 54, 1, 2170 }, +{ 0x1, 55, 0, 2169 }, +{ 0x3, 52, 1, 2168 }, +{ 0x3, 53, 1, 2167 }, +{ 0x3, 54, 1, 2166 }, +{ 0x3, 55, 0, 2165 }, +{ 0x1, 4, 0, 2173 }, +{ 0x1, 245, 0, 2174 }, +{ 0x1, 327, 0, 2175 }, +{ 0x1, 322, 0, 2176 }, +{ 0x2, 306, 0, 2177 }, +{ 0x1, 306, 0, 2180 }, +{ 0x2, 305, 0, 2178 }, +{ 0x1, 305, 0, 2181 }, +{ 0x2, 304, 0, 2179 }, +{ 0x1, 304, 0, 2182 }, +{ 0x1, 303, 0, 2183 }, +{ 0x1, 302, 0, 2184 }, +{ 0x2, 301, 0, 2185 }, +{ 0x1, 301, 0, 2187 }, +{ 0x2, 300, 0, 2186 }, +{ 0x1, 300, 0, 2188 }, +{ 0x1, 330, 0, 2195 }, +{ 0x8, 329, 0, 2189 }, +{ 0x4, 329, 0, 2191 }, +{ 0x2, 329, 0, 2193 }, +{ 0x1, 329, 0, 2196 }, +{ 0x8, 328, 0, 2190 }, +{ 0x4, 328, 0, 2192 }, +{ 0x2, 328, 0, 2194 }, +{ 0x1, 328, 0, 2197 }, +{ 0x1, 299, 0, 2204 }, +{ 0x8, 298, 0, 2198 }, +{ 0x4, 298, 0, 2200 }, +{ 0x2, 298, 0, 2202 }, +{ 0x1, 298, 0, 2205 }, +{ 0x8, 297, 0, 2199 }, +{ 0x4, 297, 0, 2201 }, +{ 0x2, 297, 1, 2203 }, +{ 0x4, 106, 0, 1249 }, +{ 0x1, 297, 0, 2206 }, +{ 0x1, 6, 0, 2207 }, +{ 0x1, 7, 0, 2208 }, +{ 0x1, 244, 0, 2209 }, +{ 0x1, 243, 0, 2210 }, +{ 0x1, 393, 0, 2211 }, +{ 0x1, 294, 0, 2212 }, +{ 0x1, 12, 0, 2213 }, +{ 0x1, 10, 0, 2214 }, +{ 0x1, 368, 0, 2215 }, +{ 0x1, 342, 0, 2216 }, +{ 0x1, 341, 0, 2217 }, +{ 0x1, 392, 0, 2218 }, +{ 0x1, 293, 0, 2219 }, +{ 0x1, 11, 0, 2220 }, +{ 0x1, 9, 0, 2221 }, +{ 0x1, 5, 0, 2222 }, +{ 0x1, 367, 0, 2223 }, +{ 0x1, 366, 0, 2224 }, +{ 0x1, 1, 0, 2225 }, +{ 0x1, 0, 0, 2226 }, +}; + diff --git a/contrib/binutils/opcodes/ia64-asmtab.h b/contrib/binutils/opcodes/ia64-asmtab.h new file mode 100644 index 0000000..822007a --- /dev/null +++ b/contrib/binutils/opcodes/ia64-asmtab.h @@ -0,0 +1,148 @@ +/* ia64-asmtab.h -- Header for compacted IA-64 opcode tables. + Copyright 1999, 2000 Free Software Foundation, Inc. + Contributed by Bob Manson of Cygnus Support <manson@cygnus.com> + + This file is part of GDB, GAS, and the GNU binutils. + + GDB, GAS, and the GNU binutils are free software; you can redistribute + them and/or modify them under the terms of the GNU General Public + License as published by the Free Software Foundation; either version + 2, or (at your option) any later version. + + GDB, GAS, and the GNU binutils are distributed in the hope that they + will be useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this file; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#ifndef IA64_ASMTAB_H +#define IA64_ASMTAB_H + +#include "opcode/ia64.h" + +/* The primary opcode table is made up of the following: */ +struct ia64_main_table +{ + /* The entry in the string table that corresponds to the name of this + opcode. */ + unsigned short name_index; + + /* The type of opcode; corresponds to the TYPE field in + struct ia64_opcode. */ + unsigned char opcode_type; + + /* The number of outputs for this opcode. */ + unsigned char num_outputs; + + /* The base insn value for this opcode. It may be modified by completers. */ + ia64_insn opcode; + + /* The mask of valid bits in OPCODE. Zeros indicate operand fields. */ + ia64_insn mask; + + /* The operands of this instruction. Corresponds to the OPERANDS field + in struct ia64_opcode. */ + unsigned char operands[5]; + + /* The flags for this instruction. Corresponds to the FLAGS field in + struct ia64_opcode. */ + short flags; + + /* The tree of completers for this instruction; this is an offset into + completer_table. */ + short completers; +}; + +/* Each instruction has a set of possible "completers", or additional + suffixes that can alter the instruction's behavior, and which has + potentially different dependencies. + + The completer entries modify certain bits in the instruction opcode. + Which bits are to be modified are marked by the BITS, MASK and + OFFSET fields. The completer entry may also note dependencies for the + opcode. + + These completers are arranged in a DAG; the pointers are indexes + into the completer_table array. The completer DAG is searched by + find_completer () and ia64_find_matching_opcode (). + + Note that each completer needs to be applied in turn, so that if we + have the instruction + cmp.lt.unc + the completer entries for both "lt" and "unc" would need to be applied + to the opcode's value. + + Some instructions do not require any completers; these contain an + empty completer entry. Instructions that require a completer do + not contain an empty entry. + + Terminal completers (those completers that validly complete an + instruction) are marked by having the TERMINAL_COMPLETER flag set. + + Only dependencies listed in the terminal completer for an opcode are + considered to apply to that opcode instance. */ + +struct ia64_completer_table +{ + /* The bit value that this completer sets. */ + unsigned int bits; + + /* And its mask. 1s are bits that are to be modified in the + instruction. */ + unsigned int mask; + + /* The entry in the string table that corresponds to the name of this + completer. */ + unsigned short name_index; + + /* An alternative completer, or -1 if this is the end of the chain. */ + short alternative; + + /* A pointer to the DAG of completers that can potentially follow + this one, or -1. */ + short subentries; + + /* The bit offset in the instruction where BITS and MASK should be + applied. */ + unsigned char offset : 7; + + unsigned char terminal_completer : 1; + + /* Index into the dependency list table */ + short dependencies; +}; + +/* This contains sufficient information for the disassembler to resolve + the complete name of the original instruction. */ +struct ia64_dis_names +{ + /* COMPLETER_INDEX represents the tree of completers that make up + the instruction. The LSB represents the top of the tree for the + specified instruction. + + A 0 bit indicates to go to the next alternate completer via the + alternative field; a 1 bit indicates that the current completer + is part of the instruction, and to go down the subentries index. + We know we've reached the final completer when we run out of 1 + bits. + + There is always at least one 1 bit. */ + unsigned int completer_index : 20; + + /* The index in the main_table[] array for the instruction. */ + unsigned short insn_index : 11; + + /* If set, the next entry in this table is an alternate possibility + for this instruction encoding. Which one to use is determined by + the instruction type and other factors (see opcode_verify ()). */ + unsigned int next_flag : 1; + + /* The disassembly priority of this entry among instructions. */ + unsigned short priority; +}; + +#endif diff --git a/contrib/binutils/opcodes/ia64-dis.c b/contrib/binutils/opcodes/ia64-dis.c new file mode 100644 index 0000000..f9add91 --- /dev/null +++ b/contrib/binutils/opcodes/ia64-dis.c @@ -0,0 +1,273 @@ +/* ia64-dis.c -- Disassemble ia64 instructions + Copyright 1998, 1999, 2000 Free Software Foundation, Inc. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + This file is part of GDB, GAS, and the GNU binutils. + + GDB, GAS, and the GNU binutils are free software; you can redistribute + them and/or modify them under the terms of the GNU General Public + License as published by the Free Software Foundation; either version + 2, or (at your option) any later version. + + GDB, GAS, and the GNU binutils are distributed in the hope that they + will be useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this file; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#include <assert.h> +#include <string.h> + +#include "dis-asm.h" +#include "opcode/ia64.h" + +#define NELEMS(a) ((int) (sizeof (a) / sizeof (a[0]))) + +/* Disassemble ia64 instruction. */ + +/* Return the instruction type for OPCODE found in unit UNIT. */ + +static enum ia64_insn_type +unit_to_type (ia64_insn opcode, enum ia64_unit unit) +{ + enum ia64_insn_type type; + int op; + + op = IA64_OP (opcode); + + if (op >= 8 && (unit == IA64_UNIT_I || unit == IA64_UNIT_M)) + { + type = IA64_TYPE_A; + } + else + { + switch (unit) + { + case IA64_UNIT_I: + type = IA64_TYPE_I; break; + case IA64_UNIT_M: + type = IA64_TYPE_M; break; + case IA64_UNIT_B: + type = IA64_TYPE_B; break; + case IA64_UNIT_F: + type = IA64_TYPE_F; break; + case IA64_UNIT_L: + case IA64_UNIT_X: + type = IA64_TYPE_X; break; + default: + type = -1; + } + } + return type; +} + +int +print_insn_ia64 (bfd_vma memaddr, struct disassemble_info *info) +{ + ia64_insn t0, t1, slot[3], template, s_bit, insn; + int slotnum, j, status, need_comma, retval, slot_multiplier; + const struct ia64_operand *odesc; + const struct ia64_opcode *idesc; + const char *err, *str, *tname; + BFD_HOST_U_64_BIT value; + bfd_byte bundle[16]; + enum ia64_unit unit; + char regname[16]; + + if (info->bytes_per_line == 0) + info->bytes_per_line = 6; + info->display_endian = info->endian; + + slot_multiplier = info->bytes_per_line; + retval = slot_multiplier; + + slotnum = (((long) memaddr) & 0xf) / slot_multiplier; + if (slotnum > 2) + return -1; + + memaddr -= (memaddr & 0xf); + status = (*info->read_memory_func) (memaddr, bundle, sizeof (bundle), info); + if (status != 0) + { + (*info->memory_error_func) (status, memaddr, info); + return -1; + } + /* bundles are always in little-endian byte order */ + t0 = bfd_getl64 (bundle); + t1 = bfd_getl64 (bundle + 8); + s_bit = t0 & 1; + template = (t0 >> 1) & 0xf; + slot[0] = (t0 >> 5) & 0x1ffffffffffLL; + slot[1] = ((t0 >> 46) & 0x3ffff) | ((t1 & 0x7fffff) << 18); + slot[2] = (t1 >> 23) & 0x1ffffffffffLL; + + tname = ia64_templ_desc[template].name; + if (slotnum == 0) + (*info->fprintf_func) (info->stream, "[%s] ", tname); + else + (*info->fprintf_func) (info->stream, " ", tname); + + unit = ia64_templ_desc[template].exec_unit[slotnum]; + + if (template == 2 && slotnum == 1) + { + /* skip L slot in MLI template: */ + slotnum = 2; + retval += slot_multiplier; + } + + insn = slot[slotnum]; + + if (unit == IA64_UNIT_NIL) + goto decoding_failed; + + idesc = ia64_dis_opcode (insn, unit_to_type (insn, unit)); + if (idesc == NULL) + goto decoding_failed; + + /* print predicate, if any: */ + + if ((idesc->flags & IA64_OPCODE_NO_PRED) + || (insn & 0x3f) == 0) + (*info->fprintf_func) (info->stream, " "); + else + (*info->fprintf_func) (info->stream, "(p%02d) ", (int)(insn & 0x3f)); + + /* now the actual instruction: */ + + (*info->fprintf_func) (info->stream, "%s", idesc->name); + if (idesc->operands[0]) + (*info->fprintf_func) (info->stream, " "); + + need_comma = 0; + for (j = 0; j < NELEMS (idesc->operands) && idesc->operands[j]; ++j) + { + odesc = elf64_ia64_operands + idesc->operands[j]; + + if (need_comma) + (*info->fprintf_func) (info->stream, ","); + + if (odesc - elf64_ia64_operands == IA64_OPND_IMMU64) + { + /* special case of 64 bit immediate load: */ + value = ((insn >> 13) & 0x7f) | (((insn >> 27) & 0x1ff) << 7) + | (((insn >> 22) & 0x1f) << 16) | (((insn >> 21) & 0x1) << 21) + | (slot[1] << 22) | (((insn >> 36) & 0x1) << 63); + } + else if (odesc - elf64_ia64_operands == IA64_OPND_IMMU62) + { + /* 62-bit immediate for nop.x/break.x */ + value = ((slot[1] & 0x1ffffffffffLL) << 21) + | (((insn >> 36) & 0x1) << 20) + | ((insn >> 6) & 0xfffff); + } + else if (odesc - elf64_ia64_operands == IA64_OPND_TGT64) + { + /* 60-bit immedate for long branches. */ + value = (((insn >> 13) & 0xfffff) + | (((insn >> 36) & 1) << 59) + | (slot[1] << 20)) << 4; + } + else + { + err = (*odesc->extract) (odesc, insn, &value); + if (err) + { + (*info->fprintf_func) (info->stream, "%s", err); + goto done; + } + } + + switch (odesc->class) + { + case IA64_OPND_CLASS_CST: + (*info->fprintf_func) (info->stream, "%s", odesc->str); + break; + + case IA64_OPND_CLASS_REG: + if (odesc->str[0] == 'a' && odesc->str[1] == 'r') + { + switch (value) + { + case 0: case 1: case 2: case 3: + case 4: case 5: case 6: case 7: + sprintf (regname, "ar.k%u", (unsigned int) value); + break; + case 16: strcpy (regname, "ar.rsc"); break; + case 17: strcpy (regname, "ar.bsp"); break; + case 18: strcpy (regname, "ar.bspstore"); break; + case 19: strcpy (regname, "ar.rnat"); break; + case 32: strcpy (regname, "ar.ccv"); break; + case 36: strcpy (regname, "ar.unat"); break; + case 40: strcpy (regname, "ar.fpsr"); break; + case 44: strcpy (regname, "ar.itc"); break; + case 64: strcpy (regname, "ar.pfs"); break; + case 65: strcpy (regname, "ar.lc"); break; + case 66: strcpy (regname, "ar.ec"); break; + default: + sprintf (regname, "ar%u", (unsigned int) value); + break; + } + (*info->fprintf_func) (info->stream, "%s", regname); + } + else + (*info->fprintf_func) (info->stream, "%s%d", odesc->str, (int)value); + break; + + case IA64_OPND_CLASS_IND: + (*info->fprintf_func) (info->stream, "%s[r%d]", odesc->str, (int)value); + break; + + case IA64_OPND_CLASS_ABS: + str = 0; + if (odesc - elf64_ia64_operands == IA64_OPND_MBTYPE4) + switch (value) + { + case 0x0: str = "@brcst"; break; + case 0x8: str = "@mix"; break; + case 0x9: str = "@shuf"; break; + case 0xa: str = "@alt"; break; + case 0xb: str = "@rev"; break; + } + + if (str) + (*info->fprintf_func) (info->stream, "%s", str); + else if (odesc->flags & IA64_OPND_FLAG_DECIMAL_SIGNED) + (*info->fprintf_func) (info->stream, "%lld", value); + else if (odesc->flags & IA64_OPND_FLAG_DECIMAL_UNSIGNED) + (*info->fprintf_func) (info->stream, "%llu", value); + else + (*info->fprintf_func) (info->stream, "0x%llx", value); + break; + + case IA64_OPND_CLASS_REL: + (*info->print_address_func) (memaddr + value, info); + break; + } + + need_comma = 1; + if (j + 1 == idesc->num_outputs) + { + (*info->fprintf_func) (info->stream, "="); + need_comma = 0; + } + } + if (slotnum + 1 == ia64_templ_desc[template].group_boundary + || ((slotnum == 2) && s_bit)) + (*info->fprintf_func) (info->stream, ";;"); + + done: + ia64_free_opcode ((struct ia64_opcode *)idesc); + failed: + if (slotnum == 2) + retval += 16 - 3*slot_multiplier; + return retval; + + decoding_failed: + (*info->fprintf_func) (info->stream, " data8 %#011llx", insn); + goto failed; +} diff --git a/contrib/binutils/opcodes/ia64-gen.c b/contrib/binutils/opcodes/ia64-gen.c new file mode 100644 index 0000000..4b4b197 --- /dev/null +++ b/contrib/binutils/opcodes/ia64-gen.c @@ -0,0 +1,2789 @@ +/* ia64-gen.c -- Generate a shrunk set of opcode tables + Copyright 1999, 2000 Free Software Foundation, Inc. + Written by Bob Manson, Cygnus Solutions, <manson@cygnus.com> + + This file is part of GDB, GAS, and the GNU binutils. + + GDB, GAS, and the GNU binutils are free software; you can redistribute + them and/or modify them under the terms of the GNU General Public + License as published by the Free Software Foundation; either version + 2, or (at your option) any later version. + + GDB, GAS, and the GNU binutils are distributed in the hope that they + will be useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this file; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +/* While the ia64-opc-* set of opcode tables are easy to maintain, + they waste a tremendous amount of space. ia64-gen rearranges the + instructions into a directed acyclic graph (DAG) of instruction opcodes and + their possible completers, as well as compacting the set of strings used. + + The disassembler table consists of a state machine that does + branching based on the bits of the opcode being disassembled. The + state encodings have been chosen to minimize the amount of space + required. + + The resource table is constructed based on some text dependency tables, + which are also easier to maintain than the final representation. + +*/ + +#include <stdio.h> +#include <ctype.h> + +#include "ansidecl.h" +#include "libiberty.h" +#include "sysdep.h" +#include "ia64-opc.h" +#include "ia64-opc-a.c" +#include "ia64-opc-i.c" +#include "ia64-opc-m.c" +#include "ia64-opc-b.c" +#include "ia64-opc-f.c" +#include "ia64-opc-x.c" +#include "ia64-opc-d.c" + +int debug = 0; + +#define tmalloc(X) (X *) xmalloc (sizeof (X)) + +/* The main opcode table entry. Each entry is a unique combination of + name and flags (no two entries in the table compare as being equal + via opcodes_eq). */ +struct main_entry +{ + /* The base name of this opcode. The names of its completers are + appended to it to generate the full instruction name. */ + struct string_entry *name; + /* The base opcode entry. Which one to use is a fairly arbitrary choice; + it uses the first one passed to add_opcode_entry. */ + struct ia64_opcode *opcode; + /* The list of completers that can be applied to this opcode. */ + struct completer_entry *completers; + /* Next entry in the chain. */ + struct main_entry *next; + /* Index in the main table. */ + int main_index; +} *maintable, **ordered_table; +int otlen = 0; +int ottotlen = 0; +int opcode_count = 0; + +/* The set of possible completers for an opcode. */ +struct completer_entry +{ + /* This entry's index in the ia64_completer_table[] array. */ + int num; + + /* The name of the completer. */ + struct string_entry *name; + + /* This entry's parent. */ + struct completer_entry *parent; + + /* Set if this is a terminal completer (occurs at the end of an + opcode). */ + int is_terminal; + + /* An alternative completer. */ + struct completer_entry *alternative; + + /* Additional completers that can be appended to this one. */ + struct completer_entry *addl_entries; + + /* Before compute_completer_bits () is invoked, this contains the actual + instruction opcode for this combination of opcode and completers. + Afterwards, it contains those bits that are different from its + parent opcode. */ + ia64_insn bits; + + /* Bits set to 1 correspond to those bits in this completer's opcode + that are different from its parent completer's opcode (or from + the base opcode if the entry is the root of the opcode's completer + list). This field is filled in by compute_completer_bits (). */ + ia64_insn mask; + + /* Index into the opcode dependency list, or -1 if none. */ + int dependencies; + + /* Remember the order encountered in the opcode tables. */ + int order; +}; + +/* One entry in the disassembler name table. */ +struct disent +{ + /* The index into the ia64_name_dis array for this entry. */ + int ournum; + + /* The index into the main_table[] array. */ + int insn; + + /* The disassmbly priority of this entry. */ + int priority; + + /* The completer_index value for this entry. */ + int completer_index; + + /* How many other entries share this decode. */ + int nextcnt; + + /* The next entry sharing the same decode. */ + struct disent *nexte; + + /* The next entry in the name list. */ + struct disent *next_ent; +} *disinsntable = NULL; + +/* A state machine that will eventually be used to generate the + disassembler table. */ +struct bittree +{ + struct disent *disent; + struct bittree *bits[3]; /* 0, 1, and X (don't care) */ + int bits_to_skip; + int skip_flag; +} *bittree; + +/* The string table contains all opcodes and completers sorted in + alphabetical order. */ + +/* One entry in the string table. */ +struct string_entry +{ + /* The index in the ia64_strings[] array for this entry. */ + int num; + /* And the string. */ + char *s; +} **string_table = NULL; +int strtablen = 0; +int strtabtotlen = 0; + + +/* resource dependency entries */ +struct rdep +{ + char *name; /* resource name */ + unsigned + mode:2, /* RAW, WAW, or WAR */ + semantics:3; /* dependency semantics */ + char *extra; /* additional semantics info */ + int nchks; + int total_chks; /* total #of terminal insns */ + int *chks; /* insn classes which read (RAW), write + (WAW), or write (WAR) this rsrc */ + int *chknotes; /* dependency notes for each class */ + int nregs; + int total_regs; /* total #of terminal insns */ + int *regs; /* insn class which write (RAW), write2 + (WAW), or read (WAR) this rsrc */ + int *regnotes; /* dependency notes for each class */ + + int waw_special; /* special WAW dependency note */ +} **rdeps = NULL; + +static int rdepslen = 0; +static int rdepstotlen = 0; + +/* array of all instruction classes */ +struct iclass +{ + char *name; /* instruction class name */ + int is_class; /* is a class, not a terminal */ + int nsubs; + int *subs; /* other classes within this class */ + int nxsubs; + int xsubs[4]; /* exclusions */ + char *comment; /* optional comment */ + int note; /* optional note */ + int terminal_resolved; /* did we match this with anything? */ + int orphan; /* detect class orphans */ +} **ics = NULL; + +static int iclen = 0; +static int ictotlen = 0; + +/* an opcode dependency (chk/reg pair of dependency lists) */ +struct opdep +{ + int chk; /* index into dlists */ + int reg; /* index into dlists */ +} **opdeps; + +static int opdeplen = 0; +static int opdeptotlen = 0; + +/* a generic list of dependencies w/notes encoded. these may be shared. */ +struct deplist +{ + int len; + unsigned short *deps; +} **dlists; + +static int dlistlen = 0; +static int dlisttotlen = 0; + +/* add NAME to the resource table, where TYPE is RAW or WAW */ +static struct rdep * +insert_resource (const char *name, enum ia64_dependency_mode type) +{ + if (rdepslen == rdepstotlen) + { + rdepstotlen += 20; + rdeps = (struct rdep **) + xrealloc (rdeps, sizeof(struct rdep **) * rdepstotlen); + } + rdeps[rdepslen] = tmalloc(struct rdep); + memset((void *)rdeps[rdepslen], 0, sizeof(struct rdep)); + rdeps[rdepslen]->name = xstrdup (name); + rdeps[rdepslen]->mode = type; + rdeps[rdepslen]->waw_special = 0; + + return rdeps[rdepslen++]; +} + +/* are the lists of dependency indexes equivalent? */ +static int +deplist_equals (struct deplist *d1, struct deplist *d2) +{ + int i; + + if (d1->len != d2->len) + return 0; + + for (i=0;i < d1->len;i++) + { + if (d1->deps[i] != d2->deps[i]) + return 0; + } + + return 1; +} + +/* add the list of dependencies to the list of dependency lists */ +static short +insert_deplist(int count, unsigned short *deps) +{ + /* sort the list, then see if an equivalent list exists already. + this results in a much smaller set of dependency lists + */ + struct deplist *list; + char set[0x10000]; + int i; + + memset ((void *)set, 0, sizeof(set)); + for (i=0;i < count;i++) + set[deps[i]] = 1; + count = 0; + for (i=0;i < (int)sizeof(set);i++) + if (set[i]) + ++count; + + list = tmalloc(struct deplist); + list->len = count; + list->deps = (unsigned short *)malloc (sizeof(unsigned short) * count); + for (i=0, count=0;i < (int)sizeof(set);i++) + { + if (set[i]) + { + list->deps[count++] = i; + } + } + + /* does this list exist already? */ + for (i=0;i < dlistlen;i++) + { + if (deplist_equals (list, dlists[i])) + { + free (list->deps); + free (list); + return i; + } + } + + if (dlistlen == dlisttotlen) + { + dlisttotlen += 20; + dlists = (struct deplist **) + xrealloc (dlists, sizeof(struct deplist **) * dlisttotlen); + } + dlists[dlistlen] = list; + + return dlistlen++; +} + +/* add the given pair of dependency lists to the opcode dependency list */ +static short +insert_dependencies (int nchks, unsigned short *chks, + int nregs, unsigned short *regs) +{ + struct opdep *pair; + int i; + int regind = -1; + int chkind = -1; + + if (nregs > 0) + regind = insert_deplist (nregs, regs); + if (nchks > 0) + chkind = insert_deplist (nchks, chks); + + for (i=0;i < opdeplen;i++) + { + if (opdeps[i]->chk == chkind + && opdeps[i]->reg == regind) + return i; + } + pair = tmalloc(struct opdep); + pair->chk = chkind; + pair->reg = regind; + + if (opdeplen == opdeptotlen) + { + opdeptotlen += 20; + opdeps = (struct opdep **) + xrealloc (opdeps, sizeof(struct opdep **) * opdeptotlen); + } + opdeps[opdeplen] = pair; + + return opdeplen++; +} + +static void +mark_used (struct iclass *ic, int clear_terminals) +{ + int i; + + ic->orphan = 0; + if (clear_terminals) + ic->terminal_resolved = 1; + + for (i=0;i < ic->nsubs;i++) + { + mark_used (ics[ic->subs[i]], clear_terminals); + } + for (i=0;i < ic->nxsubs;i++) + { + mark_used (ics[ic->xsubs[i]], clear_terminals); + } +} + +/* look up an instruction class; if CREATE make a new one if none found; + returns the index into the insn class array */ +static int +fetch_insn_class(const char *full_name, int create) +{ + char *name; + char *notestr; + char *xsect; + char *comment; + int i, note = 0; + int ind; + int is_class = 0; + + if (strncmp (full_name, "IC:", 3) == 0) + { + name = xstrdup (full_name + 3); + is_class = 1; + } + else + name = xstrdup (full_name); + + if ((xsect = strchr(name, '\\')) != NULL) + is_class = 1; + if ((comment = strchr(name, '[')) != NULL) + is_class = 1; + if ((notestr = strchr(name, '+')) != NULL) + is_class = 1; + + /* If it is a composite class, then ignore comments and notes that come after + the '\\', since they don't apply to the part we are decoding now. */ + if (xsect) + { + if (comment > xsect) + comment = 0; + if (notestr > xsect) + notestr = 0; + } + + if (notestr) + { + char *nextnotestr; + note = atoi (notestr + 1); + if ((nextnotestr = strchr (notestr + 1, '+')) != NULL) + { + if (strcmp (notestr, "+1+13") == 0) + note = 13; + else if (!xsect || nextnotestr < xsect) + fprintf (stderr, "Warning: multiple note %s not handled\n", + notestr); + } + } + + /* If it's a composite class, leave the notes and comments in place so that + we have a unique name for the composite class. Otherwise, we remove + them. */ + if (!xsect) + { + if (notestr) + *notestr = 0; + if (comment) + *comment = 0; + } + + for (i=0;i < iclen;i++) + if (strcmp(name, ics[i]->name) == 0 + && ((comment == NULL && ics[i]->comment == NULL) + || (comment != NULL && ics[i]->comment != NULL + && strncmp (ics[i]->comment, comment, + strlen (ics[i]->comment)) == 0)) + && note == ics[i]->note) + return i; + + if (!create) + return -1; + + /* doesn't exist, so make a new one */ + if (iclen == ictotlen) + { + ictotlen += 20; + ics = (struct iclass **) + xrealloc(ics, (ictotlen)*sizeof(struct iclass *)); + } + ind = iclen++; + ics[ind] = tmalloc(struct iclass); + memset((void *)ics[ind], 0, sizeof(struct iclass)); + ics[ind]->name = xstrdup(name); + ics[ind]->is_class = is_class; + ics[ind]->orphan = 1; + + if (comment) + { + ics[ind]->comment = xstrdup (comment + 1); + ics[ind]->comment[strlen(ics[ind]->comment)-1] = 0; + } + if (notestr) + ics[ind]->note = note; + + /* if it's a composite class, there's a comment or note, look for an + existing class or terminal with the same name. */ + if ((xsect || comment || notestr) && is_class) + { + /* First, populate with the class we're based on. */ + char *subname = name; + if (xsect) + *xsect = 0; + else if (comment) + *comment = 0; + else if (notestr) + *notestr = 0; + ics[ind]->nsubs = 1; + ics[ind]->subs = tmalloc(int); + ics[ind]->subs[0] = fetch_insn_class (subname, 1);; + } + + while (xsect) + { + char *subname = xsect + 1; + xsect = strchr (subname, '\\'); + if (xsect) + *xsect = 0; + ics[ind]->xsubs[ics[ind]->nxsubs] = fetch_insn_class (subname,1); + ics[ind]->nxsubs++; + } + free (name); + + return ind; +} + +/* for sorting a class's sub-class list only; make sure classes appear before + terminals */ +static int +sub_compare (const void *e1, const void *e2) +{ + struct iclass *ic1 = ics[*(int *)e1]; + struct iclass *ic2 = ics[*(int *)e2]; + + if (ic1->is_class) + { + if (!ic2->is_class) + return -1; + } + else if (ic2->is_class) + return 1; + + return strcmp (ic1->name, ic2->name); +} + +static void +load_insn_classes() +{ + FILE *fp = fopen("ia64-ic.tbl", "r"); + char buf[2048]; + + if (fp == NULL){ + fprintf (stderr, "Can't find ia64-ic.tbl for reading\n"); + exit(1); + } + + /* discard first line */ + fgets (buf, sizeof(buf), fp); + + while (!feof(fp)) + { + int iclass; + char *name; + char *tmp; + + if (fgets (buf, sizeof(buf), fp) == NULL) + break; + + while (isspace(buf[strlen(buf)-1])) + buf[strlen(buf)-1] = '\0'; + + name = tmp = buf; + while (*tmp != ';') + { + ++tmp; + if (tmp == buf + sizeof(buf)) + abort (); + } + *tmp++ = '\0'; + + iclass = fetch_insn_class(name, 1); + ics[iclass]->is_class = 1; + + if (strcmp (name, "none") == 0) + { + ics[iclass]->is_class = 0; + ics[iclass]->terminal_resolved = 1; + continue; + } + + /* for this class, record all sub-classes */ + while (*tmp) + { + char *subname; + int sub; + + while (*tmp && isspace(*tmp)) + { + ++tmp; + if (tmp == buf + sizeof(buf)) + abort(); + } + subname = tmp; + while (*tmp && *tmp != ',') + { + ++tmp; + if (tmp == buf + sizeof(buf)) + abort(); + } + if (*tmp == ',') + *tmp++ = '\0'; + + ics[iclass]->subs = (int *) + xrealloc((void *)ics[iclass]->subs, + (ics[iclass]->nsubs+1)*sizeof(int)); + + sub = fetch_insn_class(subname, 1); + ics[iclass]->subs = (int *) + xrealloc(ics[iclass]->subs, (ics[iclass]->nsubs+1)*sizeof(int)); + ics[iclass]->subs[ics[iclass]->nsubs++] = sub; + } + /* make sure classes come before terminals */ + qsort ((void *)ics[iclass]->subs, + ics[iclass]->nsubs, sizeof(int), sub_compare); + } + fclose(fp); + + if (debug) + { + printf ("%d classes\n", iclen); + } +} + +/* extract the insn classes from the given line */ +static void +parse_resource_users(ref, usersp, nusersp, notesp) + char *ref; + int **usersp; + int *nusersp; + int **notesp; +{ + int c; + char *line = xstrdup (ref); + char *tmp = line; + int *users = *usersp; + int count = *nusersp; + int *notes = *notesp; + + c = *tmp; + while (c != 0) + { + char *notestr; + int note; + char *xsect; + int iclass; + int create = 0; + char *name; + + while (isspace(*tmp)) + ++tmp; + name = tmp; + while (*tmp && *tmp != ',') + ++tmp; + c = *tmp; + *tmp++ = '\0'; + + xsect = strchr(name, '\\'); + if ((notestr = strstr(name, "+")) != NULL) + { + char *nextnotestr; + note = atoi (notestr + 1); + if ((nextnotestr = strchr (notestr + 1, '+')) != NULL) + { + /* note 13 always implies note 1 */ + if (strcmp (notestr, "+1+13") == 0) + note = 13; + else if (!xsect || nextnotestr < xsect) + fprintf (stderr, "Warning: multiple note %s not handled\n", + notestr); + } + if (!xsect) + *notestr = '\0'; + } + else + note = 0; + + /* All classes are created when the insn class table is parsed; + Individual instructions might not appear until the dependency tables + are read. Only create new classes if it's *not* an insn class, + or if it's a composite class (which wouldn't necessarily be in the IC + table). + */ + if (strncmp(name, "IC:", 3) != 0 || xsect != NULL) + create = 1; + + iclass = fetch_insn_class(name, create); + if (iclass != -1) + { + users = (int *) + xrealloc ((void *)users,(count+1)*sizeof(int)); + notes = (int *) + xrealloc ((void *)notes,(count+1)*sizeof(int)); + notes[count] = note; + users[count++] = iclass; + mark_used (ics[iclass], 0); + } + else + { + if (debug) + printf("Class %s not found\n", name); + } + } + /* update the return values */ + *usersp = users; + *nusersp = count; + *notesp = notes; + + free (line); +} + +static int +parse_semantics (char *sem) +{ + if (strcmp (sem, "none") == 0) + return IA64_DVS_NONE; + else if (strcmp (sem, "implied") == 0) + return IA64_DVS_IMPLIED; + else if (strcmp (sem, "impliedF") == 0) + return IA64_DVS_IMPLIEDF; + else if (strcmp (sem, "data") == 0) + return IA64_DVS_DATA; + else if (strcmp (sem, "instr") == 0) + return IA64_DVS_INSTR; + else if (strcmp (sem, "specific") == 0) + return IA64_DVS_SPECIFIC; + else if (strcmp (sem, "stop") == 0) + return IA64_DVS_STOP; + else + return IA64_DVS_OTHER; +} + +static void +add_dep (const char *name, const char *chk, const char *reg, + int semantics, int mode, char *extra, int flag) +{ + struct rdep *rs; + + rs = insert_resource (name, mode); + parse_resource_users (chk, &rs->chks, &rs->nchks, + &rs->chknotes); + parse_resource_users (reg, &rs->regs, &rs->nregs, + &rs->regnotes); + rs->semantics = semantics; + rs->extra = extra; + rs->waw_special = flag; +} + +static void +load_depfile (const char *filename, enum ia64_dependency_mode mode) +{ + FILE *fp = fopen(filename, "r"); + char buf[1024]; + + if (fp == NULL){ + fprintf (stderr, "Can't find %s for reading\n", filename); + exit(1); + } + + fgets(buf, sizeof(buf), fp); + while (!feof(fp)) + { + char *name, *tmp; + int semantics; + char *extra; + char *regp, *chkp; + + if (fgets (buf, sizeof(buf), fp) == NULL) + break; + + while (isspace(buf[strlen(buf)-1])) + buf[strlen(buf)-1] = '\0'; + + name = tmp = buf; + while (*tmp != ';') + ++tmp; + *tmp++ = '\0'; + + while (isspace (*tmp)) + ++tmp; + regp = tmp; + tmp = strchr (tmp, ';'); + if (!tmp) + abort (); + *tmp++ = 0; + while (isspace (*tmp)) + ++tmp; + chkp = tmp; + tmp = strchr (tmp, ';'); + if (!tmp) + abort (); + *tmp++ = 0; + while (isspace (*tmp)) + ++tmp; + semantics = parse_semantics (tmp); + extra = semantics == IA64_DVS_OTHER ? xstrdup (tmp) : NULL; + + /* For WAW entries, if the chks and regs differ, we need to enter the + entries in both positions so that the tables will be parsed properly, + without a lot of extra work */ + if (mode == IA64_DV_WAW && strcmp (regp, chkp) != 0) + { + add_dep (name, chkp, regp, semantics, mode, extra, 0); + add_dep (name, regp, chkp, semantics, mode, extra, 1); + } + else + { + add_dep (name, chkp, regp, semantics, mode, extra, 0); + } + } + fclose(fp); +} + +static void +load_dependencies() +{ + load_depfile ("ia64-raw.tbl", IA64_DV_RAW); + load_depfile ("ia64-waw.tbl", IA64_DV_WAW); + load_depfile ("ia64-war.tbl", IA64_DV_WAR); + + if (debug) + printf ("%d RAW/WAW/WAR dependencies\n", rdepslen); +} + +/* is the given operand an indirect register file operand? */ +static int +irf_operand (int op, const char *field) +{ + if (!field) + { + return op == IA64_OPND_RR_R3 || op == IA64_OPND_DBR_R3 + || op == IA64_OPND_IBR_R3 || op == IA64_OPND_PKR_R3 + || op == IA64_OPND_PMC_R3 || op == IA64_OPND_PMD_R3 + || op == IA64_OPND_MSR_R3 || op == IA64_OPND_CPUID_R3; + } + else + { + return ((op == IA64_OPND_RR_R3 && strstr (field, "rr")) + || (op == IA64_OPND_DBR_R3 && strstr (field, "dbr")) + || (op == IA64_OPND_IBR_R3 && strstr (field, "ibr")) + || (op == IA64_OPND_PKR_R3 && strstr (field, "pkr")) + || (op == IA64_OPND_PMC_R3 && strstr (field, "pmc")) + || (op == IA64_OPND_PMD_R3 && strstr (field, "pmd")) + || (op == IA64_OPND_MSR_R3 && strstr (field, "msr")) + || (op == IA64_OPND_CPUID_R3 && strstr (field, "cpuid"))); + } +} + +/* handle mov_ar, mov_br, mov_cr, mov_indirect, mov_ip, mov_pr, mov_psr, and + mov_um insn classes */ +static int +in_iclass_mov_x (struct ia64_opcode *idesc, struct iclass *ic, + const char *format, const char *field) +{ + int plain_mov = strcmp (idesc->name, "mov") == 0; + + if (!format) + return 0; + + switch (ic->name[4]) + { + default: + abort (); + case 'a': + { + int i = strcmp (idesc->name, "mov.i") == 0; + int m = strcmp (idesc->name, "mov.m") == 0; + int i2627 = i && idesc->operands[0] == IA64_OPND_AR3; + int i28 = i && idesc->operands[1] == IA64_OPND_AR3; + int m2930 = m && idesc->operands[0] == IA64_OPND_AR3; + int m31 = m && idesc->operands[1] == IA64_OPND_AR3; + int pseudo0 = plain_mov && idesc->operands[1] == IA64_OPND_AR3; + int pseudo1 = plain_mov && idesc->operands[0] == IA64_OPND_AR3; + + /* IC:mov ar */ + if (i2627) + return strstr (format, "I26") || strstr (format, "I27"); + if (i28) + return strstr (format, "I28") != NULL; + if (m2930) + return strstr (format, "M29") || strstr (format, "M30"); + if (m31) + return strstr (format, "M31") != NULL; + if (pseudo0 || pseudo1) + return 1; + } + break; + case 'b': + { + int i21 = idesc->operands[0] == IA64_OPND_B1; + int i22 = plain_mov && idesc->operands[1] == IA64_OPND_B2; + if (i22) + return strstr (format, "I22") != NULL; + if (i21) + return strstr (format, "I21") != NULL; + } + break; + case 'c': + { + int m32 = plain_mov && idesc->operands[0] == IA64_OPND_CR3; + int m33 = plain_mov && idesc->operands[1] == IA64_OPND_CR3; + if (m32) + return strstr (format, "M32") != NULL; + if (m33) + return strstr (format, "M33") != NULL; + } + break; + case 'i': + if (ic->name[5] == 'n') + { + int m42 = plain_mov && irf_operand (idesc->operands[0], field); + int m43 = plain_mov && irf_operand (idesc->operands[1], field); + if (m42) + return strstr (format, "M42") != NULL; + if (m43) + return strstr (format, "M43") != NULL; + } + else if (ic->name[5] == 'p') + { + return idesc->operands[1] == IA64_OPND_IP; + } + else + abort (); + break; + case 'p': + if (ic->name[5] == 'r') + { + int i25 = plain_mov && idesc->operands[1] == IA64_OPND_PR; + int i23 = plain_mov && idesc->operands[0] == IA64_OPND_PR; + int i24 = plain_mov && idesc->operands[0] == IA64_OPND_PR_ROT; + if (i23) + return strstr (format, "I23") != NULL; + if (i24) + return strstr (format, "I24") != NULL; + if (i25) + return strstr (format, "I25") != NULL; + } + else if (ic->name[5] == 's') + { + int m35 = plain_mov && idesc->operands[0] == IA64_OPND_PSR_L; + int m36 = plain_mov && idesc->operands[1] == IA64_OPND_PSR; + if (m35) + return strstr (format, "M35") != NULL; + if (m36) + return strstr (format, "M36") != NULL; + } + else + abort (); + break; + case 'u': + { + int m35 = plain_mov && idesc->operands[0] == IA64_OPND_PSR_UM; + int m36 = plain_mov && idesc->operands[1] == IA64_OPND_PSR_UM; + if (m35) + return strstr (format, "M35") != NULL; + if (m36) + return strstr (format, "M36") != NULL; + } + break; + } + return 0; +} + + +/* is the given opcode in the given insn class? */ +static int +in_iclass(struct ia64_opcode *idesc, struct iclass *ic, + const char *format, const char *field, int *notep) +{ + int i; + int resolved = 0; + + if (ic->comment) + { + if (!strncmp (ic->comment, "Format", 6)) + { + /* assume that the first format seen is the most restrictive, and + only keep a later one if it looks like it's more restrictive. */ + if (format) + { + if (strlen (ic->comment) < strlen (format)) + { + fprintf (stderr, "Warning: most recent format '%s'\n" + "appears more restrictive than '%s'\n", + ic->comment, format); + format = ic->comment; + } + } + else + format = ic->comment; + } + else if (!strncmp (ic->comment, "Field", 5)) + { + if (field) + fprintf (stderr, "Overlapping field %s->%s\n", + ic->comment, field); + field = ic->comment; + } + } + + /* an insn class matches anything that is the same followed by completers, + except when the absence and presence of completers constitutes different + instructions */ + if (ic->nsubs == 0 && ic->nxsubs == 0) + { + int is_mov = strncmp (idesc->name, "mov", 3) == 0; + int plain_mov = strcmp (idesc->name, "mov") == 0; + int len = strlen(ic->name); + + resolved = ((strncmp (ic->name, idesc->name, len) == 0) + && (idesc->name[len] == '\0' + || idesc->name[len] == '.')); + + /* all break and nop variations must match exactly */ + if (resolved && + (strcmp (ic->name, "break") == 0 + || strcmp (ic->name, "nop") == 0)) + resolved = strcmp (ic->name, idesc->name) == 0; + + /* assume restrictions in the FORMAT/FIELD negate resolution, + unless specifically allowed by clauses in this block */ + if (resolved && field) + { + /* check Field(sf)==sN against opcode sN */ + if (strstr(field, "(sf)==") != NULL) + { + char *sf; + if ((sf = strstr (idesc->name, ".s")) != 0) + { + resolved = strcmp (sf + 1, strstr (field, "==") + 2) == 0; + } + } + /* check Field(lftype)==XXX */ + else if (strstr (field, "(lftype)") != NULL) + { + if (strstr (idesc->name, "fault") != NULL) + resolved = strstr (field, "fault") != NULL; + else + resolved = strstr (field, "fault") == NULL; + } + /* handle Field(ctype)==XXX */ + else if (strstr (field, "(ctype)") != NULL) + { + if (strstr (idesc->name, "or.andcm")) + resolved = strstr (field, "or.andcm") != NULL; + else if (strstr (idesc->name, "and.orcm")) + resolved = strstr (field, "and.orcm") != NULL; + else if (strstr (idesc->name, "orcm")) + resolved = strstr (field, "or orcm") != NULL; + else if (strstr (idesc->name, "or")) + resolved = strstr (field, "or orcm") != NULL; + else if (strstr (idesc->name, "andcm")) + resolved = strstr (field, "and andcm") != NULL; + else if (strstr (idesc->name, "and")) + resolved = strstr (field, "and andcm") != NULL; + else if (strstr (idesc->name, "unc")) + resolved = strstr (field, "unc") != NULL; + else + resolved = strcmp (field, "Field(ctype)==") == 0; + } + } + if (resolved && format) + { + if (strncmp (idesc->name, "dep", 3) == 0 + && strstr (format, "I13") != NULL) + resolved = idesc->operands[1] == IA64_OPND_IMM8; + else if (strncmp (idesc->name, "chk", 3) == 0 + && strstr (format, "M21") != NULL) + resolved = idesc->operands[0] == IA64_OPND_F2; + else if (strncmp (idesc->name, "lfetch", 6) == 0) + resolved = (strstr (format, "M14 M15") != NULL + && (idesc->operands[1] == IA64_OPND_R2 + || idesc->operands[1] == IA64_OPND_IMM9b)); + else if (strncmp (idesc->name, "br.call", 7) == 0 + && strstr (format, "B5") != NULL) + resolved = idesc->operands[1] == IA64_OPND_B2; + else if (strncmp (idesc->name, "br.call", 7) == 0 + && strstr (format, "B3") != NULL) + resolved = idesc->operands[1] == IA64_OPND_TGT25c; + else if (strncmp (idesc->name, "brp", 3) == 0 + && strstr (format, "B7") != NULL) + resolved = idesc->operands[0] == IA64_OPND_B2; + else if (strcmp (ic->name, "invala") == 0) + resolved = strcmp (idesc->name, ic->name) == 0; + else if (strncmp (idesc->name, "st", 2) == 0 + && strstr (format, "M5") != NULL) + resolved = idesc->flags & IA64_OPCODE_POSTINC; + else + resolved = 0; + } + + /* misc brl variations ('.cond' is optional); + plain brl matches brl.cond */ + if (!resolved + && (strcmp (idesc->name, "brl") == 0 + || strncmp (idesc->name, "brl.", 4) == 0) + && strcmp (ic->name, "brl.cond") == 0) + { + resolved = 1; + } + + /* misc br variations ('.cond' is optional) */ + if (!resolved + && (strcmp (idesc->name, "br") == 0 + || strncmp (idesc->name, "br.", 3) == 0) + && strcmp (ic->name, "br.cond") == 0) + { + if (format) + resolved = (strstr (format, "B4") != NULL + && idesc->operands[0] == IA64_OPND_B2) + || (strstr (format, "B1") != NULL + && idesc->operands[0] == IA64_OPND_TGT25c); + else + resolved = 1; + } + + /* probe variations */ + if (!resolved && strncmp (idesc->name, "probe", 5) == 0) + { + resolved = strcmp (ic->name, "probe") == 0 + && !((strstr (idesc->name, "fault") != NULL) + ^ (format && strstr (format, "M40") != NULL)); + } + /* mov variations */ + if (!resolved && is_mov) + { + if (plain_mov) + { + /* mov alias for fmerge */ + if (strcmp (ic->name, "fmerge") == 0) + { + resolved = idesc->operands[0] == IA64_OPND_F1 + && idesc->operands[1] == IA64_OPND_F3; + } + /* mov alias for adds (r3 or imm14) */ + else if (strcmp (ic->name, "adds") == 0) + { + resolved = (idesc->operands[0] == IA64_OPND_R1 + && (idesc->operands[1] == IA64_OPND_R3 + || (idesc->operands[1] == IA64_OPND_IMM14))); + } + /* mov alias for addl */ + else if (strcmp (ic->name, "addl") == 0) + { + resolved = idesc->operands[0] == IA64_OPND_R1 + && idesc->operands[1] == IA64_OPND_IMM22; + } + } + /* some variants of mov and mov.[im] */ + if (!resolved && strncmp (ic->name, "mov_", 4) == 0) + { + resolved = in_iclass_mov_x (idesc, ic, format, field); + } + } + + /* keep track of this so we can flag any insn classes which aren't + mapped onto at least one real insn */ + if (resolved) + { + ic->terminal_resolved = 1; + } + } + else for (i=0;i < ic->nsubs;i++) + { + if (in_iclass(idesc, ics[ic->subs[i]], format, field, notep)) + { + int j; + for (j=0;j < ic->nxsubs;j++) + { + if (in_iclass(idesc, ics[ic->xsubs[j]], NULL, NULL, NULL)) + return 0; + } + if (debug > 1) + printf ("%s is in IC %s\n", + idesc->name, ic->name); + resolved = 1; + break; + } + } + + /* If it's in this IC, add the IC note (if any) to the insn */ + if (resolved) + { + if (ic->note && notep) + { + if (*notep && *notep != ic->note) + { + fprintf (stderr, "Warning: overwriting note %d with note %d" + "(IC:%s)\n", + *notep, ic->note, ic->name); + } + *notep = ic->note; + } + } + + return resolved; +} + + +static int +lookup_regindex (const char *name, int specifier) +{ + switch (specifier) + { + case IA64_RS_ARX: + if (strstr (name, "[RSC]")) + return 16; + if (strstr (name, "[BSP]")) + return 17; + else if (strstr (name, "[BSPSTORE]")) + return 18; + else if (strstr (name, "[RNAT]")) + return 19; + else if (strstr (name, "[CCV]")) + return 32; + else if (strstr (name, "[ITC]")) + return 44; + else if (strstr (name, "[PFS]")) + return 64; + else if (strstr (name, "[LC]")) + return 65; + else if (strstr (name, "[EC]")) + return 66; + abort (); + case IA64_RS_CRX: + if (strstr (name, "[DCR]")) + return 0; + else if (strstr (name, "[ITM]")) + return 1; + else if (strstr (name, "[IVA]")) + return 2; + else if (strstr (name, "[PTA]")) + return 8; + else if (strstr (name, "[GPTA]")) + return 9; + else if (strstr (name, "[IPSR]")) + return 16; + else if (strstr (name, "[ISR]")) + return 17; + else if (strstr (name, "[IIP]")) + return 19; + else if (strstr (name, "[IFA]")) + return 20; + else if (strstr (name, "[ITIR]")) + return 21; + else if (strstr (name, "[IIPA]")) + return 22; + else if (strstr (name, "[IFS]")) + return 23; + else if (strstr (name, "[IIM]")) + return 24; + else if (strstr (name, "[IHA]")) + return 25; + else if (strstr (name, "[LID]")) + return 64; + else if (strstr (name, "[IVR]")) + return 65; + else if (strstr (name, "[TPR]")) + return 66; + else if (strstr (name, "[EOI]")) + return 67; + else if (strstr (name, "[ITV]")) + return 72; + else if (strstr (name, "[PMV]")) + return 73; + else if (strstr (name, "[CMCV]")) + return 74; + abort (); + case IA64_RS_PSR: + if (strstr (name, ".be")) + return 1; + else if (strstr (name, ".up")) + return 2; + else if (strstr (name, ".ac")) + return 3; + else if (strstr (name, ".mfl")) + return 4; + else if (strstr (name, ".mfh")) + return 5; + else if (strstr (name, ".ic")) + return 13; + else if (strstr (name, ".i")) + return 14; + else if (strstr (name, ".pk")) + return 15; + else if (strstr (name, ".dt")) + return 17; + else if (strstr (name, ".dfl")) + return 18; + else if (strstr (name, ".dfh")) + return 19; + else if (strstr (name, ".sp")) + return 20; + else if (strstr (name, ".pp")) + return 21; + else if (strstr (name, ".di")) + return 22; + else if (strstr (name, ".si")) + return 23; + else if (strstr (name, ".db")) + return 24; + else if (strstr (name, ".lp")) + return 25; + else if (strstr (name, ".tb")) + return 26; + else if (strstr (name, ".rt")) + return 27; + else if (strstr (name, ".cpl")) + return 32; + else if (strstr (name, ".rs")) + return 34; + else if (strstr (name, ".mc")) + return 35; + else if (strstr (name, ".it")) + return 36; + else if (strstr (name, ".id")) + return 37; + else if (strstr (name, ".da")) + return 38; + else if (strstr (name, ".dd")) + return 39; + else if (strstr (name, ".ss")) + return 40; + else if (strstr (name, ".ri")) + return 41; + else if (strstr (name, ".ed")) + return 43; + else if (strstr (name, ".bn")) + return 44; + else if (strstr (name, ".ia")) + return 45; + else + abort (); + default: + break; + } + return REG_NONE; +} + +static int +lookup_specifier (const char *name) +{ + if (strchr (name, '%')) + { + if (strstr (name, "AR[K%]") != NULL) + return IA64_RS_AR_K; + if (strstr (name, "AR[UNAT]") != NULL) + return IA64_RS_AR_UNAT; + if (strstr (name, "AR%, % in 8") != NULL) + return IA64_RS_AR; + if (strstr (name, "AR%, % in 48") != NULL) + return IA64_RS_ARb; + if (strstr (name, "BR%") != NULL) + return IA64_RS_BR; + if (strstr (name, "CR[IRR%]") != NULL) + return IA64_RS_CR_IRR; + if (strstr (name, "CR[LRR%]") != NULL) + return IA64_RS_CR_LRR; + if (strstr (name, "CR%") != NULL) + return IA64_RS_CR; + if (strstr (name, "FR%, % in 0") != NULL) + return IA64_RS_FR; + if (strstr (name, "FR%, % in 2") != NULL) + return IA64_RS_FRb; + if (strstr (name, "GR%") != NULL) + return IA64_RS_GR; + if (strstr (name, "PR%, % in 1 ") != NULL) + return IA64_RS_PR; + if (strstr (name, "PR%, % in 16 ") != NULL) + return IA64_RS_PRr; + + fprintf (stderr, "Warning! Don't know how to specify %% dependency %s\n", + name); + } + else if (strchr (name, '#')) + { + if (strstr (name, "CPUID#") != NULL) + return IA64_RS_CPUID; + if (strstr (name, "DBR#") != NULL) + return IA64_RS_DBR; + if (strstr (name, "IBR#") != NULL) + return IA64_RS_IBR; + if (strstr (name, "MSR#") != NULL) + return IA64_RS_MSR; + if (strstr (name, "PKR#") != NULL) + return IA64_RS_PKR; + if (strstr (name, "PMC#") != NULL) + return IA64_RS_PMC; + if (strstr (name, "PMD#") != NULL) + return IA64_RS_PMD; + if (strstr (name, "RR#") != NULL) + return IA64_RS_RR; + + fprintf (stderr, "Warning! Don't know how to specify # dependency %s\n", + name); + } + else if (strncmp (name, "AR[FPSR]", 8) == 0) + return IA64_RS_AR_FPSR; + else if (strncmp (name, "AR[", 3) == 0) + return IA64_RS_ARX; + else if (strncmp (name, "CR[", 3) == 0) + return IA64_RS_CRX; + else if (strncmp (name, "PSR.", 4) == 0) + return IA64_RS_PSR; + else if (strcmp (name, "InService*") == 0) + return IA64_RS_INSERVICE; + else if (strcmp (name, "GR0") == 0) + return IA64_RS_GR0; + else if (strcmp (name, "CFM") == 0) + return IA64_RS_CFM; + else if (strcmp (name, "PR63") == 0) + return IA64_RS_PR63; + else if (strcmp (name, "RSE") == 0) + return IA64_RS_RSE; + + return IA64_RS_ANY; +} + +void +print_dependency_table () +{ + int i, j; + + if (debug) + { + for (i=0;i < iclen;i++) + { + if (ics[i]->is_class) + { + if (!ics[i]->nsubs) + { + fprintf (stderr, "Warning: IC:%s", ics[i]->name); + if (ics[i]->comment) + fprintf (stderr, "[%s]", ics[i]->comment); + fprintf (stderr, " has no terminals or sub-classes\n"); + } + } + else + { + if (!ics[i]->terminal_resolved && !ics[i]->orphan) + { + fprintf(stderr, "Warning: no insns mapped directly to " + "terminal IC %s", ics[i]->name); + if (ics[i]->comment) + fprintf(stderr, "[%s] ", ics[i]->comment); + fprintf(stderr, "\n"); + } + } + } + + for (i=0;i < iclen;i++) + { + if (ics[i]->orphan) + { + mark_used (ics[i], 1); + fprintf (stderr, "Warning: class %s is defined but not used\n", + ics[i]->name); + } + } + + if (debug > 1) for (i=0;i < rdepslen;i++) + { + static const char *mode_str[] = { "RAW", "WAW", "WAR" }; + if (rdeps[i]->total_chks == 0) + { + fprintf (stderr, "Warning: rsrc %s (%s) has no chks%s\n", + rdeps[i]->name, mode_str[rdeps[i]->mode], + rdeps[i]->total_regs ? "" : " or regs"); + } + else if (rdeps[i]->total_regs == 0) + { + fprintf (stderr, "Warning: rsrc %s (%s) has no regs\n", + rdeps[i]->name, mode_str[rdeps[i]->mode]); + } + } + } + + /* the dependencies themselves */ + printf ("static const struct ia64_dependency\ndependencies[] = {\n"); + for (i=0;i < rdepslen;i++) + { + /* '%', '#', AR[], CR[], or PSR. indicates we need to specify the actual + resource used */ + int specifier = lookup_specifier (rdeps[i]->name); + int regindex = lookup_regindex (rdeps[i]->name, specifier); + + printf (" { \"%s\", %d, %d, %d, %d, ", + rdeps[i]->name, specifier, + (int)rdeps[i]->mode, (int)rdeps[i]->semantics, regindex); + if (rdeps[i]->semantics == IA64_DVS_OTHER) + printf ("\"%s\", ", rdeps[i]->extra); + else + printf ("NULL, "); + printf("},\n"); + } + printf ("};\n\n"); + + /* and dependency lists */ + for (i=0;i < dlistlen;i++) + { + int len = 2; + printf ("static const short dep%d[] = {\n ", i); + for (j=0;j < dlists[i]->len; j++) + { + len += printf ("%d, ", dlists[i]->deps[j]); + if (len > 75) + { + printf("\n "); + len = 2; + } + } + printf ("\n};\n\n"); + } + + /* and opcode dependency list */ + printf ("#define NELS(X) (sizeof(X)/sizeof(X[0]))\n"); + printf ("static const struct ia64_opcode_dependency\n"); + printf ("op_dependencies[] = {\n"); + for (i=0;i < opdeplen;i++) + { + printf (" { "); + if (opdeps[i]->chk == -1) + printf ("0, NULL, "); + else + printf ("NELS(dep%d), dep%d, ", opdeps[i]->chk, opdeps[i]->chk); + if (opdeps[i]->reg == -1) + printf ("0, NULL, "); + else + printf ("NELS(dep%d), dep%d, ", opdeps[i]->reg, opdeps[i]->reg); + printf ("},\n"); + } + printf ("};\n\n"); +} + + +/* Add STR to the string table. */ + +static struct string_entry * +insert_string (str) + char *str; +{ + int start = 0, end = strtablen; + int i, x; + + if (strtablen == strtabtotlen) + { + strtabtotlen += 20; + string_table = (struct string_entry **) + xrealloc (string_table, + sizeof (struct string_entry **) * strtabtotlen); + } + + if (strtablen == 0) + { + strtablen = 1; + string_table[0] = tmalloc (struct string_entry); + string_table[0]->s = xstrdup (str); + string_table[0]->num = 0; + return string_table[0]; + } + + if (strcmp (str, string_table[strtablen - 1]->s) > 0) + { + i = end; + } + else if (strcmp (str, string_table[0]->s) < 0) + { + i = 0; + } + else + { + while (1) + { + int c; + + i = (start + end) / 2; + c = strcmp (str, string_table[i]->s); + if (c < 0) + { + end = i - 1; + } + else if (c == 0) + { + return string_table[i]; + } + else + { + start = i + 1; + } + if (start > end) + { + break; + } + } + } + for (; i > 0 && i < strtablen; i--) + { + if (strcmp (str, string_table[i - 1]->s) > 0) + { + break; + } + } + for (; i < strtablen; i++) + { + if (strcmp (str, string_table[i]->s) < 0) + { + break; + } + } + for (x = strtablen - 1; x >= i; x--) + { + string_table[x + 1] = string_table[x]; + string_table[x + 1]->num = x + 1; + } + string_table[i] = tmalloc (struct string_entry); + string_table[i]->s = xstrdup (str); + string_table[i]->num = i; + strtablen++; + return string_table[i]; +} + +struct bittree * +make_bittree_entry () +{ + struct bittree *res = tmalloc (struct bittree); + + res->disent = NULL; + res->bits[0] = NULL; + res->bits[1] = NULL; + res->bits[2] = NULL; + res->skip_flag = 0; + res->bits_to_skip = 0; + return res; +} + +struct disent * +add_dis_table_ent (which, insn, order, completer_index) + struct disent *which; + int insn; + int order; + int completer_index; +{ + int ci = 0; + struct disent *ent; + + if (which != NULL) + { + ent = which; + + ent->nextcnt++; + while (ent->nexte != NULL) + { + ent = ent->nexte; + } + ent = (ent->nexte = tmalloc (struct disent)); + } + else + { + ent = tmalloc (struct disent); + ent->next_ent = disinsntable; + disinsntable = ent; + which = ent; + } + ent->nextcnt = 0; + ent->nexte = NULL; + ent->insn = insn; + ent->priority = order; + + while (completer_index != 1) + { + ci = (ci << 1) | (completer_index & 1); + completer_index >>= 1; + } + ent->completer_index = ci; + return which; +} + +void +finish_distable () +{ + struct disent *ent = disinsntable; + struct disent *prev = ent; + + ent->ournum = 32768; + while ((ent = ent->next_ent) != NULL) + { + ent->ournum = prev->ournum + prev->nextcnt + 1; + prev = ent; + } +} + +void +insert_bit_table_ent (curr_ent, bit, opcode, mask, + opcodenum, order, completer_index) + struct bittree *curr_ent; + int bit; + ia64_insn opcode; + ia64_insn mask; + int opcodenum; + int order; + int completer_index; +{ + ia64_insn m; + int b; + struct bittree *next; + + if (bit == -1) + { + struct disent *nent = add_dis_table_ent (curr_ent->disent, + opcodenum, order, + completer_index); + curr_ent->disent = nent; + return; + } + + m = ((ia64_insn) 1) << bit; + + if (mask & m) + { + b = (opcode & m) ? 1 : 0; + } + else + { + b = 2; + } + next = curr_ent->bits[b]; + if (next == NULL) + { + next = make_bittree_entry (); + curr_ent->bits[b] = next; + } + insert_bit_table_ent (next, bit - 1, opcode, mask, opcodenum, order, + completer_index); +} + +void +add_dis_entry (first, opcode, mask, opcodenum, ent, completer_index) + struct bittree *first; + ia64_insn opcode; + ia64_insn mask; + int opcodenum; + struct completer_entry *ent; + int completer_index; +{ + if (completer_index & (1 << 20)) + { + abort (); + } + + while (ent != NULL) + { + ia64_insn newopcode = (opcode & (~ ent->mask)) | ent->bits; + add_dis_entry (first, newopcode, mask, opcodenum, ent->addl_entries, + (completer_index << 1) | 1); + if (ent->is_terminal) + { + insert_bit_table_ent (bittree, 40, newopcode, mask, + opcodenum, opcode_count - ent->order - 1, + (completer_index << 1) | 1); + } + completer_index <<= 1; + ent = ent->alternative; + } +} + +/* This optimization pass combines multiple "don't care" nodes. */ +void +compact_distree (ent) + struct bittree *ent; +{ +#define IS_SKIP(ent) \ + ((ent->bits[2] !=NULL) \ + && (ent->bits[0] == NULL && ent->bits[1] == NULL && ent->skip_flag == 0)) + + int bitcnt = 0; + struct bittree *nent = ent; + int x; + + while (IS_SKIP (nent)) + { + bitcnt++; + nent = nent->bits[2]; + } + + if (bitcnt) + { + struct bittree *next = ent->bits[2]; + + ent->bits[0] = nent->bits[0]; + ent->bits[1] = nent->bits[1]; + ent->bits[2] = nent->bits[2]; + ent->disent = nent->disent; + ent->skip_flag = 1; + ent->bits_to_skip = bitcnt; + while (next != nent) + { + struct bittree *b = next; + next = next->bits[2]; + free (b); + } + free (nent); + } + + for (x = 0; x < 3; x++) + { + struct bittree *i = ent->bits[x]; + if (i != NULL) + { + compact_distree (i); + } + } +} + +static unsigned char *insn_list; +static int insn_list_len = 0; +static int tot_insn_list_len = 0; + +/* Generate the disassembler state machine corresponding to the tree + in ENT. */ +void +gen_dis_table (ent) + struct bittree *ent; +{ + int x; + int our_offset = insn_list_len; + int bitsused = 5; + int totbits = bitsused; + int needed_bytes; + int zero_count = 0; + int zero_dest = 0; /* initialize this with 0 to keep gcc quiet... */ + + /* If this is a terminal entry, there's no point in skipping any + bits. */ + if (ent->skip_flag && ent->bits[0] == NULL && ent->bits[1] == NULL && + ent->bits[2] == NULL) + { + if (ent->disent == NULL) + { + abort (); + } + else + { + ent->skip_flag = 0; + } + } + + /* Calculate the amount of space needed for this entry, or at least + a conservatively large approximation. */ + if (ent->skip_flag) + { + totbits += 5; + } + for (x = 1; x < 3; x++) + { + if (ent->bits[x] != NULL) + { + totbits += 16; + } + } + + if (ent->disent != NULL) + { + if (ent->bits[2] != NULL) + { + abort (); + } + totbits += 16; + } + + /* Now allocate the space. */ + needed_bytes = (totbits + 7) / 8; + if ((needed_bytes + insn_list_len) > tot_insn_list_len) + { + tot_insn_list_len += 256; + insn_list = (char *) xrealloc (insn_list, tot_insn_list_len); + } + our_offset = insn_list_len; + insn_list_len += needed_bytes; + memset (insn_list + our_offset, 0, needed_bytes); + + /* Encode the skip entry by setting bit 6 set in the state op field, + and store the # of bits to skip immediately after. */ + if (ent->skip_flag) + { + bitsused += 5; + insn_list[our_offset + 0] |= 0x40 | ((ent->bits_to_skip >> 2) & 0xf); + insn_list[our_offset + 1] |= ((ent->bits_to_skip & 3) << 6); + } + +#define IS_ONLY_IFZERO(ENT) \ + ((ENT)->bits[0] != NULL && (ENT)->bits[1] == NULL && (ENT)->bits[2] == NULL \ + && (ENT)->disent == NULL && (ENT)->skip_flag == 0) + + /* Store an "if (bit is zero)" instruction by setting bit 7 in the + state op field. */ + + if (ent->bits[0] != NULL) + { + struct bittree *nent = ent->bits[0]; + zero_count = 0; + + insn_list[our_offset] |= 0x80; + + /* We can encode sequences of multiple "if (bit is zero)" tests + by storing the # of zero bits to check in the lower 3 bits of + the instruction. However, this only applies if the state + solely tests for a zero bit. */ + + if (IS_ONLY_IFZERO (ent)) + { + while (IS_ONLY_IFZERO (nent) && zero_count < 7) + { + nent = nent->bits[0]; + zero_count++; + } + + insn_list[our_offset + 0] |= zero_count; + } + zero_dest = insn_list_len; + gen_dis_table (nent); + } + + /* Now store the remaining tests. We also handle a sole "termination + entry" by storing it as an "any bit" test. */ + + for (x = 1; x < 3; x++) + { + if (ent->bits[x] != NULL || (x == 2 && ent->disent != NULL)) + { + struct bittree *i = ent->bits[x]; + int idest; + int currbits = 15; + + if (i != NULL) + { + /* If the instruction being branched to only consists of + a termination entry, use the termination entry as the + place to branch to instead. */ + if (i->bits[0] == NULL && i->bits[1] == NULL + && i->bits[2] == NULL && i->disent != NULL) + { + idest = i->disent->ournum; + i = NULL; + } + else + { + idest = insn_list_len - our_offset; + } + } + else + { + idest = ent->disent->ournum; + } + + /* If the destination offset for the if (bit is 1) test is less + than 256 bytes away, we can store it as 8-bits instead of 16; + the instruction has bit 5 set for the 16-bit address, and bit + 4 for the 8-bit address. Since we've already allocated 16 + bits for the address we need to deallocate the space. + + Note that branchings within the table are relative, and + there are no branches that branch past our instruction yet + so we do not need to adjust any other offsets. */ + + if (x == 1) + { + if (idest <= 256) + { + int start = our_offset + bitsused / 8 + 1; + + memmove (insn_list + start, + insn_list + start + 1, + insn_list_len - (start + 1)); + currbits = 7; + totbits -= 8; + needed_bytes--; + insn_list_len--; + insn_list[our_offset] |= 0x10; + idest--; + } + else + { + insn_list[our_offset] |= 0x20; + } + } + else + { + /* An instruction which solely consists of a termination + marker and whose disassembly name index is < 4096 + can be stored in 16 bits. The encoding is slightly + odd; the upper 4 bits of the instruction are 0x3, and + bit 3 loses its normal meaning. */ + + if (ent->bits[0] == NULL && ent->bits[1] == NULL + && ent->bits[2] == NULL && ent->skip_flag == 0 + && ent->disent != NULL + && ent->disent->ournum < (32768 + 4096)) + { + int start = our_offset + bitsused / 8 + 1; + + memmove (insn_list + start, + insn_list + start + 1, + insn_list_len - (start + 1)); + currbits = 11; + totbits -= 5; + bitsused--; + needed_bytes--; + insn_list_len--; + insn_list[our_offset] |= 0x30; + idest &= ~32768; + } + else + { + insn_list[our_offset] |= 0x08; + } + } + if (debug) + { + int id = idest; + + if (i == NULL) + { + id |= 32768; + } + else if (! (id & 32768)) + { + id += our_offset; + } + if (x == 1) + { + printf ("%d: if (1) goto %d\n", our_offset, id); + } + else + { + printf ("%d: try %d\n", our_offset, id); + } + } + + /* Store the address of the entry being branched to. */ + while (currbits >= 0) + { + char *byte = insn_list + our_offset + bitsused / 8; + + if (idest & (1 << currbits)) + { + *byte |= (1 << (7 - (bitsused % 8))); + } + bitsused++; + currbits--; + } + + /* Now generate the states for the entry being branched to. */ + if (i != NULL) + { + gen_dis_table (i); + } + + } + } + if (debug) + { + if (ent->skip_flag) + { + printf ("%d: skipping %d\n", our_offset, ent->bits_to_skip); + } + + if (ent->bits[0] != NULL) + { + printf ("%d: if (0:%d) goto %d\n", our_offset, zero_count + 1, + zero_dest); + } + } + if (bitsused != totbits) + { + abort (); + } +} + +void +print_dis_table () +{ + int x; + struct disent *cent = disinsntable; + + printf ("static const char dis_table[] = {\n"); + for (x = 0; x < insn_list_len; x++) + { + if ((x > 0) && ((x % 12) == 0)) + { + printf ("\n"); + } + printf ("0x%02x, ", insn_list[x]); + } + printf ("\n};\n\n"); + + printf ("static const struct ia64_dis_names ia64_dis_names[] = {\n"); + while (cent != NULL) + { + struct disent *ent = cent; + + while (ent != NULL) + { + printf ("{ 0x%x, %d, %d, %d },\n", ent->completer_index, + ent->insn, (ent->nexte != NULL ? 1 : 0), + ent->priority); + ent = ent->nexte; + } + cent = cent->next_ent; + } + printf ("};\n\n"); +} + +void +generate_disassembler () +{ + int i; + + bittree = make_bittree_entry (); + + for (i=0; i < otlen;i++) + { + struct main_entry *ptr = ordered_table[i]; + + if (ptr->opcode->type != IA64_TYPE_DYN) + { + add_dis_entry (bittree, + ptr->opcode->opcode, ptr->opcode->mask, + ptr->main_index, + ptr->completers, 1); + } + } + + compact_distree (bittree); + finish_distable (); + gen_dis_table (bittree); + + print_dis_table (); +} + +void +print_string_table () +{ + int x; + char lbuf[80], buf[80]; + int blen = 0; + + printf ("static const char *ia64_strings[] = {\n"); + lbuf[0] = '\0'; + for (x = 0; x < strtablen; x++) + { + int len; + + if (strlen (string_table[x]->s) > 75) + { + abort (); + } + sprintf (buf, " \"%s\",", string_table[x]->s); + len = strlen (buf); + if ((blen + len) > 75) + { + printf (" %s\n", lbuf); + lbuf[0] = '\0'; + blen = 0; + } + strcat (lbuf, buf); + blen += len; + } + if (blen > 0) + { + printf (" %s\n", lbuf); + } + printf ("};\n\n"); +} + +static struct completer_entry **glist; +static int glistlen = 0; +static int glisttotlen = 0; + +/* If the completer trees ENT1 and ENT2 are equal, return 1. */ + +int +completer_entries_eq (ent1, ent2) + struct completer_entry *ent1, *ent2; +{ + while (ent1 != NULL && ent2 != NULL) + { + if (ent1->name->num != ent2->name->num + || ent1->bits != ent2->bits + || ent1->mask != ent2->mask + || ent1->is_terminal != ent2->is_terminal + || ent1->dependencies != ent2->dependencies + || ent1->order != ent2->order) + { + return 0; + } + if (! completer_entries_eq (ent1->addl_entries, ent2->addl_entries)) + { + return 0; + } + ent1 = ent1->alternative; + ent2 = ent2->alternative; + } + return ent1 == ent2; +} + +/* Insert ENT into the global list of completers and return it. If an + equivalent entry (according to completer_entries_eq) already exists, + it is returned instead. */ +struct completer_entry * +insert_gclist (ent) + struct completer_entry *ent; +{ + if (ent != NULL) + { + int i; + int x; + int start = 0, end; + + ent->addl_entries = insert_gclist (ent->addl_entries); + ent->alternative = insert_gclist (ent->alternative); + + i = glistlen / 2; + end = glistlen; + + if (glisttotlen == glistlen) + { + glisttotlen += 20; + glist = (struct completer_entry **) + xrealloc (glist, sizeof (struct completer_entry *) * glisttotlen); + } + + if (glistlen == 0) + { + glist[0] = ent; + glistlen = 1; + return ent; + } + + if (ent->name->num < glist[0]->name->num) + { + i = 0; + } + else if (ent->name->num > glist[end - 1]->name->num) + { + i = end; + } + else + { + int c; + + while (1) + { + i = (start + end) / 2; + c = ent->name->num - glist[i]->name->num; + if (c < 0) + { + end = i - 1; + } + else if (c == 0) + { + while (i > 0 + && ent->name->num == glist[i - 1]->name->num) + { + i--; + } + break; + } + else + { + start = i + 1; + } + if (start > end) + { + break; + } + } + if (c == 0) + { + while (i < glistlen) + { + if (ent->name->num != glist[i]->name->num) + { + break; + } + if (completer_entries_eq (ent, glist[i])) + { + return glist[i]; + } + i++; + } + } + } + for (; i > 0 && i < glistlen; i--) + { + if (ent->name->num >= glist[i - 1]->name->num) + { + break; + } + } + for (; i < glistlen; i++) + { + if (ent->name->num < glist[i]->name->num) + { + break; + } + } + for (x = glistlen - 1; x >= i; x--) + { + glist[x + 1] = glist[x]; + } + glist[i] = ent; + glistlen++; + } + return ent; +} + +static int +get_prefix_len (name) + const char *name; +{ + char *c; + + if (name[0] == '\0') + { + return 0; + } + + c = strchr (name, '.'); + if (c != NULL) + { + return c - name; + } + else + { + return strlen (name); + } +} + +static void +compute_completer_bits (ment, ent) + struct main_entry *ment; + struct completer_entry *ent; +{ + while (ent != NULL) + { + compute_completer_bits (ment, ent->addl_entries); + + if (ent->is_terminal) + { + ia64_insn mask = 0; + ia64_insn our_bits = ent->bits; + struct completer_entry *p = ent->parent; + ia64_insn p_bits; + int x; + + while (p != NULL && ! p->is_terminal) + { + p = p->parent; + } + + if (p != NULL) + { + p_bits = p->bits; + } + else + { + p_bits = ment->opcode->opcode; + } + + for (x = 0; x < 64; x++) + { + ia64_insn m = ((ia64_insn) 1) << x; + if ((p_bits & m) != (our_bits & m)) + { + mask |= m; + } + else + { + our_bits &= ~m; + } + } + ent->bits = our_bits; + ent->mask = mask; + } + else + { + ent->bits = 0; + ent->mask = 0; + } + + ent = ent->alternative; + } +} + +/* Find identical completer trees that are used in different + instructions and collapse their entries. */ +void +collapse_redundant_completers () +{ + struct main_entry *ptr; + int x; + + for (ptr = maintable; ptr != NULL; ptr = ptr->next) + { + if (ptr->completers == NULL) + { + abort (); + } + compute_completer_bits (ptr, ptr->completers); + ptr->completers = insert_gclist (ptr->completers); + } + + /* The table has been finalized, now number the indexes. */ + for (x = 0; x < glistlen; x++) + { + glist[x]->num = x; + } +} + + +/* attach two lists of dependencies to each opcode. + 1) all resources which, when already marked in use, conflict with this + opcode (chks) + 2) all resources which must be marked in use when this opcode is used + (regs) +*/ +int +insert_opcode_dependencies (opc, cmp) + struct ia64_opcode *opc; + struct completer_entry *cmp ATTRIBUTE_UNUSED; +{ + /* note all resources which point to this opcode. rfi has the most chks + (79) and cmpxchng has the most regs (54) so 100 here should be enough */ + int i; + int nregs = 0; + unsigned short regs[256]; + int nchks = 0; + unsigned short chks[256]; + /* flag insns for which no class matched; there should be none */ + int no_class_found = 1; + + for (i=0;i < rdepslen;i++) + { + struct rdep *rs = rdeps[i]; + int j; + + if (strcmp (opc->name, "cmp.eq.and") == 0 + && strncmp (rs->name, "PR%", 3) == 0 + && rs->mode == 1) + no_class_found = 99; + + for (j=0; j < rs->nregs;j++) + { + int ic_note = 0; + + if (in_iclass (opc, ics[rs->regs[j]], NULL, NULL, &ic_note)) + { + /* We can ignore ic_note 11 for non PR resources */ + if (ic_note == 11 && strncmp (rs->name, "PR", 2) != 0) + ic_note = 0; + + if (ic_note != 0 && rs->regnotes[j] != 0 + && ic_note != rs->regnotes[j] + && !(ic_note == 11 && rs->regnotes[j] == 1)) + fprintf (stderr, "Warning: IC note %d in opcode %s (IC:%s)" + " conflicts with resource %s note %d\n", + ic_note, opc->name, ics[rs->regs[j]]->name, + rs->name, rs->regnotes[j]); + /* Instruction class notes override resource notes. + So far, only note 11 applies to an IC instead of a resource, + and note 11 implies note 1. + */ + if (ic_note) + regs[nregs++] = RDEP(ic_note, i); + else + regs[nregs++] = RDEP(rs->regnotes[j], i); + no_class_found = 0; + ++rs->total_regs; + } + } + for (j=0;j < rs->nchks;j++) + { + int ic_note = 0; + + if (in_iclass (opc, ics[rs->chks[j]], NULL, NULL, &ic_note)) + { + /* We can ignore ic_note 11 for non PR resources */ + if (ic_note == 11 && strncmp (rs->name, "PR", 2) != 0) + ic_note = 0; + + if (ic_note != 0 && rs->chknotes[j] != 0 + && ic_note != rs->chknotes[j] + && !(ic_note == 11 && rs->chknotes[j] == 1)) + fprintf (stderr, "Warning: IC note %d for opcode %s (IC:%s)" + " conflicts with resource %s note %d\n", + ic_note, opc->name, ics[rs->chks[j]]->name, + rs->name, rs->chknotes[j]); + if (ic_note) + chks[nchks++] = RDEP(ic_note, i); + else + chks[nchks++] = RDEP(rs->chknotes[j], i); + no_class_found = 0; + ++rs->total_chks; + } + } + } + + if (no_class_found) + fprintf (stderr, "Warning: opcode %s has no class (ops %d %d %d)\n", + opc->name, + opc->operands[0], opc->operands[1], opc->operands[2]); + + return insert_dependencies (nchks, chks, nregs, regs); +} + +void +insert_completer_entry (opc, tabent, order) + struct ia64_opcode *opc; + struct main_entry *tabent; + int order; +{ + struct completer_entry **ptr = &tabent->completers; + struct completer_entry *parent = NULL; + char pcopy[129], *prefix; + int at_end = 0; + + if (strlen (opc->name) > 128) + { + abort (); + } + strcpy (pcopy, opc->name); + prefix = pcopy + get_prefix_len (pcopy); + if (prefix[0] != '\0') + { + prefix++; + } + + while (! at_end) + { + int need_new_ent = 1; + int plen = get_prefix_len (prefix); + struct string_entry *sent; + + at_end = (prefix[plen] == '\0'); + prefix[plen] = '\0'; + sent = insert_string (prefix); + + while (*ptr != NULL) + { + int cmpres = sent->num - (*ptr)->name->num; + + if (cmpres == 0) + { + need_new_ent = 0; + break; + } + else + { + ptr = &((*ptr)->alternative); + } + } + if (need_new_ent) + { + struct completer_entry *nent = tmalloc (struct completer_entry); + nent->name = sent; + nent->parent = parent; + nent->addl_entries = NULL; + nent->alternative = *ptr; + *ptr = nent; + nent->is_terminal = 0; + nent->dependencies = -1; + } + + if (! at_end) + { + parent = *ptr; + ptr = &((*ptr)->addl_entries); + prefix += plen + 1; + } + } + + if ((*ptr)->is_terminal) + { + abort (); + } + + (*ptr)->is_terminal = 1; + (*ptr)->mask = (ia64_insn)-1; + (*ptr)->bits = opc->opcode; + (*ptr)->dependencies = insert_opcode_dependencies (opc, *ptr); + (*ptr)->order = order; +} + +void +print_completer_entry (ent) + struct completer_entry *ent; +{ + int moffset = 0; + ia64_insn mask = ent->mask, bits = ent->bits; + + if (mask != 0) + { + while (! (mask & 1)) + { + moffset++; + mask = mask >> 1; + bits = bits >> 1; + } + if (bits & 0xffffffff00000000LL) + { + abort (); + } + } + + printf (" { 0x%x, 0x%x, %d, %d, %d, %d, %d, %d },\n", + (int)bits, + (int)mask, + ent->name->num, + ent->alternative != NULL ? ent->alternative->num : -1, + ent->addl_entries != NULL ? ent->addl_entries->num : -1, + moffset, + ent->is_terminal ? 1 : 0, + ent->dependencies); +} + +void +print_completer_table () +{ + int x; + + printf ("static const struct ia64_completer_table\ncompleter_table[] = {\n"); + for (x = 0; x < glistlen; x++) + { + print_completer_entry (glist[x]); + } + printf ("};\n\n"); +} + +int +opcodes_eq (opc1, opc2) + struct ia64_opcode *opc1; + struct ia64_opcode *opc2; +{ + int x; + int plen1, plen2; + + if ((opc1->mask != opc2->mask) || (opc1->type != opc2->type) + || (opc1->num_outputs != opc2->num_outputs) + || (opc1->flags != opc2->flags)) + { + return 0; + } + for (x = 0; x < 5; x++) + { + if (opc1->operands[x] != opc2->operands[x]) + { + return 0; + } + } + plen1 = get_prefix_len (opc1->name); + plen2 = get_prefix_len (opc2->name); + if (plen1 == plen2 && (memcmp (opc1->name, opc2->name, plen1) == 0)) + { + return 1; + } + return 0; +} + +void +add_opcode_entry (opc) + struct ia64_opcode *opc; +{ + struct main_entry **place; + struct string_entry *name; + char prefix[129]; + int found_it = 0; + + if (strlen (opc->name) > 128) + { + abort (); + } + place = &maintable; + strcpy (prefix, opc->name); + prefix[get_prefix_len (prefix)] = '\0'; + name = insert_string (prefix); + + /* Walk the list of opcode table entries. If it's a new + instruction, allocate and fill in a new entry. Note + the main table is alphabetical by opcode name. */ + + while (*place != NULL) + { + if ((*place)->name->num == name->num + && opcodes_eq ((*place)->opcode, opc)) + { + found_it = 1; + break; + } + if ((*place)->name->num > name->num) + { + break; + } + place = &((*place)->next); + } + if (! found_it) + { + struct main_entry *nent = tmalloc (struct main_entry); + + nent->name = name; + nent->opcode = opc; + nent->next = *place; + nent->completers = 0; + *place = nent; + + if (otlen == ottotlen) + { + ottotlen += 20; + ordered_table = (struct main_entry **) + xrealloc (ordered_table, sizeof (struct main_entry *) * ottotlen); + } + ordered_table[otlen++] = nent; + } + + insert_completer_entry (opc, *place, opcode_count++); +} + +void +print_main_table () +{ + struct main_entry *ptr = maintable; + int index = 0; + + printf ("static const struct ia64_main_table\nmain_table[] = {\n"); + while (ptr != NULL) + { + printf (" { %d, %d, %d, 0x", + ptr->name->num, + ptr->opcode->type, + ptr->opcode->num_outputs); + fprintf_vma (stdout, ptr->opcode->opcode); + printf ("ull, 0x"); + fprintf_vma (stdout, ptr->opcode->mask); + printf ("ull, { %d, %d, %d, %d, %d }, 0x%x, %d, },\n", + ptr->opcode->operands[0], + ptr->opcode->operands[1], + ptr->opcode->operands[2], + ptr->opcode->operands[3], + ptr->opcode->operands[4], + ptr->opcode->flags, + ptr->completers->num); + + ptr->main_index = index++; + + ptr = ptr->next; + } + printf ("};\n\n"); +} + +void +shrink (table) + struct ia64_opcode *table; +{ + int curr_opcode; + + for (curr_opcode = 0; table[curr_opcode].name != NULL; curr_opcode++) + { + add_opcode_entry (table + curr_opcode); + } +} + +int +main (argc, argv) + int argc; + char **argv ATTRIBUTE_UNUSED; +{ + if (argc > 1) + { + debug = 1; + } + + load_insn_classes(); + load_dependencies(); + + shrink (ia64_opcodes_a); + shrink (ia64_opcodes_b); + shrink (ia64_opcodes_f); + shrink (ia64_opcodes_i); + shrink (ia64_opcodes_m); + shrink (ia64_opcodes_x); + shrink (ia64_opcodes_d); + + collapse_redundant_completers (); + + printf ("/* This file is automatically generated by ia64-gen. Do not edit! */\n"); + print_string_table (); + print_dependency_table (); + print_completer_table (); + print_main_table (); + + generate_disassembler (); + + exit (0); +} diff --git a/contrib/binutils/opcodes/ia64-ic.tbl b/contrib/binutils/opcodes/ia64-ic.tbl new file mode 100644 index 0000000..115a276 --- /dev/null +++ b/contrib/binutils/opcodes/ia64-ic.tbl @@ -0,0 +1,234 @@ +Class; Events/Instructions +all; IC:predicatable-instructions, IC:unpredicatable-instructions +branches; IC:indirect-brs, IC:ip-rel-brs +cfm-readers; IC:fr-readers, IC:fr-writers, IC:gr-readers, IC:gr-writers, IC:mod-sched-brs, IC:predicatable-instructions, IC:pr-writers, alloc, br.call, brl.call, br.ret, cover, loadrs, rfi, IC:chk-a, invala.e +chk-a; chk.a.clr, chk.a.nc +cmpxchg; cmpxchg1, cmpxchg2, cmpxchg4, cmpxchg8 +czx; czx1, czx2 +fcmp-s0; fcmp[Field(sf)==s0] +fcmp-s1; fcmp[Field(sf)==s1] +fcmp-s2; fcmp[Field(sf)==s2] +fcmp-s3; fcmp[Field(sf)==s3] +fetchadd; fetchadd4, fetchadd8 +fp-arith; fadd, famax, famin, fcvt.fx, fcvt.fxu, fcvt.xuf, fma, fmax, fmin, fmpy, fms, fnma, fnmpy, fnorm, fpamax, fpamin, fpcvt.fx, fpcvt.fxu, fpma, fpmax, fpmin, fpmpy, fpms, fpnma, fpnmpy, fprcpa, fprsqrta, frcpa, frsqrta, fsub +fp-arith-s0; IC:fp-arith[Field(sf)==s0] +fp-arith-s1; IC:fp-arith[Field(sf)==s1] +fp-arith-s2; IC:fp-arith[Field(sf)==s2] +fp-arith-s3; IC:fp-arith[Field(sf)==s3] +fp-non-arith; fabs, fand, fandcm, fclass, fcvt.xf, fmerge, fmix, fneg, fnegabs, for, fpabs, fpmerge, fpack, fpneg, fpnegabs, fselect, fswap, fsxt, fxor, xma +fpcmp-s0; fpcmp[Field(sf)==s0] +fpcmp-s1; fpcmp[Field(sf)==s1] +fpcmp-s2; fpcmp[Field(sf)==s2] +fpcmp-s3; fpcmp[Field(sf)==s3] +fr-readers; IC:fp-arith, IC:fp-non-arith, IC:pr-writers-fp, chk.s[Format in {M21}], getf +fr-writers; IC:fp-arith, IC:fp-non-arith\fclass, IC:mem-readers-fp, setf +gr-readers; IC:gr-readers-writers, IC:mem-readers, IC:mem-writers, chk.s, cmp, cmp4, fc, itc.i, itc.d, itr.i, itr.d, IC:mov-to-AR-gr, IC:mov-to-BR, IC:mov-to-CR, IC:mov-to-IND, IC:mov-from-IND, IC:mov-to-PR-allreg, IC:mov-to-PSR-l, IC:mov-to-PSR-um, IC:probe-all, ptc.e, ptc.g, ptc.ga, ptc.l, ptr.i, ptr.d, setf, tbit, tnat +gr-readers-writers; IC:mov-from-IND, add, addl, addp4, adds, and, andcm, IC:czx, dep\dep[Format in {I13}], extr, IC:mem-readers-int, IC:ld-all-postinc, IC:lfetch-postinc, IC:mix, IC:mux, or, IC:pack, IC:padd, IC:pavg, IC:pavgsub, IC:pcmp, IC:pmax, IC:pmin, IC:pmpy, IC:pmpyshr, popcnt, IC:probe-nofault, IC:psad, IC:pshl, IC:pshladd, IC:pshr, IC:pshradd, IC:psub, shl, shladd, shladdp4, shr, shrp, IC:st-postinc, sub, IC:sxt, tak, thash, tpa, ttag, IC:unpack, xor, IC:zxt +gr-writers; alloc, dep, getf, IC:gr-readers-writers, IC:mem-readers-int, IC:mov-from-AR, IC:mov-from-BR, IC:mov-from-CR, IC:mov-from-PR, IC:mov-from-PSR, IC:mov-from-PSR-um, IC:mov-ip, movl +indirect-brp; brp[Format in {B7}] +indirect-brs; br.call[Format in {B5}], br.cond[Format in {B4}], br.ia, br.ret +invala-all; invala[Format in {M24}], invala.e +ip-rel-brs; IC:mod-sched-brs, br.call[Format in {B3}], brl.call, brl.cond, br.cond[Format in {B1}], br.cloop +ld; ld1, ld2, ld4, ld8, ld8.fill +ld-a; ld1.a, ld2.a, ld4.a, ld8.a +ld-all-postinc; IC:ld[Format in {M2 M3}], IC:ldfp[Format in {M12}], IC:ldf[Format in {M7 M8}] +ld-c; IC:ld-c-nc, IC:ld-c-clr +ld-c-clr; ld1.c.clr, ld2.c.clr, ld4.c.clr, ld8.c.clr, IC:ld-c-clr-acq +ld-c-clr-acq; ld1.c.clr.acq, ld2.c.clr.acq, ld4.c.clr.acq, ld8.c.clr.acq +ld-c-nc; ld1.c.nc, ld2.c.nc, ld4.c.nc, ld8.c.nc +ld-s; ld1.s, ld2.s, ld4.s, ld8.s +ld-sa; ld1.sa, ld2.sa, ld4.sa, ld8.sa +ldf; ldfs, ldfd, ldfe, ldf8, ldf.fill +ldf-a; ldfs.a, ldfd.a, ldfe.a, ldf8.a +ldf-c; IC:ldf-c-nc, IC:ldf-c-clr +ldf-c-clr; ldfs.c.clr, ldfd.c.clr, ldfe.c.clr, ldf8.c.clr +ldf-c-nc; ldfs.c.nc, ldfd.c.nc, ldfe.c.nc, ldf8.c.nc +ldf-s; ldfs.s, ldfd.s, ldfe.s, ldf8.s +ldf-sa; ldfs.sa, ldfd.sa, ldfe.sa, ldf8.sa +ldfp; ldfps, ldfpd, ldfp8 +ldfp-a; ldfps.a, ldfpd.a, ldfp8.a +ldfp-c; IC:ldfp-c-nc, IC:ldfp-c-clr +ldfp-c-clr; ldfps.c.clr, ldfpd.c.clr, ldfp8.c.clr +ldfp-c-nc; ldfps.c.nc, ldfpd.c.nc, ldfp8.c.nc +ldfp-s; ldfps.s, ldfpd.s, ldfp8.s +ldfp-sa; ldfps.sa, ldfpd.sa, ldfp8.sa +lfetch-all; lfetch +lfetch-fault; lfetch[Field(lftype)==fault] +lfetch-nofault; lfetch[Field(lftype)==] +lfetch-postinc; lfetch[Format in {M14 M15}] +mem-readers; IC:mem-readers-fp, IC:mem-readers-int +mem-readers-alat; IC:ld-a, IC:ldf-a, IC:ldfp-a, IC:ld-sa, IC:ldf-sa, IC:ldfp-sa, IC:ld-c, IC:ldf-c, IC:ldfp-c +mem-readers-fp; IC:ldf, IC:ldfp +mem-readers-int; IC:cmpxchg, IC:fetchadd, IC:xchg, IC:ld +mem-readers-spec; IC:ld-s, IC:ld-sa, IC:ldf-s, IC:ldf-sa, IC:ldfp-s, IC:ldfp-sa +mem-writers; IC:mem-writers-fp, IC:mem-writers-int +mem-writers-fp; IC:stf +mem-writers-int; IC:cmpxchg, IC:fetchadd, IC:xchg, IC:st +mix; mix1, mix2, mix4 +mod-sched-brs; br.cexit, br.ctop, br.wexit, br.wtop +mod-sched-brs-counted; br.cexit, br.cloop, br.ctop +mov-from-AR; IC:mov-from-AR-M, IC:mov-from-AR-I, IC:mov-from-AR-IM +mov-from-AR-BSP; IC:mov-from-AR-M[Field(ar3) == BSP] +mov-from-AR-BSPSTORE; IC:mov-from-AR-M[Field(ar3) == BSPSTORE] +mov-from-AR-CCV; IC:mov-from-AR-M[Field(ar3) == CCV] +mov-from-AR-EC; IC:mov-from-AR-I[Field(ar3) == EC] +mov-from-AR-FPSR; IC:mov-from-AR-M[Field(ar3) == FPSR] +mov-from-AR-I; mov_ar[Format in {I28}] +mov-from-AR-ig; IC:mov-from-AR-IM[Field(ar3) in {48-63 112-127}] +mov-from-AR-IM; mov_ar[Format in {I28 M31}] +mov-from-AR-ITC; IC:mov-from-AR-M[Field(ar3) == ITC] +mov-from-AR-K; IC:mov-from-AR-M[Field(ar3) in {K0 K1 K2 K3 K4 K5 K6 K7}] +mov-from-AR-LC; IC:mov-from-AR-I[Field(ar3) == LC] +mov-from-AR-M; mov_ar[Format in {M31}] +mov-from-AR-PFS; IC:mov-from-AR-I[Field(ar3) == PFS] +mov-from-AR-RNAT; IC:mov-from-AR-M[Field(ar3) == RNAT] +mov-from-AR-RSC; IC:mov-from-AR-M[Field(ar3) == RSC] +mov-from-AR-rv; IC:none +mov-from-AR-UNAT; IC:mov-from-AR-M[Field(ar3) == UNAT] +mov-from-BR; mov_br[Format in {I22}] +mov-from-CR; mov_cr[Format in {M33}] +mov-from-CR-CMCV; IC:mov-from-CR[Field(cr3) == CMCV] +mov-from-CR-DCR; IC:mov-from-CR[Field(cr3) == DCR] +mov-from-CR-EOI; IC:mov-from-CR[Field(cr3) == EOI] +mov-from-CR-GPTA; IC:mov-from-CR[Field(cr3) == GPTA] +mov-from-CR-IFA; IC:mov-from-CR[Field(cr3) == IFA] +mov-from-CR-IFS; IC:mov-from-CR[Field(cr3) == IFS] +mov-from-CR-IHA; IC:mov-from-CR[Field(cr3) == IHA] +mov-from-CR-IIM; IC:mov-from-CR[Field(cr3) == IIM] +mov-from-CR-IIP; IC:mov-from-CR[Field(cr3) == IIP] +mov-from-CR-IIPA; IC:mov-from-CR[Field(cr3) == IIPA] +mov-from-CR-IPSR; IC:mov-from-CR[Field(cr3) == IPSR] +mov-from-CR-IRR; IC:mov-from-CR[Field(cr3) in {IRR0 IRR1 IRR2 IRR3}] +mov-from-CR-ISR; IC:mov-from-CR[Field(cr3) == ISR] +mov-from-CR-ITIR; IC:mov-from-CR[Field(cr3) == ITIR] +mov-from-CR-ITM; IC:mov-from-CR[Field(cr3) == ITM] +mov-from-CR-ITV; IC:mov-from-CR[Field(cr3) == ITV] +mov-from-CR-IVA; IC:mov-from-CR[Field(cr3) == IVA] +mov-from-CR-IVR; IC:mov-from-CR[Field(cr3) == IVR] +mov-from-CR-LID; IC:mov-from-CR[Field(cr3) == LID] +mov-from-CR-LRR; IC:mov-from-CR[Field(cr3) in {LRR0 LRR1}] +mov-from-CR-PMV; IC:mov-from-CR[Field(cr3) == PMV] +mov-from-CR-PTA; IC:mov-from-CR[Field(cr3) == PTA] +mov-from-CR-rv; IC:none +mov-from-CR-TPR; IC:mov-from-CR[Field(cr3) == TPR] +mov-from-IND; mov_indirect[Format in {M43}] +mov-from-IND-CPUID; IC:mov-from-IND[Field(ireg) == cpuid] +mov-from-IND-DBR; IC:mov-from-IND[Field(ireg) == dbr] +mov-from-IND-IBR; IC:mov-from-IND[Field(ireg) == ibr] +mov-from-IND-MSR; IC:mov-from-IND[Field(ireg) == msr] +mov-from-IND-PKR; IC:mov-from-IND[Field(ireg) == pkr] +mov-from-IND-PMC; IC:mov-from-IND[Field(ireg) == pmc] +mov-from-IND-PMD; IC:mov-from-IND[Field(ireg) == pmd] +mov-from-IND-priv; IC:mov-from-IND[Field(ireg) in {dbr ibr msr pkr pmc rr}] +mov-from-IND-RR; IC:mov-from-IND[Field(ireg) == rr] +mov-from-PR; mov_pr[Format in {I25}] +mov-from-PSR; mov_psr[Format in {M36}] +mov-from-PSR-um; mov_um[Format in {M36}] +mov-ip; mov_ip[Format in {I25}] +mov-to-AR; IC:mov-to-AR-M, IC:mov-to-AR-I +mov-to-AR-BSP; IC:mov-to-AR-M[Field(ar3) == BSP] +mov-to-AR-BSPSTORE; IC:mov-to-AR-M[Field(ar3) == BSPSTORE] +mov-to-AR-CCV; IC:mov-to-AR-M[Field(ar3) == CCV] +mov-to-AR-EC; IC:mov-to-AR-I[Field(ar3) == EC] +mov-to-AR-FPSR; IC:mov-to-AR-M[Field(ar3) == FPSR] +mov-to-AR-gr; IC:mov-to-AR-M[Format in {M29}], IC:mov-to-AR-I[Format in {I26}] +mov-to-AR-I; mov_ar[Format in {I26 I27}] +mov-to-AR-ig; IC:mov-to-AR-IM[Field(ar3) in {48-63 112-127}] +mov-to-AR-IM; mov_ar[Format in {I26 I27 M29 M30}] +mov-to-AR-ITC; IC:mov-to-AR-M[Field(ar3) == ITC] +mov-to-AR-K; IC:mov-to-AR-M[Field(ar3) in {K0 K1 K2 K3 K4 K5 K6 K7}] +mov-to-AR-LC; IC:mov-to-AR-I[Field(ar3) == LC] +mov-to-AR-M; mov_ar[Format in {M29 M30}] +mov-to-AR-PFS; IC:mov-to-AR-I[Field(ar3) == PFS] +mov-to-AR-RNAT; IC:mov-to-AR-M[Field(ar3) == RNAT] +mov-to-AR-RSC; IC:mov-to-AR-M[Field(ar3) == RSC] +mov-to-AR-UNAT; IC:mov-to-AR-M[Field(ar3) == UNAT] +mov-to-BR; mov_br[Format in {I21}] +mov-to-CR; mov_cr[Format in {M32}] +mov-to-CR-CMCV; IC:mov-to-CR[Field(cr3) == CMCV] +mov-to-CR-DCR; IC:mov-to-CR[Field(cr3) == DCR] +mov-to-CR-EOI; IC:mov-to-CR[Field(cr3) == EOI] +mov-to-CR-GPTA; IC:mov-to-CR[Field(cr3) == GPTA] +mov-to-CR-IFA; IC:mov-to-CR[Field(cr3) == IFA] +mov-to-CR-IFS; IC:mov-to-CR[Field(cr3) == IFS] +mov-to-CR-IHA; IC:mov-to-CR[Field(cr3) == IHA] +mov-to-CR-IIM; IC:mov-to-CR[Field(cr3) == IIM] +mov-to-CR-IIP; IC:mov-to-CR[Field(cr3) == IIP] +mov-to-CR-IIPA; IC:mov-to-CR[Field(cr3) == IIPA] +mov-to-CR-IPSR; IC:mov-to-CR[Field(cr3) == IPSR] +mov-to-CR-IRR; IC:mov-to-CR[Field(cr3) in {IRR0 IRR1 IRR2 IRR3}] +mov-to-CR-ISR; IC:mov-to-CR[Field(cr3) == ISR] +mov-to-CR-ITIR; IC:mov-to-CR[Field(cr3) == ITIR] +mov-to-CR-ITM; IC:mov-to-CR[Field(cr3) == ITM] +mov-to-CR-ITV; IC:mov-to-CR[Field(cr3) == ITV] +mov-to-CR-IVA; IC:mov-to-CR[Field(cr3) == IVA] +mov-to-CR-IVR; IC:mov-to-CR[Field(cr3) == IVR] +mov-to-CR-LID; IC:mov-to-CR[Field(cr3) == LID] +mov-to-CR-LRR; IC:mov-to-CR[Field(cr3) in {LRR0 LRR1}] +mov-to-CR-PMV; IC:mov-to-CR[Field(cr3) == PMV] +mov-to-CR-PTA; IC:mov-to-CR[Field(cr3) == PTA] +mov-to-CR-TPR; IC:mov-to-CR[Field(cr3) == TPR] +mov-to-IND; mov_indirect[Format in {M42}] +mov-to-IND-CPUID; IC:mov-to-IND[Field(ireg) == cpuid] +mov-to-IND-DBR; IC:mov-to-IND[Field(ireg) == dbr] +mov-to-IND-IBR; IC:mov-to-IND[Field(ireg) == ibr] +mov-to-IND-MSR; IC:mov-to-IND[Field(ireg) == msr] +mov-to-IND-PKR; IC:mov-to-IND[Field(ireg) == pkr] +mov-to-IND-PMC; IC:mov-to-IND[Field(ireg) == pmc] +mov-to-IND-PMD; IC:mov-to-IND[Field(ireg) == pmd] +mov-to-IND-priv; IC:mov-to-IND +mov-to-IND-RR; IC:mov-to-IND[Field(ireg) == rr] +mov-to-PR; IC:mov-to-PR-allreg, IC:mov-to-PR-rotreg +mov-to-PR-allreg; mov_pr[Format in {I23}] +mov-to-PR-rotreg; mov_pr[Format in {I24}] +mov-to-PSR-l; mov_psr[Format in {M35}] +mov-to-PSR-um; mov_um[Format in {M35}] +mux; mux1, mux2 +none; - +pack; pack2, pack4 +padd; padd1, padd2, padd4 +pavg; pavg1, pavg2 +pavgsub; pavgsub1, pavgsub2 +pcmp; pcmp1, pcmp2, pcmp4 +pmax; pmax1, pmax2 +pmin; pmin1, pmin2 +pmpy; pmpy2 +pmpyshr; pmpyshr2 +pr-and-writers; IC:pr-gen-writers-int[Field(ctype) in {and andcm}], IC:pr-gen-writers-int[Field(ctype) in {or.andcm and.orcm}] +pr-gen-writers-fp; fclass, fcmp +pr-gen-writers-int; cmp, cmp4, tbit, tnat +pr-norm-writers-fp; IC:pr-gen-writers-fp[Field(ctype)==] +pr-norm-writers-int; IC:pr-gen-writers-int[Field(ctype)==] +pr-or-writers; IC:pr-gen-writers-int[Field(ctype) in {or orcm}], IC:pr-gen-writers-int[Field(ctype) in {or.andcm and.orcm}] +pr-readers-br; br.call, br.cond, brl.call, brl.cond, br.ret, br.wexit, br.wtop, break.b, nop.b, IC:ReservedBQP +pr-readers-nobr-nomovpr; add, addl, addp4, adds, and, andcm, break.f, break.i, break.m, break.x, chk.s, IC:chk-a, cmp, cmp4, IC:cmpxchg, IC:czx, dep, extr, IC:fp-arith, IC:fp-non-arith, fc, fchkf, fclrf, fcmp, IC:fetchadd, fpcmp, fsetc, fwb, getf, IC:invala-all, itc.i, itc.d, itr.i, itr.d, IC:ld, IC:ldf, IC:ldfp, IC:lfetch-all, mf, IC:mix, IC:mov-from-AR-M, IC:mov-from-AR-IM, IC:mov-from-AR-I, IC:mov-to-AR-M, IC:mov-to-AR-I, IC:mov-to-AR-IM, IC:mov-to-BR, IC:mov-from-BR, IC:mov-to-CR, IC:mov-from-CR, IC:mov-to-IND, IC:mov-from-IND, IC:mov-ip, IC:mov-to-PSR-l, IC:mov-to-PSR-um, IC:mov-from-PSR, IC:mov-from-PSR-um, movl, IC:mux, nop.f, nop.i, nop.m, nop.x, or, IC:pack, IC:padd, IC:pavg, IC:pavgsub, IC:pcmp, IC:pmax, IC:pmin, IC:pmpy, IC:pmpyshr, popcnt, IC:probe-all, IC:psad, IC:pshl, IC:pshladd, IC:pshr, IC:pshradd, IC:psub, ptc.e, ptc.g, ptc.ga, ptc.l, ptr.d, ptr.i, IC:ReservedQP, rsm, setf, shl, shladd, shladdp4, shr, shrp, srlz.i, srlz.d, ssm, IC:st, IC:stf, sub, sum, IC:sxt, sync, tak, tbit, thash, tnat, tpa, ttag, IC:unpack, IC:xchg, xma, xmpy, xor, IC:zxt +pr-unc-writers-fp; IC:pr-gen-writers-fp[Field(ctype)==unc]+11, fprcpa+11, fprsqrta+11, frcpa+11, frsqrta+11 +pr-unc-writers-int; IC:pr-gen-writers-int[Field(ctype)==unc]+11 +pr-writers; IC:pr-writers-int, IC:pr-writers-fp +pr-writers-fp; IC:pr-norm-writers-fp, IC:pr-unc-writers-fp +pr-writers-int; IC:pr-norm-writers-int, IC:pr-unc-writers-int, IC:pr-and-writers, IC:pr-or-writers +predicatable-instructions; IC:mov-from-PR, IC:mov-to-PR, IC:pr-readers-br, IC:pr-readers-nobr-nomovpr +priv-ops; IC:mov-to-IND-priv, bsw, itc.i, itc.d, itr.i, itr.d, IC:mov-to-CR, IC:mov-from-CR, IC:mov-to-PSR-l, IC:mov-from-PSR, IC:mov-from-IND-priv, ptc.e, ptc.g, ptc.ga, ptc.l, ptr.i, ptr.d, rfi, rsm, ssm, tak, tpa +probe-all; IC:probe-fault, IC:probe-nofault +probe-fault; probe[Format in {M40}] +probe-nofault; probe[Format in {M38 M39}] +psad; psad1 +pshl; pshl2, pshl4 +pshladd; pshladd2 +pshr; pshr2, pshr4 +pshradd; pshradd2 +psub; psub1, psub2, psub4 +ReservedBQP; -+15 +ReservedQP; -+16 +rse-readers; alloc, br.call, br.ia, br.ret, brl.call, cover, flushrs, loadrs, IC:mov-from-AR-BSP, IC:mov-from-AR-BSPSTORE, IC:mov-to-AR-BSPSTORE, IC:mov-from-AR-RNAT, IC:mov-to-AR-RNAT, rfi +rse-writers; alloc, br.call, br.ia, br.ret, brl.call, cover, flushrs, loadrs, IC:mov-to-AR-BSPSTORE, rfi +st; st1, st2, st4, st8, st8.spill +st-postinc; IC:stf[Format in {M10}], IC:st[Format in {M5}] +stf; stfs, stfd, stfe, stf8, stf.spill +sxt; sxt1, sxt2, sxt4 +sys-mask-writers-partial; rsm, ssm +unpack; unpack1, unpack2, unpack4 +unpredicatable-instructions; alloc, br.cloop, br.ctop, br.cexit, br.ia, brp, bsw, clrrrb, cover, epc, flushrs, loadrs, rfi +user-mask-writers-partial; rum, sum +xchg; xchg1, xchg2, xchg4, xchg8 +zxt; zxt1, zxt2, zxt4 diff --git a/contrib/binutils/opcodes/ia64-opc-a.c b/contrib/binutils/opcodes/ia64-opc-a.c new file mode 100644 index 0000000..27d7637 --- /dev/null +++ b/contrib/binutils/opcodes/ia64-opc-a.c @@ -0,0 +1,412 @@ +/* ia64-opc-a.c -- IA-64 `A' opcode table. + Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + This file is part of GDB, GAS, and the GNU binutils. + + GDB, GAS, and the GNU binutils are free software; you can redistribute + them and/or modify them under the terms of the GNU General Public + License as published by the Free Software Foundation; either version + 2, or (at your option) any later version. + + GDB, GAS, and the GNU binutils are distributed in the hope that they + will be useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this file; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#include "ia64-opc.h" + +#define A IA64_TYPE_A, 1 +#define A2 IA64_TYPE_A, 2 + +/* instruction bit fields: */ +#define bC(x) (((ia64_insn) ((x) & 0x1)) << 12) +#define bImm14(x) ((((ia64_insn) (((x) >> 0) & 0x7f)) << 13) | \ + (((ia64_insn) (((x) >> 7) & 0x3f)) << 27) | \ + (((ia64_insn) (((x) >> 13) & 0x01)) << 36)) +#define bR3a(x) (((ia64_insn) ((x) & 0x7f)) << 20) +#define bR3b(x) (((ia64_insn) ((x) & 0x3)) << 20) +#define bTa(x) (((ia64_insn) ((x) & 0x1)) << 33) +#define bTb(x) (((ia64_insn) ((x) & 0x1)) << 36) +#define bVe(x) (((ia64_insn) ((x) & 0x1)) << 33) +#define bX(x) (((ia64_insn) ((x) & 0x1)) << 33) +#define bX2(x) (((ia64_insn) ((x) & 0x3)) << 34) +#define bX2a(x) (((ia64_insn) ((x) & 0x3)) << 34) +#define bX2b(x) (((ia64_insn) ((x) & 0x3)) << 27) +#define bX4(x) (((ia64_insn) ((x) & 0xf)) << 29) +#define bZa(x) (((ia64_insn) ((x) & 0x1)) << 36) +#define bZb(x) (((ia64_insn) ((x) & 0x1)) << 33) + +/* instruction bit masks: */ +#define mC bC (-1) +#define mImm14 bImm14 (-1) +#define mR3a bR3a (-1) +#define mR3b bR3b (-1) +#define mTa bTa (-1) +#define mTb bTb (-1) +#define mVe bVe (-1) +#define mX bX (-1) +#define mX2 bX2 (-1) +#define mX2a bX2a (-1) +#define mX2b bX2b (-1) +#define mX4 bX4 (-1) +#define mZa bZa (-1) +#define mZb bZb (-1) + +#define OpR3b(a,b) (bOp (a) | bR3b (b)), (mOp | mR3b) +#define OpX2aVe(a,b,c) (bOp (a) | bX2a (b) | bVe (c)), \ + (mOp | mX2a | mVe) +#define OpX2aVeR3a(a,b,c,d) (bOp (a) | bX2a (b) | bVe (c) | bR3a (d)), \ + (mOp | mX2a | mVe | mR3a) +#define OpX2aVeImm14(a,b,c,d) (bOp (a) | bX2a (b) | bVe (c) | bImm14 (d)), \ + (mOp | mX2a | mVe | mImm14) +#define OpX2aVeX4(a,b,c,d) (bOp (a) | bX2a (b) | bVe (c) | bX4 (d)), \ + (mOp | mX2a | mVe | mX4) +#define OpX2aVeX4X2b(a,b,c,d,e) \ + (bOp (a) | bX2a (b) | bVe (c) | bX4 (d) | bX2b (e)), \ + (mOp | mX2a | mVe | mX4 | mX2b) +#define OpX2TbTaC(a,b,c,d,e) \ + (bOp (a) | bX2 (b) | bTb (c) | bTa (d) | bC (e)), \ + (mOp | mX2 | mTb | mTa | mC) +#define OpX2TaC(a,b,c,d) (bOp (a) | bX2 (b) | bTa (c) | bC (d)), \ + (mOp | mX2 | mTa | mC) +#define OpX2aZaZbX4(a,b,c,d,e) \ + (bOp (a) | bX2a (b) | bZa (c) | bZb (d) | bX4 (e)), \ + (mOp | mX2a | mZa | mZb | mX4) +#define OpX2aZaZbX4X2b(a,b,c,d,e,f) \ + (bOp (a) | bX2a (b) | bZa (c) | bZb (d) | bX4 (e) | bX2b (f)), \ + (mOp | mX2a | mZa | mZb | mX4 | mX2b) + +struct ia64_opcode ia64_opcodes_a[] = + { + /* A-type instruction encodings (sorted according to major opcode) */ + + {"add", A, OpX2aVeX4X2b (8, 0, 0, 0, 0), {R1, R2, R3}}, + {"add", A, OpX2aVeX4X2b (8, 0, 0, 0, 1), {R1, R2, R3, C1}}, + {"sub", A, OpX2aVeX4X2b (8, 0, 0, 1, 1), {R1, R2, R3}}, + {"sub", A, OpX2aVeX4X2b (8, 0, 0, 1, 0), {R1, R2, R3, C1}}, + {"addp4", A, OpX2aVeX4X2b (8, 0, 0, 2, 0), {R1, R2, R3}}, + {"and", A, OpX2aVeX4X2b (8, 0, 0, 3, 0), {R1, R2, R3}}, + {"andcm", A, OpX2aVeX4X2b (8, 0, 0, 3, 1), {R1, R2, R3}}, + {"or", A, OpX2aVeX4X2b (8, 0, 0, 3, 2), {R1, R2, R3}}, + {"xor", A, OpX2aVeX4X2b (8, 0, 0, 3, 3), {R1, R2, R3}}, + {"shladd", A, OpX2aVeX4 (8, 0, 0, 4), {R1, R2, CNT2a, R3}}, + {"shladdp4", A, OpX2aVeX4 (8, 0, 0, 6), {R1, R2, CNT2a, R3}}, + {"sub", A, OpX2aVeX4X2b (8, 0, 0, 9, 1), {R1, IMM8, R3}}, + {"and", A, OpX2aVeX4X2b (8, 0, 0, 0xb, 0), {R1, IMM8, R3}}, + {"andcm", A, OpX2aVeX4X2b (8, 0, 0, 0xb, 1), {R1, IMM8, R3}}, + {"or", A, OpX2aVeX4X2b (8, 0, 0, 0xb, 2), {R1, IMM8, R3}}, + {"xor", A, OpX2aVeX4X2b (8, 0, 0, 0xb, 3), {R1, IMM8, R3}}, + {"mov", A, OpX2aVeImm14 (8, 2, 0, 0), {R1, R3}}, + {"mov", A, OpX2aVeR3a (8, 2, 0, 0), {R1, IMM14}, PSEUDO}, + {"adds", A, OpX2aVe (8, 2, 0), {R1, IMM14, R3}}, + {"addp4", A, OpX2aVe (8, 3, 0), {R1, IMM14, R3}}, + {"padd1", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 0, 0), {R1, R2, R3}}, + {"padd2", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 0, 0), {R1, R2, R3}}, + {"padd4", A, OpX2aZaZbX4X2b (8, 1, 1, 0, 0, 0), {R1, R2, R3}}, + {"padd1.sss", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 0, 1), {R1, R2, R3}}, + {"padd2.sss", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 0, 1), {R1, R2, R3}}, + {"padd1.uuu", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 0, 2), {R1, R2, R3}}, + {"padd2.uuu", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 0, 2), {R1, R2, R3}}, + {"padd1.uus", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 0, 3), {R1, R2, R3}}, + {"padd2.uus", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 0, 3), {R1, R2, R3}}, + {"psub1", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 1, 0), {R1, R2, R3}}, + {"psub2", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 1, 0), {R1, R2, R3}}, + {"psub4", A, OpX2aZaZbX4X2b (8, 1, 1, 0, 1, 0), {R1, R2, R3}}, + {"psub1.sss", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 1, 1), {R1, R2, R3}}, + {"psub2.sss", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 1, 1), {R1, R2, R3}}, + {"psub1.uuu", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 1, 2), {R1, R2, R3}}, + {"psub2.uuu", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 1, 2), {R1, R2, R3}}, + {"psub1.uus", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 1, 3), {R1, R2, R3}}, + {"psub2.uus", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 1, 3), {R1, R2, R3}}, + {"pavg1", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 2, 2), {R1, R2, R3}}, + {"pavg2", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 2, 2), {R1, R2, R3}}, + {"pavg1.raz", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 2, 3), {R1, R2, R3}}, + {"pavg2.raz", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 2, 3), {R1, R2, R3}}, + {"pavgsub1", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 3, 2), {R1, R2, R3}}, + {"pavgsub2", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 3, 2), {R1, R2, R3}}, + {"pcmp1.eq", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 9, 0), {R1, R2, R3}}, + {"pcmp2.eq", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 9, 0), {R1, R2, R3}}, + {"pcmp4.eq", A, OpX2aZaZbX4X2b (8, 1, 1, 0, 9, 0), {R1, R2, R3}}, + {"pcmp1.gt", A, OpX2aZaZbX4X2b (8, 1, 0, 0, 9, 1), {R1, R2, R3}}, + {"pcmp2.gt", A, OpX2aZaZbX4X2b (8, 1, 0, 1, 9, 1), {R1, R2, R3}}, + {"pcmp4.gt", A, OpX2aZaZbX4X2b (8, 1, 1, 0, 9, 1), {R1, R2, R3}}, + {"pshladd2", A, OpX2aZaZbX4 (8, 1, 0, 1, 4), {R1, R2, CNT2b, R3}}, + {"pshradd2", A, OpX2aZaZbX4 (8, 1, 0, 1, 6), {R1, R2, CNT2b, R3}}, + + {"mov", A, OpR3b (9, 0), {R1, IMM22}, PSEUDO}, + {"addl", A, Op (9), {R1, IMM22, R3_2}}, + + {"cmp.lt", A2, OpX2TbTaC (0xc, 0, 0, 0, 0), {P1, P2, R2, R3}}, + {"cmp.le", A2, OpX2TbTaC (0xc, 0, 0, 0, 0), {P2, P1, R3, R2}}, + {"cmp.gt", A2, OpX2TbTaC (0xc, 0, 0, 0, 0), {P1, P2, R3, R2}}, + {"cmp.ge", A2, OpX2TbTaC (0xc, 0, 0, 0, 0), {P2, P1, R2, R3}}, + {"cmp.lt.unc", A2, OpX2TbTaC (0xc, 0, 0, 0, 1), {P1, P2, R2, R3}}, + {"cmp.le.unc", A2, OpX2TbTaC (0xc, 0, 0, 0, 1), {P2, P1, R3, R2}}, + {"cmp.gt.unc", A2, OpX2TbTaC (0xc, 0, 0, 0, 1), {P1, P2, R3, R2}}, + {"cmp.ge.unc", A2, OpX2TbTaC (0xc, 0, 0, 0, 1), {P2, P1, R2, R3}}, + {"cmp.eq.and", A2, OpX2TbTaC (0xc, 0, 0, 1, 0), {P1, P2, R2, R3}}, + {"cmp.ne.andcm", A2, OpX2TbTaC (0xc, 0, 0, 1, 0), {P1, P2, R2, R3}, PSEUDO}, + {"cmp.ne.and", A2, OpX2TbTaC (0xc, 0, 0, 1, 1), {P1, P2, R2, R3}}, + {"cmp.eq.andcm", A2, OpX2TbTaC (0xc, 0, 0, 1, 1), {P1, P2, R2, R3}, PSEUDO}, + {"cmp4.lt", A2, OpX2TbTaC (0xc, 1, 0, 0, 0), {P1, P2, R2, R3}}, + {"cmp4.le", A2, OpX2TbTaC (0xc, 1, 0, 0, 0), {P2, P1, R3, R2}}, + {"cmp4.gt", A2, OpX2TbTaC (0xc, 1, 0, 0, 0), {P1, P2, R3, R2}}, + {"cmp4.ge", A2, OpX2TbTaC (0xc, 1, 0, 0, 0), {P2, P1, R2, R3}}, + {"cmp4.lt.unc", A2, OpX2TbTaC (0xc, 1, 0, 0, 1), {P1, P2, R2, R3}}, + {"cmp4.le.unc", A2, OpX2TbTaC (0xc, 1, 0, 0, 1), {P2, P1, R3, R2}}, + {"cmp4.gt.unc", A2, OpX2TbTaC (0xc, 1, 0, 0, 1), {P1, P2, R3, R2}}, + {"cmp4.ge.unc", A2, OpX2TbTaC (0xc, 1, 0, 0, 1), {P2, P1, R2, R3}}, + {"cmp4.eq.and", A2, OpX2TbTaC (0xc, 1, 0, 1, 0), {P1, P2, R2, R3}}, + {"cmp4.ne.andcm", A2, OpX2TbTaC (0xc, 1, 0, 1, 0), {P1, P2, R2, R3}, PSEUDO}, + {"cmp4.ne.and", A2, OpX2TbTaC (0xc, 1, 0, 1, 1), {P1, P2, R2, R3}}, + {"cmp4.eq.andcm", A2, OpX2TbTaC (0xc, 1, 0, 1, 1), {P1, P2, R2, R3}, PSEUDO}, + {"cmp.gt.and", A2, OpX2TbTaC (0xc, 0, 1, 0, 0), {P1, P2, GR0, R3}}, + {"cmp.lt.and", A2, OpX2TbTaC (0xc, 0, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp.le.andcm", A2, OpX2TbTaC (0xc, 0, 1, 0, 0), {P1, P2, GR0, R3}, PSEUDO}, + {"cmp.ge.andcm", A2, OpX2TbTaC (0xc, 0, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp.le.and", A2, OpX2TbTaC (0xc, 0, 1, 0, 1), {P1, P2, GR0, R3}}, + {"cmp.ge.and", A2, OpX2TbTaC (0xc, 0, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp.gt.andcm", A2, OpX2TbTaC (0xc, 0, 1, 0, 1), {P1, P2, GR0, R3}, PSEUDO}, + {"cmp.lt.andcm", A2, OpX2TbTaC (0xc, 0, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp.ge.and", A2, OpX2TbTaC (0xc, 0, 1, 1, 0), {P1, P2, GR0, R3}}, + {"cmp.le.and", A2, OpX2TbTaC (0xc, 0, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp.lt.andcm", A2, OpX2TbTaC (0xc, 0, 1, 1, 0), {P1, P2, GR0, R3}, PSEUDO}, + {"cmp.gt.andcm", A2, OpX2TbTaC (0xc, 0, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp.lt.and", A2, OpX2TbTaC (0xc, 0, 1, 1, 1), {P1, P2, GR0, R3}}, + {"cmp.gt.and", A2, OpX2TbTaC (0xc, 0, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp.ge.andcm", A2, OpX2TbTaC (0xc, 0, 1, 1, 1), {P1, P2, GR0, R3}, PSEUDO}, + {"cmp.le.andcm", A2, OpX2TbTaC (0xc, 0, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp4.gt.and", A2, OpX2TbTaC (0xc, 1, 1, 0, 0), {P1, P2, GR0, R3}}, + {"cmp4.lt.and", A2, OpX2TbTaC (0xc, 1, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp4.le.andcm", A2, OpX2TbTaC (0xc, 1, 1, 0, 0), {P1, P2, GR0, R3}, PSEUDO}, + {"cmp4.ge.andcm", A2, OpX2TbTaC (0xc, 1, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp4.le.and", A2, OpX2TbTaC (0xc, 1, 1, 0, 1), {P1, P2, GR0, R3}}, + {"cmp4.ge.and", A2, OpX2TbTaC (0xc, 1, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp4.gt.andcm", A2, OpX2TbTaC (0xc, 1, 1, 0, 1), {P1, P2, GR0, R3}, PSEUDO}, + {"cmp4.lt.andcm", A2, OpX2TbTaC (0xc, 1, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp4.ge.and", A2, OpX2TbTaC (0xc, 1, 1, 1, 0), {P1, P2, GR0, R3}}, + {"cmp4.le.and", A2, OpX2TbTaC (0xc, 1, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp4.lt.andcm", A2, OpX2TbTaC (0xc, 1, 1, 1, 0), {P1, P2, GR0, R3}, PSEUDO}, + {"cmp4.gt.andcm", A2, OpX2TbTaC (0xc, 1, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp4.lt.and", A2, OpX2TbTaC (0xc, 1, 1, 1, 1), {P1, P2, GR0, R3}}, + {"cmp4.gt.and", A2, OpX2TbTaC (0xc, 1, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp4.ge.andcm", A2, OpX2TbTaC (0xc, 1, 1, 1, 1), {P1, P2, GR0, R3}, PSEUDO}, + {"cmp4.le.andcm", A2, OpX2TbTaC (0xc, 1, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp.lt", A2, OpX2TaC (0xc, 2, 0, 0), {P1, P2, IMM8, R3}}, + {"cmp.le", A2, OpX2TaC (0xc, 2, 0, 0), {P1, P2, IMM8M1, R3}}, + {"cmp.gt", A2, OpX2TaC (0xc, 2, 0, 0), {P2, P1, IMM8M1, R3}}, + {"cmp.ge", A2, OpX2TaC (0xc, 2, 0, 0), {P2, P1, IMM8, R3}}, + {"cmp.lt.unc", A2, OpX2TaC (0xc, 2, 0, 1), {P1, P2, IMM8, R3}}, + {"cmp.le.unc", A2, OpX2TaC (0xc, 2, 0, 1), {P1, P2, IMM8M1, R3}}, + {"cmp.gt.unc", A2, OpX2TaC (0xc, 2, 0, 1), {P2, P1, IMM8M1, R3}}, + {"cmp.ge.unc", A2, OpX2TaC (0xc, 2, 0, 1), {P2, P1, IMM8, R3}}, + {"cmp.eq.and", A2, OpX2TaC (0xc, 2, 1, 0), {P1, P2, IMM8, R3}}, + {"cmp.ne.andcm", A2, OpX2TaC (0xc, 2, 1, 0), {P1, P2, IMM8, R3}, PSEUDO}, + {"cmp.ne.and", A2, OpX2TaC (0xc, 2, 1, 1), {P1, P2, IMM8, R3}}, + {"cmp.eq.andcm", A2, OpX2TaC (0xc, 2, 1, 1), {P1, P2, IMM8, R3}, PSEUDO}, + {"cmp4.lt", A2, OpX2TaC (0xc, 3, 0, 0), {P1, P2, IMM8, R3}}, + {"cmp4.le", A2, OpX2TaC (0xc, 3, 0, 0), {P1, P2, IMM8M1, R3}}, + {"cmp4.gt", A2, OpX2TaC (0xc, 3, 0, 0), {P2, P1, IMM8M1, R3}}, + {"cmp4.ge", A2, OpX2TaC (0xc, 3, 0, 0), {P2, P1, IMM8, R3}}, + {"cmp4.lt.unc", A2, OpX2TaC (0xc, 3, 0, 1), {P1, P2, IMM8, R3}}, + {"cmp4.le.unc", A2, OpX2TaC (0xc, 3, 0, 1), {P1, P2, IMM8M1, R3}}, + {"cmp4.gt.unc", A2, OpX2TaC (0xc, 3, 0, 1), {P2, P1, IMM8M1, R3}}, + {"cmp4.ge.unc", A2, OpX2TaC (0xc, 3, 0, 1), {P2, P1, IMM8, R3}}, + {"cmp4.eq.and", A2, OpX2TaC (0xc, 3, 1, 0), {P1, P2, IMM8, R3}}, + {"cmp4.ne.andcm", A2, OpX2TaC (0xc, 3, 1, 0), {P1, P2, IMM8, R3}, PSEUDO}, + {"cmp4.ne.and", A2, OpX2TaC (0xc, 3, 1, 1), {P1, P2, IMM8, R3}}, + {"cmp4.eq.andcm", A2, OpX2TaC (0xc, 3, 1, 1), {P1, P2, IMM8, R3}, PSEUDO}, + {"cmp.ltu", A2, OpX2TbTaC (0xd, 0, 0, 0, 0), {P1, P2, R2, R3}}, + {"cmp.leu", A2, OpX2TbTaC (0xd, 0, 0, 0, 0), {P2, P1, R3, R2}}, + {"cmp.gtu", A2, OpX2TbTaC (0xd, 0, 0, 0, 0), {P1, P2, R3, R2}}, + {"cmp.geu", A2, OpX2TbTaC (0xd, 0, 0, 0, 0), {P2, P1, R2, R3}}, + {"cmp.ltu.unc", A2, OpX2TbTaC (0xd, 0, 0, 0, 1), {P1, P2, R2, R3}}, + {"cmp.leu.unc", A2, OpX2TbTaC (0xd, 0, 0, 0, 1), {P2, P1, R3, R2}}, + {"cmp.gtu.unc", A2, OpX2TbTaC (0xd, 0, 0, 0, 1), {P1, P2, R3, R2}}, + {"cmp.geu.unc", A2, OpX2TbTaC (0xd, 0, 0, 0, 1), {P2, P1, R2, R3}}, + {"cmp.eq.or", A2, OpX2TbTaC (0xd, 0, 0, 1, 0), {P1, P2, R2, R3}}, + {"cmp.ne.orcm", A2, OpX2TbTaC (0xd, 0, 0, 1, 0), {P1, P2, R2, R3}, PSEUDO}, + {"cmp.ne.or", A2, OpX2TbTaC (0xd, 0, 0, 1, 1), {P1, P2, R2, R3}}, + {"cmp.eq.orcm", A2, OpX2TbTaC (0xd, 0, 0, 1, 1), {P1, P2, R2, R3}, PSEUDO}, + {"cmp4.ltu", A2, OpX2TbTaC (0xd, 1, 0, 0, 0), {P1, P2, R2, R3}}, + {"cmp4.leu", A2, OpX2TbTaC (0xd, 1, 0, 0, 0), {P2, P1, R3, R2}}, + {"cmp4.gtu", A2, OpX2TbTaC (0xd, 1, 0, 0, 0), {P1, P2, R3, R2}}, + {"cmp4.geu", A2, OpX2TbTaC (0xd, 1, 0, 0, 0), {P2, P1, R2, R3}}, + {"cmp4.ltu.unc", A2, OpX2TbTaC (0xd, 1, 0, 0, 1), {P1, P2, R2, R3}}, + {"cmp4.leu.unc", A2, OpX2TbTaC (0xd, 1, 0, 0, 1), {P2, P1, R3, R2}}, + {"cmp4.gtu.unc", A2, OpX2TbTaC (0xd, 1, 0, 0, 1), {P1, P2, R3, R2}}, + {"cmp4.geu.unc", A2, OpX2TbTaC (0xd, 1, 0, 0, 1), {P2, P1, R2, R3}}, + {"cmp4.eq.or", A2, OpX2TbTaC (0xd, 1, 0, 1, 0), {P1, P2, R2, R3}}, + {"cmp4.ne.orcm", A2, OpX2TbTaC (0xd, 1, 0, 1, 0), {P1, P2, R2, R3}, PSEUDO}, + {"cmp4.ne.or", A2, OpX2TbTaC (0xd, 1, 0, 1, 1), {P1, P2, R2, R3}}, + {"cmp4.eq.orcm", A2, OpX2TbTaC (0xd, 1, 0, 1, 1), {P1, P2, R2, R3}, PSEUDO}, + {"cmp.gt.or", A2, OpX2TbTaC (0xd, 0, 1, 0, 0), {P1, P2, GR0, R3}}, + {"cmp.lt.or", A2, OpX2TbTaC (0xd, 0, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp.le.orcm", A2, OpX2TbTaC (0xd, 0, 1, 0, 0), {P1, P2, GR0, R3}, PSEUDO}, + {"cmp.ge.orcm", A2, OpX2TbTaC (0xd, 0, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp.le.or", A2, OpX2TbTaC (0xd, 0, 1, 0, 1), {P1, P2, GR0, R3}}, + {"cmp.ge.or", A2, OpX2TbTaC (0xd, 0, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp.gt.orcm", A2, OpX2TbTaC (0xd, 0, 1, 0, 1), {P1, P2, GR0, R3}, PSEUDO}, + {"cmp.lt.orcm", A2, OpX2TbTaC (0xd, 0, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp.ge.or", A2, OpX2TbTaC (0xd, 0, 1, 1, 0), {P1, P2, GR0, R3}}, + {"cmp.le.or", A2, OpX2TbTaC (0xd, 0, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp.lt.orcm", A2, OpX2TbTaC (0xd, 0, 1, 1, 0), {P1, P2, GR0, R3}, PSEUDO}, + {"cmp.gt.orcm", A2, OpX2TbTaC (0xd, 0, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp.lt.or", A2, OpX2TbTaC (0xd, 0, 1, 1, 1), {P1, P2, GR0, R3}}, + {"cmp.gt.or", A2, OpX2TbTaC (0xd, 0, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp.ge.orcm", A2, OpX2TbTaC (0xd, 0, 1, 1, 1), {P1, P2, GR0, R3}, PSEUDO}, + {"cmp.le.orcm", A2, OpX2TbTaC (0xd, 0, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp4.gt.or", A2, OpX2TbTaC (0xd, 1, 1, 0, 0), {P1, P2, GR0, R3}}, + {"cmp4.lt.or", A2, OpX2TbTaC (0xd, 1, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp4.le.orcm", A2, OpX2TbTaC (0xd, 1, 1, 0, 0), {P1, P2, GR0, R3}, PSEUDO}, + {"cmp4.ge.orcm", A2, OpX2TbTaC (0xd, 1, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp4.le.or", A2, OpX2TbTaC (0xd, 1, 1, 0, 1), {P1, P2, GR0, R3}}, + {"cmp4.ge.or", A2, OpX2TbTaC (0xd, 1, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp4.gt.orcm", A2, OpX2TbTaC (0xd, 1, 1, 0, 1), {P1, P2, GR0, R3}, PSEUDO}, + {"cmp4.lt.orcm", A2, OpX2TbTaC (0xd, 1, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp4.ge.or", A2, OpX2TbTaC (0xd, 1, 1, 1, 0), {P1, P2, GR0, R3}}, + {"cmp4.le.or", A2, OpX2TbTaC (0xd, 1, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp4.lt.orcm", A2, OpX2TbTaC (0xd, 1, 1, 1, 0), {P1, P2, GR0, R3}, PSEUDO}, + {"cmp4.gt.orcm", A2, OpX2TbTaC (0xd, 1, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp4.lt.or", A2, OpX2TbTaC (0xd, 1, 1, 1, 1), {P1, P2, GR0, R3}}, + {"cmp4.gt.or", A2, OpX2TbTaC (0xd, 1, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp4.ge.orcm", A2, OpX2TbTaC (0xd, 1, 1, 1, 1), {P1, P2, GR0, R3}, PSEUDO}, + {"cmp4.le.orcm", A2, OpX2TbTaC (0xd, 1, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp.ltu", A2, OpX2TaC (0xd, 2, 0, 0), {P1, P2, IMM8, R3}}, + {"cmp.leu", A2, OpX2TaC (0xd, 2, 0, 0), {P1, P2, IMM8M1U8, R3}}, + {"cmp.gtu", A2, OpX2TaC (0xd, 2, 0, 0), {P2, P1, IMM8M1U8, R3}}, + {"cmp.geu", A2, OpX2TaC (0xd, 2, 0, 0), {P2, P1, IMM8, R3}}, + {"cmp.ltu.unc", A2, OpX2TaC (0xd, 2, 0, 1), {P1, P2, IMM8, R3}}, + {"cmp.leu.unc", A2, OpX2TaC (0xd, 2, 0, 1), {P1, P2, IMM8M1U8, R3}}, + {"cmp.gtu.unc", A2, OpX2TaC (0xd, 2, 0, 1), {P2, P1, IMM8M1U8, R3}}, + {"cmp.geu.unc", A2, OpX2TaC (0xd, 2, 0, 1), {P2, P1, IMM8, R3}}, + {"cmp.eq.or", A2, OpX2TaC (0xd, 2, 1, 0), {P1, P2, IMM8, R3}}, + {"cmp.ne.orcm", A2, OpX2TaC (0xd, 2, 1, 0), {P1, P2, IMM8, R3}, PSEUDO}, + {"cmp.ne.or", A2, OpX2TaC (0xd, 2, 1, 1), {P1, P2, IMM8, R3}}, + {"cmp.eq.orcm", A2, OpX2TaC (0xd, 2, 1, 1), {P1, P2, IMM8, R3}, PSEUDO}, + {"cmp4.ltu", A2, OpX2TaC (0xd, 3, 0, 0), {P1, P2, IMM8U4, R3}}, + {"cmp4.leu", A2, OpX2TaC (0xd, 3, 0, 0), {P1, P2, IMM8M1U4, R3}}, + {"cmp4.gtu", A2, OpX2TaC (0xd, 3, 0, 0), {P2, P1, IMM8M1U4, R3}}, + {"cmp4.geu", A2, OpX2TaC (0xd, 3, 0, 0), {P2, P1, IMM8U4, R3}}, + {"cmp4.ltu.unc", A2, OpX2TaC (0xd, 3, 0, 1), {P1, P2, IMM8U4, R3}}, + {"cmp4.leu.unc", A2, OpX2TaC (0xd, 3, 0, 1), {P1, P2, IMM8M1U4, R3}}, + {"cmp4.gtu.unc", A2, OpX2TaC (0xd, 3, 0, 1), {P2, P1, IMM8M1U4, R3}}, + {"cmp4.geu.unc", A2, OpX2TaC (0xd, 3, 0, 1), {P2, P1, IMM8U4, R3}}, + {"cmp4.eq.or", A2, OpX2TaC (0xd, 3, 1, 0), {P1, P2, IMM8, R3}}, + {"cmp4.ne.orcm", A2, OpX2TaC (0xd, 3, 1, 0), {P1, P2, IMM8, R3}, PSEUDO}, + {"cmp4.ne.or", A2, OpX2TaC (0xd, 3, 1, 1), {P1, P2, IMM8, R3}}, + {"cmp4.eq.orcm", A2, OpX2TaC (0xd, 3, 1, 1), {P1, P2, IMM8, R3}, PSEUDO}, + {"cmp.eq", A2, OpX2TbTaC (0xe, 0, 0, 0, 0), {P1, P2, R2, R3}}, + {"cmp.ne", A2, OpX2TbTaC (0xe, 0, 0, 0, 0), {P2, P1, R2, R3}}, + {"cmp.eq.unc", A2, OpX2TbTaC (0xe, 0, 0, 0, 1), {P1, P2, R2, R3}}, + {"cmp.ne.unc", A2, OpX2TbTaC (0xe, 0, 0, 0, 1), {P2, P1, R2, R3}}, + {"cmp.eq.or.andcm", A2, OpX2TbTaC (0xe, 0, 0, 1, 0), {P1, P2, R2, R3}}, + {"cmp.ne.and.orcm", A2, OpX2TbTaC (0xe, 0, 0, 1, 0), {P2, P1, R2, R3}, PSEUDO}, + {"cmp.ne.or.andcm", A2, OpX2TbTaC (0xe, 0, 0, 1, 1), {P1, P2, R2, R3}}, + {"cmp.eq.and.orcm", A2, OpX2TbTaC (0xe, 0, 0, 1, 1), {P2, P1, R2, R3}, PSEUDO}, + {"cmp4.eq", A2, OpX2TbTaC (0xe, 1, 0, 0, 0), {P1, P2, R2, R3}}, + {"cmp4.ne", A2, OpX2TbTaC (0xe, 1, 0, 0, 0), {P2, P1, R2, R3}}, + {"cmp4.eq.unc", A2, OpX2TbTaC (0xe, 1, 0, 0, 1), {P1, P2, R2, R3}}, + {"cmp4.ne.unc", A2, OpX2TbTaC (0xe, 1, 0, 0, 1), {P2, P1, R2, R3}}, + {"cmp4.eq.or.andcm", A2, OpX2TbTaC (0xe, 1, 0, 1, 0), {P1, P2, R2, R3}}, + {"cmp4.ne.and.orcm", A2, OpX2TbTaC (0xe, 1, 0, 1, 0), {P2, P1, R2, R3}, PSEUDO}, + {"cmp4.ne.or.andcm", A2, OpX2TbTaC (0xe, 1, 0, 1, 1), {P1, P2, R2, R3}}, + {"cmp4.eq.and.orcm", A2, OpX2TbTaC (0xe, 1, 0, 1, 1), {P2, P1, R2, R3}, PSEUDO}, + {"cmp.gt.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 0), {P1, P2, GR0, R3}}, + {"cmp.lt.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp.le.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 0), {P2, P1, GR0, R3}, PSEUDO}, + {"cmp.ge.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 0), {P2, P1, R3, GR0}, PSEUDO}, + {"cmp.le.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 1), {P1, P2, GR0, R3}}, + {"cmp.ge.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp.gt.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 1), {P2, P1, GR0, R3}, PSEUDO}, + {"cmp.lt.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 0, 1), {P2, P1, R3, GR0}, PSEUDO}, + {"cmp.ge.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 0), {P1, P2, GR0, R3}}, + {"cmp.le.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp.lt.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 0), {P2, P1, GR0, R3}, PSEUDO}, + {"cmp.gt.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 0), {P2, P1, R3, GR0}, PSEUDO}, + {"cmp.lt.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 1), {P1, P2, GR0, R3}}, + {"cmp.gt.or.andcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp.ge.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 1), {P2, P1, GR0, R3}, PSEUDO}, + {"cmp.le.and.orcm", A2, OpX2TbTaC (0xe, 0, 1, 1, 1), {P2, P1, R3, GR0}, PSEUDO}, + {"cmp4.gt.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 0), {P1, P2, GR0, R3}}, + {"cmp4.lt.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 0), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp4.le.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 0), {P2, P1, GR0, R3}, PSEUDO}, + {"cmp4.ge.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 0), {P2, P1, R3, GR0}, PSEUDO}, + {"cmp4.le.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 1), {P1, P2, GR0, R3}}, + {"cmp4.ge.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 1), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp4.gt.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 1), {P2, P1, GR0, R3}, PSEUDO}, + {"cmp4.lt.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 0, 1), {P2, P1, R3, GR0}, PSEUDO}, + {"cmp4.ge.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 0), {P1, P2, GR0, R3}}, + {"cmp4.le.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 0), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp4.lt.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 0), {P2, P1, GR0, R3}, PSEUDO}, + {"cmp4.gt.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 0), {P2, P1, R3, GR0}, PSEUDO}, + {"cmp4.lt.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 1), {P1, P2, GR0, R3}}, + {"cmp4.gt.or.andcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 1), {P1, P2, R3, GR0}, PSEUDO}, + {"cmp4.ge.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 1), {P2, P1, GR0, R3}, PSEUDO}, + {"cmp4.le.and.orcm", A2, OpX2TbTaC (0xe, 1, 1, 1, 1), {P2, P1, R3, GR0}, PSEUDO}, + {"cmp.eq", A2, OpX2TaC (0xe, 2, 0, 0), {P1, P2, IMM8, R3}}, + {"cmp.ne", A2, OpX2TaC (0xe, 2, 0, 0), {P2, P1, IMM8, R3}}, + {"cmp.eq.unc", A2, OpX2TaC (0xe, 2, 0, 1), {P1, P2, IMM8, R3}}, + {"cmp.ne.unc", A2, OpX2TaC (0xe, 2, 0, 1), {P2, P1, IMM8, R3}}, + {"cmp.eq.or.andcm", A2, OpX2TaC (0xe, 2, 1, 0), {P1, P2, IMM8, R3}}, + {"cmp.ne.and.orcm", A2, OpX2TaC (0xe, 2, 1, 0), {P2, P1, IMM8, R3}, PSEUDO}, + {"cmp.ne.or.andcm", A2, OpX2TaC (0xe, 2, 1, 1), {P1, P2, IMM8, R3}}, + {"cmp.eq.and.orcm", A2, OpX2TaC (0xe, 2, 1, 1), {P2, P1, IMM8, R3}, PSEUDO}, + {"cmp4.eq", A2, OpX2TaC (0xe, 3, 0, 0), {P1, P2, IMM8, R3}}, + {"cmp4.ne", A2, OpX2TaC (0xe, 3, 0, 0), {P2, P1, IMM8, R3}}, + {"cmp4.eq.unc", A2, OpX2TaC (0xe, 3, 0, 1), {P1, P2, IMM8, R3}}, + {"cmp4.ne.unc", A2, OpX2TaC (0xe, 3, 0, 1), {P2, P1, IMM8, R3}}, + {"cmp4.eq.or.andcm", A2, OpX2TaC (0xe, 3, 1, 0), {P1, P2, IMM8, R3}}, + {"cmp4.ne.and.orcm", A2, OpX2TaC (0xe, 3, 1, 0), {P2, P1, IMM8, R3}, PSEUDO}, + {"cmp4.ne.or.andcm", A2, OpX2TaC (0xe, 3, 1, 1), {P1, P2, IMM8, R3}}, + {"cmp4.eq.and.orcm", A2, OpX2TaC (0xe, 3, 1, 1), {P2, P1, IMM8, R3}, PSEUDO}, + + {0} + }; + +#undef A +#undef A2 +#undef bC +#undef bImm14 +#undef bR3a +#undef bR3b +#undef bTa +#undef bTb +#undef bVe +#undef bX +#undef bX2 +#undef bX2a +#undef bX2b +#undef bX4 +#undef bZa +#undef bZb +#undef mC +#undef mImm14 +#undef mR3a +#undef mR3b +#undef mTa +#undef mTb +#undef mVe +#undef mX +#undef mX2 +#undef mX2a +#undef mX2b +#undef mX4 +#undef mZa +#undef mZb +#undef OpR3a +#undef OpR3b +#undef OpX2aVe +#undef OpX2aVeImm14 +#undef OpX2aVeX4 +#undef OpX2aVeX4X2b +#undef OpX2TbTaC +#undef OpX2TaC +#undef OpX2aZaZbX4 +#undef OpX2aZaZbX4X2b diff --git a/contrib/binutils/opcodes/ia64-opc-b.c b/contrib/binutils/opcodes/ia64-opc-b.c new file mode 100644 index 0000000..9772b37 --- /dev/null +++ b/contrib/binutils/opcodes/ia64-opc-b.c @@ -0,0 +1,489 @@ +/* ia64-opc-b.c -- IA-64 `B' opcode table. + Copyright 1998, 1999, 2000 Free Software Foundation, Inc. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + This file is part of GDB, GAS, and the GNU binutils. + + GDB, GAS, and the GNU binutils are free software; you can redistribute + them and/or modify them under the terms of the GNU General Public + License as published by the Free Software Foundation; either version + 2, or (at your option) any later version. + + GDB, GAS, and the GNU binutils are distributed in the hope that they + will be useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this file; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#include "ia64-opc.h" + +#define B0 IA64_TYPE_B, 0 +#define B IA64_TYPE_B, 1 + +/* instruction bit fields: */ +#define bBtype(x) (((ia64_insn) ((x) & 0x7)) << 6) +#define bD(x) (((ia64_insn) ((x) & 0x1)) << 35) +#define bIh(x) (((ia64_insn) ((x) & 0x1)) << 35) +#define bPa(x) (((ia64_insn) ((x) & 0x1)) << 12) +#define bPr(x) (((ia64_insn) ((x) & 0x3f)) << 0) +#define bWha(x) (((ia64_insn) ((x) & 0x3)) << 33) +#define bWhb(x) (((ia64_insn) ((x) & 0x3)) << 3) +#define bX6(x) (((ia64_insn) ((x) & 0x3f)) << 27) + +#define mBtype bBtype (-1) +#define mD bD (-1) +#define mIh bIh (-1) +#define mPa bPa (-1) +#define mPr bPr (-1) +#define mWha bWha (-1) +#define mWhb bWhb (-1) +#define mX6 bX6 (-1) + +#define OpX6(a,b) (bOp (a) | bX6 (b)), (mOp | mX6) +#define OpPaWhaD(a,b,c,d) \ + (bOp (a) | bPa (b) | bWha (c) | bD (d)), (mOp | mPa | mWha | mD) +#define OpBtypePaWhaD(a,b,c,d,e) \ + (bOp (a) | bBtype (b) | bPa (c) | bWha (d) | bD (e)), \ + (mOp | mBtype | mPa | mWha | mD) +#define OpBtypePaWhaDPr(a,b,c,d,e,f) \ + (bOp (a) | bBtype (b) | bPa (c) | bWha (d) | bD (e) | bPr (f)), \ + (mOp | mBtype | mPa | mWha | mD | mPr) +#define OpX6BtypePaWhaD(a,b,c,d,e,f) \ + (bOp (a) | bX6 (b) | bBtype (c) | bPa (d) | bWha (e) | bD (f)), \ + (mOp | mX6 | mBtype | mPa | mWha | mD) +#define OpX6BtypePaWhaDPr(a,b,c,d,e,f,g) \ + (bOp (a) | bX6 (b) | bBtype (c) | bPa (d) | bWha (e) | bD (f) | bPr (g)), \ + (mOp | mX6 | mBtype | mPa | mWha | mD | mPr) +#define OpIhWhb(a,b,c) \ + (bOp (a) | bIh (b) | bWhb (c)), \ + (mOp | mIh | mWhb) +#define OpX6IhWhb(a,b,c,d) \ + (bOp (a) | bX6 (b) | bIh (c) | bWhb (d)), \ + (mOp | mX6 | mIh | mWhb) + +struct ia64_opcode ia64_opcodes_b[] = + { + /* B-type instruction encodings (sorted according to major opcode) */ + +#define BR(a,b) \ + B0, OpX6BtypePaWhaDPr (0, 0x20, 0, a, 0, b, 0), {B2}, PSEUDO + {"br.few", BR (0, 0)}, + {"br", BR (0, 0)}, + {"br.few.clr", BR (0, 1)}, + {"br.clr", BR (0, 1)}, + {"br.many", BR (1, 0)}, + {"br.many.clr", BR (1, 1)}, +#undef BR + +#define BR(a,b,c,d,e) B0, OpX6BtypePaWhaD (0, a, b, c, d, e), {B2} + {"br.cond.sptk.few", BR (0x20, 0, 0, 0, 0)}, + {"br.cond.sptk", BR (0x20, 0, 0, 0, 0), PSEUDO}, + {"br.cond.sptk.few.clr", BR (0x20, 0, 0, 0, 1)}, + {"br.cond.sptk.clr", BR (0x20, 0, 0, 0, 1), PSEUDO}, + {"br.cond.spnt.few", BR (0x20, 0, 0, 1, 0)}, + {"br.cond.spnt", BR (0x20, 0, 0, 1, 0), PSEUDO}, + {"br.cond.spnt.few.clr", BR (0x20, 0, 0, 1, 1)}, + {"br.cond.spnt.clr", BR (0x20, 0, 0, 1, 1), PSEUDO}, + {"br.cond.dptk.few", BR (0x20, 0, 0, 2, 0)}, + {"br.cond.dptk", BR (0x20, 0, 0, 2, 0), PSEUDO}, + {"br.cond.dptk.few.clr", BR (0x20, 0, 0, 2, 1)}, + {"br.cond.dptk.clr", BR (0x20, 0, 0, 2, 1), PSEUDO}, + {"br.cond.dpnt.few", BR (0x20, 0, 0, 3, 0)}, + {"br.cond.dpnt", BR (0x20, 0, 0, 3, 0), PSEUDO}, + {"br.cond.dpnt.few.clr", BR (0x20, 0, 0, 3, 1)}, + {"br.cond.dpnt.clr", BR (0x20, 0, 0, 3, 1), PSEUDO}, + {"br.cond.sptk.many", BR (0x20, 0, 1, 0, 0)}, + {"br.cond.sptk.many.clr", BR (0x20, 0, 1, 0, 1)}, + {"br.cond.spnt.many", BR (0x20, 0, 1, 1, 0)}, + {"br.cond.spnt.many.clr", BR (0x20, 0, 1, 1, 1)}, + {"br.cond.dptk.many", BR (0x20, 0, 1, 2, 0)}, + {"br.cond.dptk.many.clr", BR (0x20, 0, 1, 2, 1)}, + {"br.cond.dpnt.many", BR (0x20, 0, 1, 3, 0)}, + {"br.cond.dpnt.many.clr", BR (0x20, 0, 1, 3, 1)}, + {"br.sptk.few", BR (0x20, 0, 0, 0, 0)}, + {"br.sptk", BR (0x20, 0, 0, 0, 0), PSEUDO}, + {"br.sptk.few.clr", BR (0x20, 0, 0, 0, 1)}, + {"br.sptk.clr", BR (0x20, 0, 0, 0, 1), PSEUDO}, + {"br.spnt.few", BR (0x20, 0, 0, 1, 0)}, + {"br.spnt", BR (0x20, 0, 0, 1, 0), PSEUDO}, + {"br.spnt.few.clr", BR (0x20, 0, 0, 1, 1)}, + {"br.spnt.clr", BR (0x20, 0, 0, 1, 1), PSEUDO}, + {"br.dptk.few", BR (0x20, 0, 0, 2, 0)}, + {"br.dptk", BR (0x20, 0, 0, 2, 0), PSEUDO}, + {"br.dptk.few.clr", BR (0x20, 0, 0, 2, 1)}, + {"br.dptk.clr", BR (0x20, 0, 0, 2, 1), PSEUDO}, + {"br.dpnt.few", BR (0x20, 0, 0, 3, 0)}, + {"br.dpnt", BR (0x20, 0, 0, 3, 0), PSEUDO}, + {"br.dpnt.few.clr", BR (0x20, 0, 0, 3, 1)}, + {"br.dpnt.clr", BR (0x20, 0, 0, 3, 1), PSEUDO}, + {"br.sptk.many", BR (0x20, 0, 1, 0, 0)}, + {"br.sptk.many.clr", BR (0x20, 0, 1, 0, 1)}, + {"br.spnt.many", BR (0x20, 0, 1, 1, 0)}, + {"br.spnt.many.clr", BR (0x20, 0, 1, 1, 1)}, + {"br.dptk.many", BR (0x20, 0, 1, 2, 0)}, + {"br.dptk.many.clr", BR (0x20, 0, 1, 2, 1)}, + {"br.dpnt.many", BR (0x20, 0, 1, 3, 0)}, + {"br.dpnt.many.clr", BR (0x20, 0, 1, 3, 1)}, + {"br.ia.sptk.few", BR (0x20, 1, 0, 0, 0)}, + {"br.ia.sptk", BR (0x20, 1, 0, 0, 0), PSEUDO}, + {"br.ia.sptk.few.clr", BR (0x20, 1, 0, 0, 1)}, + {"br.ia.sptk.clr", BR (0x20, 1, 0, 0, 1), PSEUDO}, + {"br.ia.spnt.few", BR (0x20, 1, 0, 1, 0)}, + {"br.ia.spnt", BR (0x20, 1, 0, 1, 0), PSEUDO}, + {"br.ia.spnt.few.clr", BR (0x20, 1, 0, 1, 1)}, + {"br.ia.spnt.clr", BR (0x20, 1, 0, 1, 1), PSEUDO}, + {"br.ia.dptk.few", BR (0x20, 1, 0, 2, 0)}, + {"br.ia.dptk", BR (0x20, 1, 0, 2, 0), PSEUDO}, + {"br.ia.dptk.few.clr", BR (0x20, 1, 0, 2, 1)}, + {"br.ia.dptk.clr", BR (0x20, 1, 0, 2, 1), PSEUDO}, + {"br.ia.dpnt.few", BR (0x20, 1, 0, 3, 0)}, + {"br.ia.dpnt", BR (0x20, 1, 0, 3, 0), PSEUDO}, + {"br.ia.dpnt.few.clr", BR (0x20, 1, 0, 3, 1)}, + {"br.ia.dpnt.clr", BR (0x20, 1, 0, 3, 1), PSEUDO}, + {"br.ia.sptk.many", BR (0x20, 1, 1, 0, 0)}, + {"br.ia.sptk.many.clr", BR (0x20, 1, 1, 0, 1)}, + {"br.ia.spnt.many", BR (0x20, 1, 1, 1, 0)}, + {"br.ia.spnt.many.clr", BR (0x20, 1, 1, 1, 1)}, + {"br.ia.dptk.many", BR (0x20, 1, 1, 2, 0)}, + {"br.ia.dptk.many.clr", BR (0x20, 1, 1, 2, 1)}, + {"br.ia.dpnt.many", BR (0x20, 1, 1, 3, 0)}, + {"br.ia.dpnt.many.clr", BR (0x20, 1, 1, 3, 1)}, + {"br.ret.sptk.few", BR (0x21, 4, 0, 0, 0), MOD_RRBS}, + {"br.ret.sptk", BR (0x21, 4, 0, 0, 0), PSEUDO | MOD_RRBS}, + {"br.ret.sptk.few.clr", BR (0x21, 4, 0, 0, 1), MOD_RRBS}, + {"br.ret.sptk.clr", BR (0x21, 4, 0, 0, 1), PSEUDO | MOD_RRBS}, + {"br.ret.spnt.few", BR (0x21, 4, 0, 1, 0), MOD_RRBS}, + {"br.ret.spnt", BR (0x21, 4, 0, 1, 0), PSEUDO | MOD_RRBS}, + {"br.ret.spnt.few.clr", BR (0x21, 4, 0, 1, 1), MOD_RRBS}, + {"br.ret.spnt.clr", BR (0x21, 4, 0, 1, 1), PSEUDO | MOD_RRBS}, + {"br.ret.dptk.few", BR (0x21, 4, 0, 2, 0), MOD_RRBS}, + {"br.ret.dptk", BR (0x21, 4, 0, 2, 0), PSEUDO | MOD_RRBS}, + {"br.ret.dptk.few.clr", BR (0x21, 4, 0, 2, 1), MOD_RRBS}, + {"br.ret.dptk.clr", BR (0x21, 4, 0, 2, 1), PSEUDO | MOD_RRBS}, + {"br.ret.dpnt.few", BR (0x21, 4, 0, 3, 0), MOD_RRBS}, + {"br.ret.dpnt", BR (0x21, 4, 0, 3, 0), PSEUDO | MOD_RRBS}, + {"br.ret.dpnt.few.clr", BR (0x21, 4, 0, 3, 1), MOD_RRBS}, + {"br.ret.dpnt.clr", BR (0x21, 4, 0, 3, 1), PSEUDO | MOD_RRBS}, + {"br.ret.sptk.many", BR (0x21, 4, 1, 0, 0), MOD_RRBS}, + {"br.ret.sptk.many.clr", BR (0x21, 4, 1, 0, 1), MOD_RRBS}, + {"br.ret.spnt.many", BR (0x21, 4, 1, 1, 0), MOD_RRBS}, + {"br.ret.spnt.many.clr", BR (0x21, 4, 1, 1, 1), MOD_RRBS}, + {"br.ret.dptk.many", BR (0x21, 4, 1, 2, 0), MOD_RRBS}, + {"br.ret.dptk.many.clr", BR (0x21, 4, 1, 2, 1), MOD_RRBS}, + {"br.ret.dpnt.many", BR (0x21, 4, 1, 3, 0), MOD_RRBS}, + {"br.ret.dpnt.many.clr", BR (0x21, 4, 1, 3, 1), MOD_RRBS}, +#undef BR + + {"cover", B0, OpX6 (0, 0x02), {0, }, NO_PRED | LAST | MOD_RRBS}, + {"clrrrb", B0, OpX6 (0, 0x04), {0, }, NO_PRED | LAST | MOD_RRBS}, + {"clrrrb.pr", B0, OpX6 (0, 0x05), {0, }, NO_PRED | LAST | MOD_RRBS}, + {"rfi", B0, OpX6 (0, 0x08), {0, }, NO_PRED | LAST | PRIV | MOD_RRBS}, + {"bsw.0", B0, OpX6 (0, 0x0c), {0, }, NO_PRED | LAST | PRIV}, + {"bsw.1", B0, OpX6 (0, 0x0d), {0, }, NO_PRED | LAST | PRIV}, + {"epc", B0, OpX6 (0, 0x10), {0, }, NO_PRED}, + + {"break.b", B0, OpX6 (0, 0x00), {IMMU21}}, + + {"br.call.sptk.few", B, OpPaWhaD (1, 0, 0, 0), {B1, B2}}, + {"br.call.sptk", B, OpPaWhaD (1, 0, 0, 0), {B1, B2}, PSEUDO}, + {"br.call.sptk.few.clr", B, OpPaWhaD (1, 0, 0, 1), {B1, B2}}, + {"br.call.sptk.clr", B, OpPaWhaD (1, 0, 0, 1), {B1, B2}, PSEUDO}, + {"br.call.spnt.few", B, OpPaWhaD (1, 0, 1, 0), {B1, B2}}, + {"br.call.spnt", B, OpPaWhaD (1, 0, 1, 0), {B1, B2}, PSEUDO}, + {"br.call.spnt.few.clr", B, OpPaWhaD (1, 0, 1, 1), {B1, B2}}, + {"br.call.spnt.clr", B, OpPaWhaD (1, 0, 1, 1), {B1, B2}, PSEUDO}, + {"br.call.dptk.few", B, OpPaWhaD (1, 0, 2, 0), {B1, B2}}, + {"br.call.dptk", B, OpPaWhaD (1, 0, 2, 0), {B1, B2}, PSEUDO}, + {"br.call.dptk.few.clr", B, OpPaWhaD (1, 0, 2, 1), {B1, B2}}, + {"br.call.dptk.clr", B, OpPaWhaD (1, 0, 2, 1), {B1, B2}, PSEUDO}, + {"br.call.dpnt.few", B, OpPaWhaD (1, 0, 3, 0), {B1, B2}}, + {"br.call.dpnt", B, OpPaWhaD (1, 0, 3, 0), {B1, B2}, PSEUDO}, + {"br.call.dpnt.few.clr", B, OpPaWhaD (1, 0, 3, 1), {B1, B2}}, + {"br.call.dpnt.clr", B, OpPaWhaD (1, 0, 3, 1), {B1, B2}, PSEUDO}, + {"br.call.sptk.many", B, OpPaWhaD (1, 1, 0, 0), {B1, B2}}, + {"br.call.sptk.many.clr", B, OpPaWhaD (1, 1, 0, 1), {B1, B2}}, + {"br.call.spnt.many", B, OpPaWhaD (1, 1, 1, 0), {B1, B2}}, + {"br.call.spnt.many.clr", B, OpPaWhaD (1, 1, 1, 1), {B1, B2}}, + {"br.call.dptk.many", B, OpPaWhaD (1, 1, 2, 0), {B1, B2}}, + {"br.call.dptk.many.clr", B, OpPaWhaD (1, 1, 2, 1), {B1, B2}}, + {"br.call.dpnt.many", B, OpPaWhaD (1, 1, 3, 0), {B1, B2}}, + {"br.call.dpnt.many.clr", B, OpPaWhaD (1, 1, 3, 1), {B1, B2}}, + +#define BRP(a,b,c) \ + B0, OpX6IhWhb (2, a, b, c), {B2, TAG13}, NO_PRED + {"brp.sptk", BRP (0x10, 0, 0)}, + {"brp.dptk", BRP (0x10, 0, 2)}, + {"brp.sptk.imp", BRP (0x10, 1, 0)}, + {"brp.dptk.imp", BRP (0x10, 1, 2)}, + {"brp.ret.sptk", BRP (0x11, 0, 0)}, + {"brp.ret.dptk", BRP (0x11, 0, 2)}, + {"brp.ret.sptk.imp", BRP (0x11, 1, 0)}, + {"brp.ret.dptk.imp", BRP (0x11, 1, 2)}, +#undef BRP + + {"nop.b", B0, OpX6 (2, 0x00), {IMMU21}}, + +#define BR(a,b) \ + B0, OpBtypePaWhaDPr (4, 0, a, 0, b, 0), {TGT25c}, PSEUDO + {"br.few", BR (0, 0)}, + {"br", BR (0, 0)}, + {"br.few.clr", BR (0, 1)}, + {"br.clr", BR (0, 1)}, + {"br.many", BR (1, 0)}, + {"br.many.clr", BR (1, 1)}, +#undef BR + +#define BR(a,b,c) \ + B0, OpBtypePaWhaD (4, 0, a, b, c), {TGT25c} + {"br.cond.sptk.few", BR (0, 0, 0)}, + {"br.cond.sptk", BR (0, 0, 0), PSEUDO}, + {"br.cond.sptk.few.clr", BR (0, 0, 1)}, + {"br.cond.sptk.clr", BR (0, 0, 1), PSEUDO}, + {"br.cond.spnt.few", BR (0, 1, 0)}, + {"br.cond.spnt", BR (0, 1, 0), PSEUDO}, + {"br.cond.spnt.few.clr", BR (0, 1, 1)}, + {"br.cond.spnt.clr", BR (0, 1, 1), PSEUDO}, + {"br.cond.dptk.few", BR (0, 2, 0)}, + {"br.cond.dptk", BR (0, 2, 0), PSEUDO}, + {"br.cond.dptk.few.clr", BR (0, 2, 1)}, + {"br.cond.dptk.clr", BR (0, 2, 1), PSEUDO}, + {"br.cond.dpnt.few", BR (0, 3, 0)}, + {"br.cond.dpnt", BR (0, 3, 0), PSEUDO}, + {"br.cond.dpnt.few.clr", BR (0, 3, 1)}, + {"br.cond.dpnt.clr", BR (0, 3, 1), PSEUDO}, + {"br.cond.sptk.many", BR (1, 0, 0)}, + {"br.cond.sptk.many.clr", BR (1, 0, 1)}, + {"br.cond.spnt.many", BR (1, 1, 0)}, + {"br.cond.spnt.many.clr", BR (1, 1, 1)}, + {"br.cond.dptk.many", BR (1, 2, 0)}, + {"br.cond.dptk.many.clr", BR (1, 2, 1)}, + {"br.cond.dpnt.many", BR (1, 3, 0)}, + {"br.cond.dpnt.many.clr", BR (1, 3, 1)}, + {"br.sptk.few", BR (0, 0, 0)}, + {"br.sptk", BR (0, 0, 0), PSEUDO}, + {"br.sptk.few.clr", BR (0, 0, 1)}, + {"br.sptk.clr", BR (0, 0, 1), PSEUDO}, + {"br.spnt.few", BR (0, 1, 0)}, + {"br.spnt", BR (0, 1, 0), PSEUDO}, + {"br.spnt.few.clr", BR (0, 1, 1)}, + {"br.spnt.clr", BR (0, 1, 1), PSEUDO}, + {"br.dptk.few", BR (0, 2, 0)}, + {"br.dptk", BR (0, 2, 0), PSEUDO}, + {"br.dptk.few.clr", BR (0, 2, 1)}, + {"br.dptk.clr", BR (0, 2, 1), PSEUDO}, + {"br.dpnt.few", BR (0, 3, 0)}, + {"br.dpnt", BR (0, 3, 0), PSEUDO}, + {"br.dpnt.few.clr", BR (0, 3, 1)}, + {"br.dpnt.clr", BR (0, 3, 1), PSEUDO}, + {"br.sptk.many", BR (1, 0, 0)}, + {"br.sptk.many.clr", BR (1, 0, 1)}, + {"br.spnt.many", BR (1, 1, 0)}, + {"br.spnt.many.clr", BR (1, 1, 1)}, + {"br.dptk.many", BR (1, 2, 0)}, + {"br.dptk.many.clr", BR (1, 2, 1)}, + {"br.dpnt.many", BR (1, 3, 0)}, + {"br.dpnt.many.clr", BR (1, 3, 1)}, +#undef BR + +#define BR(a,b,c,d) \ + B0, OpBtypePaWhaD (4, a, b, c, d), {TGT25c}, SLOT2 + {"br.wexit.sptk.few", BR (2, 0, 0, 0) | MOD_RRBS}, + {"br.wexit.sptk", BR (2, 0, 0, 0) | PSEUDO | MOD_RRBS}, + {"br.wexit.sptk.few.clr", BR (2, 0, 0, 1) | MOD_RRBS}, + {"br.wexit.sptk.clr", BR (2, 0, 0, 1) | PSEUDO | MOD_RRBS}, + {"br.wexit.spnt.few", BR (2, 0, 1, 0) | MOD_RRBS}, + {"br.wexit.spnt", BR (2, 0, 1, 0) | PSEUDO | MOD_RRBS}, + {"br.wexit.spnt.few.clr", BR (2, 0, 1, 1) | MOD_RRBS}, + {"br.wexit.spnt.clr", BR (2, 0, 1, 1) | PSEUDO | MOD_RRBS}, + {"br.wexit.dptk.few", BR (2, 0, 2, 0) | MOD_RRBS}, + {"br.wexit.dptk", BR (2, 0, 2, 0) | PSEUDO | MOD_RRBS}, + {"br.wexit.dptk.few.clr", BR (2, 0, 2, 1) | MOD_RRBS}, + {"br.wexit.dptk.clr", BR (2, 0, 2, 1) | PSEUDO | MOD_RRBS}, + {"br.wexit.dpnt.few", BR (2, 0, 3, 0) | MOD_RRBS}, + {"br.wexit.dpnt", BR (2, 0, 3, 0) | PSEUDO | MOD_RRBS}, + {"br.wexit.dpnt.few.clr", BR (2, 0, 3, 1) | MOD_RRBS}, + {"br.wexit.dpnt.clr", BR (2, 0, 3, 1) | PSEUDO | MOD_RRBS}, + {"br.wexit.sptk.many", BR (2, 1, 0, 0) | MOD_RRBS}, + {"br.wexit.sptk.many.clr", BR (2, 1, 0, 1) | MOD_RRBS}, + {"br.wexit.spnt.many", BR (2, 1, 1, 0) | MOD_RRBS}, + {"br.wexit.spnt.many.clr", BR (2, 1, 1, 1) | MOD_RRBS}, + {"br.wexit.dptk.many", BR (2, 1, 2, 0) | MOD_RRBS}, + {"br.wexit.dptk.many.clr", BR (2, 1, 2, 1) | MOD_RRBS}, + {"br.wexit.dpnt.many", BR (2, 1, 3, 0) | MOD_RRBS}, + {"br.wexit.dpnt.many.clr", BR (2, 1, 3, 1) | MOD_RRBS}, + {"br.wtop.sptk.few", BR (3, 0, 0, 0) | MOD_RRBS}, + {"br.wtop.sptk", BR (3, 0, 0, 0) | PSEUDO | MOD_RRBS}, + {"br.wtop.sptk.few.clr", BR (3, 0, 0, 1) | MOD_RRBS}, + {"br.wtop.sptk.clr", BR (3, 0, 0, 1) | PSEUDO | MOD_RRBS}, + {"br.wtop.spnt.few", BR (3, 0, 1, 0) | MOD_RRBS}, + {"br.wtop.spnt", BR (3, 0, 1, 0) | PSEUDO | MOD_RRBS}, + {"br.wtop.spnt.few.clr", BR (3, 0, 1, 1) | MOD_RRBS}, + {"br.wtop.spnt.clr", BR (3, 0, 1, 1) | PSEUDO | MOD_RRBS}, + {"br.wtop.dptk.few", BR (3, 0, 2, 0) | MOD_RRBS}, + {"br.wtop.dptk", BR (3, 0, 2, 0) | PSEUDO | MOD_RRBS}, + {"br.wtop.dptk.few.clr", BR (3, 0, 2, 1) | MOD_RRBS}, + {"br.wtop.dptk.clr", BR (3, 0, 2, 1) | PSEUDO | MOD_RRBS}, + {"br.wtop.dpnt.few", BR (3, 0, 3, 0) | MOD_RRBS}, + {"br.wtop.dpnt", BR (3, 0, 3, 0) | PSEUDO | MOD_RRBS}, + {"br.wtop.dpnt.few.clr", BR (3, 0, 3, 1) | MOD_RRBS}, + {"br.wtop.dpnt.clr", BR (3, 0, 3, 1) | PSEUDO | MOD_RRBS}, + {"br.wtop.sptk.many", BR (3, 1, 0, 0) | MOD_RRBS}, + {"br.wtop.sptk.many.clr", BR (3, 1, 0, 1) | MOD_RRBS}, + {"br.wtop.spnt.many", BR (3, 1, 1, 0) | MOD_RRBS}, + {"br.wtop.spnt.many.clr", BR (3, 1, 1, 1) | MOD_RRBS}, + {"br.wtop.dptk.many", BR (3, 1, 2, 0) | MOD_RRBS}, + {"br.wtop.dptk.many.clr", BR (3, 1, 2, 1) | MOD_RRBS}, + {"br.wtop.dpnt.many", BR (3, 1, 3, 0) | MOD_RRBS}, + {"br.wtop.dpnt.many.clr", BR (3, 1, 3, 1) | MOD_RRBS}, + +#undef BR +#define BR(a,b,c,d) \ + B0, OpBtypePaWhaD (4, a, b, c, d), {TGT25c}, SLOT2 | NO_PRED + {"br.cloop.sptk.few", BR (5, 0, 0, 0)}, + {"br.cloop.sptk", BR (5, 0, 0, 0) | PSEUDO}, + {"br.cloop.sptk.few.clr", BR (5, 0, 0, 1)}, + {"br.cloop.sptk.clr", BR (5, 0, 0, 1) | PSEUDO}, + {"br.cloop.spnt.few", BR (5, 0, 1, 0)}, + {"br.cloop.spnt", BR (5, 0, 1, 0) | PSEUDO}, + {"br.cloop.spnt.few.clr", BR (5, 0, 1, 1)}, + {"br.cloop.spnt.clr", BR (5, 0, 1, 1) | PSEUDO}, + {"br.cloop.dptk.few", BR (5, 0, 2, 0)}, + {"br.cloop.dptk", BR (5, 0, 2, 0) | PSEUDO}, + {"br.cloop.dptk.few.clr", BR (5, 0, 2, 1)}, + {"br.cloop.dptk.clr", BR (5, 0, 2, 1) | PSEUDO}, + {"br.cloop.dpnt.few", BR (5, 0, 3, 0)}, + {"br.cloop.dpnt", BR (5, 0, 3, 0) | PSEUDO}, + {"br.cloop.dpnt.few.clr", BR (5, 0, 3, 1)}, + {"br.cloop.dpnt.clr", BR (5, 0, 3, 1) | PSEUDO}, + {"br.cloop.sptk.many", BR (5, 1, 0, 0)}, + {"br.cloop.sptk.many.clr", BR (5, 1, 0, 1)}, + {"br.cloop.spnt.many", BR (5, 1, 1, 0)}, + {"br.cloop.spnt.many.clr", BR (5, 1, 1, 1)}, + {"br.cloop.dptk.many", BR (5, 1, 2, 0)}, + {"br.cloop.dptk.many.clr", BR (5, 1, 2, 1)}, + {"br.cloop.dpnt.many", BR (5, 1, 3, 0)}, + {"br.cloop.dpnt.many.clr", BR (5, 1, 3, 1)}, + {"br.cexit.sptk.few", BR (6, 0, 0, 0) | MOD_RRBS}, + {"br.cexit.sptk", BR (6, 0, 0, 0) | PSEUDO | MOD_RRBS}, + {"br.cexit.sptk.few.clr", BR (6, 0, 0, 1) | MOD_RRBS}, + {"br.cexit.sptk.clr", BR (6, 0, 0, 1) | PSEUDO | MOD_RRBS}, + {"br.cexit.spnt.few", BR (6, 0, 1, 0) | MOD_RRBS}, + {"br.cexit.spnt", BR (6, 0, 1, 0) | PSEUDO | MOD_RRBS}, + {"br.cexit.spnt.few.clr", BR (6, 0, 1, 1) | MOD_RRBS}, + {"br.cexit.spnt.clr", BR (6, 0, 1, 1) | PSEUDO | MOD_RRBS}, + {"br.cexit.dptk.few", BR (6, 0, 2, 0) | MOD_RRBS}, + {"br.cexit.dptk", BR (6, 0, 2, 0) | PSEUDO | MOD_RRBS}, + {"br.cexit.dptk.few.clr", BR (6, 0, 2, 1) | MOD_RRBS}, + {"br.cexit.dptk.clr", BR (6, 0, 2, 1) | PSEUDO | MOD_RRBS}, + {"br.cexit.dpnt.few", BR (6, 0, 3, 0) | MOD_RRBS}, + {"br.cexit.dpnt", BR (6, 0, 3, 0) | PSEUDO | MOD_RRBS}, + {"br.cexit.dpnt.few.clr", BR (6, 0, 3, 1) | MOD_RRBS}, + {"br.cexit.dpnt.clr", BR (6, 0, 3, 1) | PSEUDO | MOD_RRBS}, + {"br.cexit.sptk.many", BR (6, 1, 0, 0) | MOD_RRBS}, + {"br.cexit.sptk.many.clr", BR (6, 1, 0, 1) | MOD_RRBS}, + {"br.cexit.spnt.many", BR (6, 1, 1, 0) | MOD_RRBS}, + {"br.cexit.spnt.many.clr", BR (6, 1, 1, 1) | MOD_RRBS}, + {"br.cexit.dptk.many", BR (6, 1, 2, 0) | MOD_RRBS}, + {"br.cexit.dptk.many.clr", BR (6, 1, 2, 1) | MOD_RRBS}, + {"br.cexit.dpnt.many", BR (6, 1, 3, 0) | MOD_RRBS}, + {"br.cexit.dpnt.many.clr", BR (6, 1, 3, 1) | MOD_RRBS}, + {"br.ctop.sptk.few", BR (7, 0, 0, 0) | MOD_RRBS}, + {"br.ctop.sptk", BR (7, 0, 0, 0) | PSEUDO | MOD_RRBS}, + {"br.ctop.sptk.few.clr", BR (7, 0, 0, 1) | MOD_RRBS}, + {"br.ctop.sptk.clr", BR (7, 0, 0, 1) | PSEUDO | MOD_RRBS}, + {"br.ctop.spnt.few", BR (7, 0, 1, 0) | MOD_RRBS}, + {"br.ctop.spnt", BR (7, 0, 1, 0) | PSEUDO | MOD_RRBS}, + {"br.ctop.spnt.few.clr", BR (7, 0, 1, 1) | MOD_RRBS}, + {"br.ctop.spnt.clr", BR (7, 0, 1, 1) | PSEUDO | MOD_RRBS}, + {"br.ctop.dptk.few", BR (7, 0, 2, 0) | MOD_RRBS}, + {"br.ctop.dptk", BR (7, 0, 2, 0) | PSEUDO | MOD_RRBS}, + {"br.ctop.dptk.few.clr", BR (7, 0, 2, 1) | MOD_RRBS}, + {"br.ctop.dptk.clr", BR (7, 0, 2, 1) | PSEUDO | MOD_RRBS}, + {"br.ctop.dpnt.few", BR (7, 0, 3, 0) | MOD_RRBS}, + {"br.ctop.dpnt", BR (7, 0, 3, 0) | PSEUDO | MOD_RRBS}, + {"br.ctop.dpnt.few.clr", BR (7, 0, 3, 1) | MOD_RRBS}, + {"br.ctop.dpnt.clr", BR (7, 0, 3, 1) | PSEUDO | MOD_RRBS}, + {"br.ctop.sptk.many", BR (7, 1, 0, 0) | MOD_RRBS}, + {"br.ctop.sptk.many.clr", BR (7, 1, 0, 1) | MOD_RRBS}, + {"br.ctop.spnt.many", BR (7, 1, 1, 0) | MOD_RRBS}, + {"br.ctop.spnt.many.clr", BR (7, 1, 1, 1) | MOD_RRBS}, + {"br.ctop.dptk.many", BR (7, 1, 2, 0) | MOD_RRBS}, + {"br.ctop.dptk.many.clr", BR (7, 1, 2, 1) | MOD_RRBS}, + {"br.ctop.dpnt.many", BR (7, 1, 3, 0) | MOD_RRBS}, + {"br.ctop.dpnt.many.clr", BR (7, 1, 3, 1) | MOD_RRBS}, + +#undef BR +#define BR(a,b,c,d) \ + B0, OpBtypePaWhaD (4, a, b, c, d), {TGT25c}, SLOT2 + {"br.call.sptk.few", B, OpPaWhaD (5, 0, 0, 0), {B1, TGT25c}}, + {"br.call.sptk", B, OpPaWhaD (5, 0, 0, 0), {B1, TGT25c}, PSEUDO}, + {"br.call.sptk.few.clr", B, OpPaWhaD (5, 0, 0, 1), {B1, TGT25c}}, + {"br.call.sptk.clr", B, OpPaWhaD (5, 0, 0, 1), {B1, TGT25c}, PSEUDO}, + {"br.call.spnt.few", B, OpPaWhaD (5, 0, 1, 0), {B1, TGT25c}}, + {"br.call.spnt", B, OpPaWhaD (5, 0, 1, 0), {B1, TGT25c}, PSEUDO}, + {"br.call.spnt.few.clr", B, OpPaWhaD (5, 0, 1, 1), {B1, TGT25c}}, + {"br.call.spnt.clr", B, OpPaWhaD (5, 0, 1, 1), {B1, TGT25c}, PSEUDO}, + {"br.call.dptk.few", B, OpPaWhaD (5, 0, 2, 0), {B1, TGT25c}}, + {"br.call.dptk", B, OpPaWhaD (5, 0, 2, 0), {B1, TGT25c}, PSEUDO}, + {"br.call.dptk.few.clr", B, OpPaWhaD (5, 0, 2, 1), {B1, TGT25c}}, + {"br.call.dptk.clr", B, OpPaWhaD (5, 0, 2, 1), {B1, TGT25c}, PSEUDO}, + {"br.call.dpnt.few", B, OpPaWhaD (5, 0, 3, 0), {B1, TGT25c}}, + {"br.call.dpnt", B, OpPaWhaD (5, 0, 3, 0), {B1, TGT25c}, PSEUDO}, + {"br.call.dpnt.few.clr", B, OpPaWhaD (5, 0, 3, 1), {B1, TGT25c}}, + {"br.call.dpnt.clr", B, OpPaWhaD (5, 0, 3, 1), {B1, TGT25c}, PSEUDO}, + {"br.call.sptk.many", B, OpPaWhaD (5, 1, 0, 0), {B1, TGT25c}}, + {"br.call.sptk.many.clr", B, OpPaWhaD (5, 1, 0, 1), {B1, TGT25c}}, + {"br.call.spnt.many", B, OpPaWhaD (5, 1, 1, 0), {B1, TGT25c}}, + {"br.call.spnt.many.clr", B, OpPaWhaD (5, 1, 1, 1), {B1, TGT25c}}, + {"br.call.dptk.many", B, OpPaWhaD (5, 1, 2, 0), {B1, TGT25c}}, + {"br.call.dptk.many.clr", B, OpPaWhaD (5, 1, 2, 1), {B1, TGT25c}}, + {"br.call.dpnt.many", B, OpPaWhaD (5, 1, 3, 0), {B1, TGT25c}}, + {"br.call.dpnt.many.clr", B, OpPaWhaD (5, 1, 3, 1), {B1, TGT25c}}, +#undef BR + + /* branch predict */ +#define BRP(a,b) \ + B0, OpIhWhb (7, a, b), {TGT25c, TAG13}, NO_PRED + {"brp.sptk", BRP (0, 0)}, + {"brp.loop", BRP (0, 1)}, + {"brp.dptk", BRP (0, 2)}, + {"brp.exit", BRP (0, 3)}, + {"brp.sptk.imp", BRP (1, 0)}, + {"brp.loop.imp", BRP (1, 1)}, + {"brp.dptk.imp", BRP (1, 2)}, + {"brp.exit.imp", BRP (1, 3)}, +#undef BRP + + {0} + }; + +#undef B0 +#undef B +#undef bBtype +#undef bD +#undef bIh +#undef bPa +#undef bPr +#undef bWha +#undef bWhb +#undef bX6 +#undef mBtype +#undef mD +#undef mIh +#undef mPa +#undef mPr +#undef mWha +#undef mWhb +#undef mX6 +#undef OpX6 +#undef OpPaWhaD +#undef OpBtypePaWhaD +#undef OpBtypePaWhaDPr +#undef OpX6BtypePaWhaD +#undef OpX6BtypePaWhaDPr +#undef OpIhWhb +#undef OpX6IhWhb diff --git a/contrib/binutils/opcodes/ia64-opc-d.c b/contrib/binutils/opcodes/ia64-opc-d.c new file mode 100644 index 0000000..27390f5 --- /dev/null +++ b/contrib/binutils/opcodes/ia64-opc-d.c @@ -0,0 +1,14 @@ +struct ia64_opcode ia64_opcodes_d[] = + { + {"add", IA64_TYPE_DYN, 1, 0, 0, + {IA64_OPND_R1, IA64_OPND_IMM22, IA64_OPND_R3_2}}, + {"add", IA64_TYPE_DYN, 1, 0, 0, + {IA64_OPND_R1, IA64_OPND_IMM14, IA64_OPND_R3}}, + {"break", IA64_TYPE_DYN, 0, 0, 0, {IA64_OPND_IMMU21}}, + {"chk.s", IA64_TYPE_DYN, 0, 0, 0, {IA64_OPND_R2, IA64_OPND_TGT25b}}, + {"mov", IA64_TYPE_DYN, 1, 0, 0, {IA64_OPND_R1, IA64_OPND_AR3}}, + {"mov", IA64_TYPE_DYN, 1, 0, 0, {IA64_OPND_AR3, IA64_OPND_IMM8}}, + {"mov", IA64_TYPE_DYN, 1, 0, 0, {IA64_OPND_AR3, IA64_OPND_R2}}, + {"nop", IA64_TYPE_DYN, 0, 0, 0, {IA64_OPND_IMMU21}}, + {0} + }; diff --git a/contrib/binutils/opcodes/ia64-opc-f.c b/contrib/binutils/opcodes/ia64-opc-f.c new file mode 100644 index 0000000..2f898c6 --- /dev/null +++ b/contrib/binutils/opcodes/ia64-opc-f.c @@ -0,0 +1,646 @@ +/* ia64-opc-f.c -- IA-64 `F' opcode table. + Copyright 1998, 1999, 2000 Free Software Foundation, Inc. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + This file is part of GDB, GAS, and the GNU binutils. + + GDB, GAS, and the GNU binutils are free software; you can redistribute + them and/or modify them under the terms of the GNU General Public + License as published by the Free Software Foundation; either version + 2, or (at your option) any later version. + + GDB, GAS, and the GNU binutils are distributed in the hope that they + will be useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this file; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#include "ia64-opc.h" + +#define f0 IA64_TYPE_F, 0 +#define f IA64_TYPE_F, 1 +#define f2 IA64_TYPE_F, 2 + +#define bF2(x) (((ia64_insn) ((x) & 0x7f)) << 13) +#define bF4(x) (((ia64_insn) ((x) & 0x7f)) << 27) +#define bQ(x) (((ia64_insn) ((x) & 0x1)) << 36) +#define bRa(x) (((ia64_insn) ((x) & 0x1)) << 33) +#define bRb(x) (((ia64_insn) ((x) & 0x1)) << 36) +#define bSf(x) (((ia64_insn) ((x) & 0x3)) << 34) +#define bTa(x) (((ia64_insn) ((x) & 0x1)) << 12) +#define bXa(x) (((ia64_insn) ((x) & 0x1)) << 36) +#define bXb(x) (((ia64_insn) ((x) & 0x1)) << 33) +#define bX2(x) (((ia64_insn) ((x) & 0x3)) << 34) +#define bX6(x) (((ia64_insn) ((x) & 0x3f)) << 27) + +#define mF2 bF2 (-1) +#define mF4 bF4 (-1) +#define mQ bQ (-1) +#define mRa bRa (-1) +#define mRb bRb (-1) +#define mSf bSf (-1) +#define mTa bTa (-1) +#define mXa bXa (-1) +#define mXb bXb (-1) +#define mX2 bX2 (-1) +#define mX6 bX6 (-1) + +#define OpXa(a,b) (bOp (a) | bXa (b)), (mOp | mXa) +#define OpXaSf(a,b,c) (bOp (a) | bXa (b) | bSf (c)), (mOp | mXa | mSf) +#define OpXaSfF2(a,b,c,d) \ + (bOp (a) | bXa (b) | bSf (c) | bF2 (d)), (mOp | mXa | mSf | mF2) +#define OpXaSfF4(a,b,c,d) \ + (bOp (a) | bXa (b) | bSf (c) | bF4 (d)), (mOp | mXa | mSf | mF4) +#define OpXaSfF2F4(a,b,c,d,e) \ + (bOp (a) | bXa (b) | bSf (c) | bF2 (d) | bF4 (e)), \ + (mOp | mXa | mSf | mF2 | mF4) +#define OpXaX2(a,b,c) (bOp (a) | bXa (b) | bX2 (c)), (mOp | mXa | mX2) +#define OpXaX2F2(a,b,c,d) \ + (bOp (a) | bXa (b) | bX2 (c) | bF2 (d)), (mOp | mXa | mX2 | mF2) +#define OpRaRbTaSf(a,b,c,d,e) \ + (bOp (a) | bRa (b) | bRb (c) | bTa (d) | bSf (e)), \ + (mOp | mRa | mRb | mTa | mSf) +#define OpTa(a,b) (bOp (a) | bTa (b)), (mOp | mTa) +#define OpXbQSf(a,b,c,d) \ + (bOp (a) | bXb (b) | bQ (c) | bSf (d)), (mOp | mXb | mQ | mSf) +#define OpXbX6(a,b,c) \ + (bOp (a) | bXb (b) | bX6 (c)), (mOp | mXb | mX6) +#define OpXbX6F2(a,b,c,d) \ + (bOp (a) | bXb (b) | bX6 (c) | bF2 (d)), (mOp | mXb | mX6 | mF2) +#define OpXbX6Sf(a,b,c,d) \ + (bOp (a) | bXb (b) | bX6 (c) | bSf (d)), (mOp | mXb | mX6 | mSf) + +struct ia64_opcode ia64_opcodes_f[] = + { + /* F-type instruction encodings (sorted according to major opcode) */ + + {"frcpa.s0", f2, OpXbQSf (0, 1, 0, 0), {F1, P2, F2, F3}}, + {"frcpa", f2, OpXbQSf (0, 1, 0, 0), {F1, P2, F2, F3}, PSEUDO}, + {"frcpa.s1", f2, OpXbQSf (0, 1, 0, 1), {F1, P2, F2, F3}}, + {"frcpa.s2", f2, OpXbQSf (0, 1, 0, 2), {F1, P2, F2, F3}}, + {"frcpa.s3", f2, OpXbQSf (0, 1, 0, 3), {F1, P2, F2, F3}}, + + {"frsqrta.s0", f2, OpXbQSf (0, 1, 1, 0), {F1, P2, F3}}, + {"frsqrta", f2, OpXbQSf (0, 1, 1, 0), {F1, P2, F3}, PSEUDO}, + {"frsqrta.s1", f2, OpXbQSf (0, 1, 1, 1), {F1, P2, F3}}, + {"frsqrta.s2", f2, OpXbQSf (0, 1, 1, 2), {F1, P2, F3}}, + {"frsqrta.s3", f2, OpXbQSf (0, 1, 1, 3), {F1, P2, F3}}, + + {"fmin.s0", f, OpXbX6Sf (0, 0, 0x14, 0), {F1, F2, F3}}, + {"fmin", f, OpXbX6Sf (0, 0, 0x14, 0), {F1, F2, F3}, PSEUDO}, + {"fmin.s1", f, OpXbX6Sf (0, 0, 0x14, 1), {F1, F2, F3}}, + {"fmin.s2", f, OpXbX6Sf (0, 0, 0x14, 2), {F1, F2, F3}}, + {"fmin.s3", f, OpXbX6Sf (0, 0, 0x14, 3), {F1, F2, F3}}, + {"fmax.s0", f, OpXbX6Sf (0, 0, 0x15, 0), {F1, F2, F3}}, + {"fmax", f, OpXbX6Sf (0, 0, 0x15, 0), {F1, F2, F3}, PSEUDO}, + {"fmax.s1", f, OpXbX6Sf (0, 0, 0x15, 1), {F1, F2, F3}}, + {"fmax.s2", f, OpXbX6Sf (0, 0, 0x15, 2), {F1, F2, F3}}, + {"fmax.s3", f, OpXbX6Sf (0, 0, 0x15, 3), {F1, F2, F3}}, + {"famin.s0", f, OpXbX6Sf (0, 0, 0x16, 0), {F1, F2, F3}}, + {"famin", f, OpXbX6Sf (0, 0, 0x16, 0), {F1, F2, F3}, PSEUDO}, + {"famin.s1", f, OpXbX6Sf (0, 0, 0x16, 1), {F1, F2, F3}}, + {"famin.s2", f, OpXbX6Sf (0, 0, 0x16, 2), {F1, F2, F3}}, + {"famin.s3", f, OpXbX6Sf (0, 0, 0x16, 3), {F1, F2, F3}}, + {"famax.s0", f, OpXbX6Sf (0, 0, 0x17, 0), {F1, F2, F3}}, + {"famax", f, OpXbX6Sf (0, 0, 0x17, 0), {F1, F2, F3}, PSEUDO}, + {"famax.s1", f, OpXbX6Sf (0, 0, 0x17, 1), {F1, F2, F3}}, + {"famax.s2", f, OpXbX6Sf (0, 0, 0x17, 2), {F1, F2, F3}}, + {"famax.s3", f, OpXbX6Sf (0, 0, 0x17, 3), {F1, F2, F3}}, + + {"mov", f, OpXbX6 (0, 0, 0x10), {F1, F3}, PSEUDO | F2_EQ_F3}, + {"fabs", f, OpXbX6F2 (0, 0, 0x10, 0), {F1, F3}, PSEUDO}, + {"fneg", f, OpXbX6 (0, 0, 0x11), {F1, F3}, PSEUDO | F2_EQ_F3}, + {"fnegabs", f, OpXbX6F2 (0, 0, 0x11, 0), {F1, F3}, PSEUDO}, + {"fmerge.s", f, OpXbX6 (0, 0, 0x10), {F1, F2, F3}}, + {"fmerge.ns", f, OpXbX6 (0, 0, 0x11), {F1, F2, F3}}, + + {"fmerge.se", f, OpXbX6 (0, 0, 0x12), {F1, F2, F3}}, + {"fmix.lr", f, OpXbX6 (0, 0, 0x39), {F1, F2, F3}}, + {"fmix.r", f, OpXbX6 (0, 0, 0x3a), {F1, F2, F3}}, + {"fmix.l", f, OpXbX6 (0, 0, 0x3b), {F1, F2, F3}}, + {"fsxt.r", f, OpXbX6 (0, 0, 0x3c), {F1, F2, F3}}, + {"fsxt.l", f, OpXbX6 (0, 0, 0x3d), {F1, F2, F3}}, + {"fpack", f, OpXbX6 (0, 0, 0x28), {F1, F2, F3}}, + {"fswap", f, OpXbX6 (0, 0, 0x34), {F1, F2, F3}}, + {"fswap.nl", f, OpXbX6 (0, 0, 0x35), {F1, F2, F3}}, + {"fswap.nr", f, OpXbX6 (0, 0, 0x36), {F1, F2, F3}}, + {"fand", f, OpXbX6 (0, 0, 0x2c), {F1, F2, F3}}, + {"fandcm", f, OpXbX6 (0, 0, 0x2d), {F1, F2, F3}}, + {"for", f, OpXbX6 (0, 0, 0x2e), {F1, F2, F3}}, + {"fxor", f, OpXbX6 (0, 0, 0x2f), {F1, F2, F3}}, + + {"fcvt.fx.s0", f, OpXbX6Sf (0, 0, 0x18, 0), {F1, F2}}, + {"fcvt.fx", f, OpXbX6Sf (0, 0, 0x18, 0), {F1, F2}, PSEUDO}, + {"fcvt.fx.s1", f, OpXbX6Sf (0, 0, 0x18, 1), {F1, F2}}, + {"fcvt.fx.s2", f, OpXbX6Sf (0, 0, 0x18, 2), {F1, F2}}, + {"fcvt.fx.s3", f, OpXbX6Sf (0, 0, 0x18, 3), {F1, F2}}, + {"fcvt.fxu.s0", f, OpXbX6Sf (0, 0, 0x19, 0), {F1, F2}}, + {"fcvt.fxu", f, OpXbX6Sf (0, 0, 0x19, 0), {F1, F2}, PSEUDO}, + {"fcvt.fxu.s1", f, OpXbX6Sf (0, 0, 0x19, 1), {F1, F2}}, + {"fcvt.fxu.s2", f, OpXbX6Sf (0, 0, 0x19, 2), {F1, F2}}, + {"fcvt.fxu.s3", f, OpXbX6Sf (0, 0, 0x19, 3), {F1, F2}}, + {"fcvt.fx.trunc.s0", f, OpXbX6Sf (0, 0, 0x1a, 0), {F1, F2}}, + {"fcvt.fx.trunc", f, OpXbX6Sf (0, 0, 0x1a, 0), {F1, F2}, PSEUDO}, + {"fcvt.fx.trunc.s1", f, OpXbX6Sf (0, 0, 0x1a, 1), {F1, F2}}, + {"fcvt.fx.trunc.s2", f, OpXbX6Sf (0, 0, 0x1a, 2), {F1, F2}}, + {"fcvt.fx.trunc.s3", f, OpXbX6Sf (0, 0, 0x1a, 3), {F1, F2}}, + {"fcvt.fxu.trunc.s0", f, OpXbX6Sf (0, 0, 0x1b, 0), {F1, F2}}, + {"fcvt.fxu.trunc", f, OpXbX6Sf (0, 0, 0x1b, 0), {F1, F2}, PSEUDO}, + {"fcvt.fxu.trunc.s1", f, OpXbX6Sf (0, 0, 0x1b, 1), {F1, F2}}, + {"fcvt.fxu.trunc.s2", f, OpXbX6Sf (0, 0, 0x1b, 2), {F1, F2}}, + {"fcvt.fxu.trunc.s3", f, OpXbX6Sf (0, 0, 0x1b, 3), {F1, F2}}, + + {"fcvt.xf", f, OpXbX6 (0, 0, 0x1c), {F1, F2}}, + + {"fsetc.s0", f0, OpXbX6Sf (0, 0, 0x04, 0), {IMMU7a, IMMU7b}}, + {"fsetc", f0, OpXbX6Sf (0, 0, 0x04, 0), {IMMU7a, IMMU7b}, PSEUDO}, + {"fsetc.s1", f0, OpXbX6Sf (0, 0, 0x04, 1), {IMMU7a, IMMU7b}}, + {"fsetc.s2", f0, OpXbX6Sf (0, 0, 0x04, 2), {IMMU7a, IMMU7b}}, + {"fsetc.s3", f0, OpXbX6Sf (0, 0, 0x04, 3), {IMMU7a, IMMU7b}}, + {"fclrf.s0", f0, OpXbX6Sf (0, 0, 0x05, 0)}, + {"fclrf", f0, OpXbX6Sf (0, 0, 0x05, 0), {0}, PSEUDO}, + {"fclrf.s1", f0, OpXbX6Sf (0, 0, 0x05, 1)}, + {"fclrf.s2", f0, OpXbX6Sf (0, 0, 0x05, 2)}, + {"fclrf.s3", f0, OpXbX6Sf (0, 0, 0x05, 3)}, + {"fchkf.s0", f0, OpXbX6Sf (0, 0, 0x08, 0), {TGT25}}, + {"fchkf", f0, OpXbX6Sf (0, 0, 0x08, 0), {TGT25}, PSEUDO}, + {"fchkf.s1", f0, OpXbX6Sf (0, 0, 0x08, 1), {TGT25}}, + {"fchkf.s2", f0, OpXbX6Sf (0, 0, 0x08, 2), {TGT25}}, + {"fchkf.s3", f0, OpXbX6Sf (0, 0, 0x08, 3), {TGT25}}, + + {"break.f", f0, OpXbX6 (0, 0, 0x00), {IMMU21}}, + {"nop.f", f0, OpXbX6 (0, 0, 0x01), {IMMU21}}, + + {"fprcpa.s0", f2, OpXbQSf (1, 1, 0, 0), {F1, P2, F2, F3}}, + {"fprcpa", f2, OpXbQSf (1, 1, 0, 0), {F1, P2, F2, F3}, PSEUDO}, + {"fprcpa.s1", f2, OpXbQSf (1, 1, 0, 1), {F1, P2, F2, F3}}, + {"fprcpa.s2", f2, OpXbQSf (1, 1, 0, 2), {F1, P2, F2, F3}}, + {"fprcpa.s3", f2, OpXbQSf (1, 1, 0, 3), {F1, P2, F2, F3}}, + + {"fprsqrta.s0", f2, OpXbQSf (1, 1, 1, 0), {F1, P2, F3}}, + {"fprsqrta", f2, OpXbQSf (1, 1, 1, 0), {F1, P2, F3}, PSEUDO}, + {"fprsqrta.s1", f2, OpXbQSf (1, 1, 1, 1), {F1, P2, F3}}, + {"fprsqrta.s2", f2, OpXbQSf (1, 1, 1, 2), {F1, P2, F3}}, + {"fprsqrta.s3", f2, OpXbQSf (1, 1, 1, 3), {F1, P2, F3}}, + + {"fpmin.s0", f, OpXbX6Sf (1, 0, 0x14, 0), {F1, F2, F3}}, + {"fpmin", f, OpXbX6Sf (1, 0, 0x14, 0), {F1, F2, F3}, PSEUDO}, + {"fpmin.s1", f, OpXbX6Sf (1, 0, 0x14, 1), {F1, F2, F3}}, + {"fpmin.s2", f, OpXbX6Sf (1, 0, 0x14, 2), {F1, F2, F3}}, + {"fpmin.s3", f, OpXbX6Sf (1, 0, 0x14, 3), {F1, F2, F3}}, + {"fpmax.s0", f, OpXbX6Sf (1, 0, 0x15, 0), {F1, F2, F3}}, + {"fpmax", f, OpXbX6Sf (1, 0, 0x15, 0), {F1, F2, F3}, PSEUDO}, + {"fpmax.s1", f, OpXbX6Sf (1, 0, 0x15, 1), {F1, F2, F3}}, + {"fpmax.s2", f, OpXbX6Sf (1, 0, 0x15, 2), {F1, F2, F3}}, + {"fpmax.s3", f, OpXbX6Sf (1, 0, 0x15, 3), {F1, F2, F3}}, + {"fpamin.s0", f, OpXbX6Sf (1, 0, 0x16, 0), {F1, F2, F3}}, + {"fpamin", f, OpXbX6Sf (1, 0, 0x16, 0), {F1, F2, F3}, PSEUDO}, + {"fpamin.s1", f, OpXbX6Sf (1, 0, 0x16, 1), {F1, F2, F3}}, + {"fpamin.s2", f, OpXbX6Sf (1, 0, 0x16, 2), {F1, F2, F3}}, + {"fpamin.s3", f, OpXbX6Sf (1, 0, 0x16, 3), {F1, F2, F3}}, + {"fpamax.s0", f, OpXbX6Sf (1, 0, 0x17, 0), {F1, F2, F3}}, + {"fpamax", f, OpXbX6Sf (1, 0, 0x17, 0), {F1, F2, F3}, PSEUDO}, + {"fpamax.s1", f, OpXbX6Sf (1, 0, 0x17, 1), {F1, F2, F3}}, + {"fpamax.s2", f, OpXbX6Sf (1, 0, 0x17, 2), {F1, F2, F3}}, + {"fpamax.s3", f, OpXbX6Sf (1, 0, 0x17, 3), {F1, F2, F3}}, + + {"fpcmp.eq.s0", f, OpXbX6Sf (1, 0, 0x30, 0), {F1, F2, F3}}, + {"fpcmp.eq", f, OpXbX6Sf (1, 0, 0x30, 0), {F1, F2, F3}, PSEUDO}, + {"fpcmp.eq.s1", f, OpXbX6Sf (1, 0, 0x30, 1), {F1, F2, F3}}, + {"fpcmp.eq.s2", f, OpXbX6Sf (1, 0, 0x30, 2), {F1, F2, F3}}, + {"fpcmp.eq.s3", f, OpXbX6Sf (1, 0, 0x30, 3), {F1, F2, F3}}, + {"fpcmp.lt.s0", f, OpXbX6Sf (1, 0, 0x31, 0), {F1, F2, F3}}, + {"fpcmp.lt", f, OpXbX6Sf (1, 0, 0x31, 0), {F1, F2, F3}, PSEUDO}, + {"fpcmp.lt.s1", f, OpXbX6Sf (1, 0, 0x31, 1), {F1, F2, F3}}, + {"fpcmp.lt.s2", f, OpXbX6Sf (1, 0, 0x31, 2), {F1, F2, F3}}, + {"fpcmp.lt.s3", f, OpXbX6Sf (1, 0, 0x31, 3), {F1, F2, F3}}, + {"fpcmp.le.s0", f, OpXbX6Sf (1, 0, 0x32, 0), {F1, F2, F3}}, + {"fpcmp.le", f, OpXbX6Sf (1, 0, 0x32, 0), {F1, F2, F3}, PSEUDO}, + {"fpcmp.le.s1", f, OpXbX6Sf (1, 0, 0x32, 1), {F1, F2, F3}}, + {"fpcmp.le.s2", f, OpXbX6Sf (1, 0, 0x32, 2), {F1, F2, F3}}, + {"fpcmp.le.s3", f, OpXbX6Sf (1, 0, 0x32, 3), {F1, F2, F3}}, + {"fpcmp.gt.s0", f, OpXbX6Sf (1, 0, 0x31, 0), {F1, F3, F2}, PSEUDO}, + {"fpcmp.gt", f, OpXbX6Sf (1, 0, 0x31, 0), {F1, F3, F2}, PSEUDO}, + {"fpcmp.gt.s1", f, OpXbX6Sf (1, 0, 0x31, 1), {F1, F3, F2}, PSEUDO}, + {"fpcmp.gt.s2", f, OpXbX6Sf (1, 0, 0x31, 2), {F1, F3, F2}, PSEUDO}, + {"fpcmp.gt.s3", f, OpXbX6Sf (1, 0, 0x31, 3), {F1, F3, F2}, PSEUDO}, + {"fpcmp.ge.s0", f, OpXbX6Sf (1, 0, 0x32, 0), {F1, F3, F2}, PSEUDO}, + {"fpcmp.ge", f, OpXbX6Sf (1, 0, 0x32, 0), {F1, F3, F2}, PSEUDO}, + {"fpcmp.ge.s1", f, OpXbX6Sf (1, 0, 0x32, 1), {F1, F3, F2}, PSEUDO}, + {"fpcmp.ge.s2", f, OpXbX6Sf (1, 0, 0x32, 2), {F1, F3, F2}, PSEUDO}, + {"fpcmp.ge.s3", f, OpXbX6Sf (1, 0, 0x32, 3), {F1, F3, F2}, PSEUDO}, + {"fpcmp.unord.s0", f, OpXbX6Sf (1, 0, 0x33, 0), {F1, F2, F3}}, + {"fpcmp.unord", f, OpXbX6Sf (1, 0, 0x33, 0), {F1, F2, F3}, PSEUDO}, + {"fpcmp.unord.s1", f, OpXbX6Sf (1, 0, 0x33, 1), {F1, F2, F3}}, + {"fpcmp.unord.s2", f, OpXbX6Sf (1, 0, 0x33, 2), {F1, F2, F3}}, + {"fpcmp.unord.s3", f, OpXbX6Sf (1, 0, 0x33, 3), {F1, F2, F3}}, + {"fpcmp.neq.s0", f, OpXbX6Sf (1, 0, 0x34, 0), {F1, F2, F3}}, + {"fpcmp.neq", f, OpXbX6Sf (1, 0, 0x34, 0), {F1, F2, F3}, PSEUDO}, + {"fpcmp.neq.s1", f, OpXbX6Sf (1, 0, 0x34, 1), {F1, F2, F3}}, + {"fpcmp.neq.s2", f, OpXbX6Sf (1, 0, 0x34, 2), {F1, F2, F3}}, + {"fpcmp.neq.s3", f, OpXbX6Sf (1, 0, 0x34, 3), {F1, F2, F3}}, + {"fpcmp.nlt.s0", f, OpXbX6Sf (1, 0, 0x35, 0), {F1, F2, F3}}, + {"fpcmp.nlt", f, OpXbX6Sf (1, 0, 0x35, 0), {F1, F2, F3}, PSEUDO}, + {"fpcmp.nlt.s1", f, OpXbX6Sf (1, 0, 0x35, 1), {F1, F2, F3}}, + {"fpcmp.nlt.s2", f, OpXbX6Sf (1, 0, 0x35, 2), {F1, F2, F3}}, + {"fpcmp.nlt.s3", f, OpXbX6Sf (1, 0, 0x35, 3), {F1, F2, F3}}, + {"fpcmp.nle.s0", f, OpXbX6Sf (1, 0, 0x36, 0), {F1, F2, F3}}, + {"fpcmp.nle", f, OpXbX6Sf (1, 0, 0x36, 0), {F1, F2, F3}, PSEUDO}, + {"fpcmp.nle.s1", f, OpXbX6Sf (1, 0, 0x36, 1), {F1, F2, F3}}, + {"fpcmp.nle.s2", f, OpXbX6Sf (1, 0, 0x36, 2), {F1, F2, F3}}, + {"fpcmp.nle.s3", f, OpXbX6Sf (1, 0, 0x36, 3), {F1, F2, F3}}, + {"fpcmp.ngt.s0", f, OpXbX6Sf (1, 0, 0x35, 0), {F1, F3, F2}, PSEUDO}, + {"fpcmp.ngt", f, OpXbX6Sf (1, 0, 0x35, 0), {F1, F3, F2}, PSEUDO}, + {"fpcmp.ngt.s1", f, OpXbX6Sf (1, 0, 0x35, 1), {F1, F3, F2}, PSEUDO}, + {"fpcmp.ngt.s2", f, OpXbX6Sf (1, 0, 0x35, 2), {F1, F3, F2}, PSEUDO}, + {"fpcmp.ngt.s3", f, OpXbX6Sf (1, 0, 0x35, 3), {F1, F3, F2}, PSEUDO}, + {"fpcmp.nge.s0", f, OpXbX6Sf (1, 0, 0x36, 0), {F1, F3, F2}, PSEUDO}, + {"fpcmp.nge", f, OpXbX6Sf (1, 0, 0x36, 0), {F1, F3, F2}, PSEUDO}, + {"fpcmp.nge.s1", f, OpXbX6Sf (1, 0, 0x36, 1), {F1, F3, F2}, PSEUDO}, + {"fpcmp.nge.s2", f, OpXbX6Sf (1, 0, 0x36, 2), {F1, F3, F2}, PSEUDO}, + {"fpcmp.nge.s3", f, OpXbX6Sf (1, 0, 0x36, 3), {F1, F3, F2}, PSEUDO}, + {"fpcmp.ord.s0", f, OpXbX6Sf (1, 0, 0x37, 0), {F1, F2, F3}}, + {"fpcmp.ord", f, OpXbX6Sf (1, 0, 0x37, 0), {F1, F2, F3}, PSEUDO}, + {"fpcmp.ord.s1", f, OpXbX6Sf (1, 0, 0x37, 1), {F1, F2, F3}}, + {"fpcmp.ord.s2", f, OpXbX6Sf (1, 0, 0x37, 2), {F1, F2, F3}}, + {"fpcmp.ord.s3", f, OpXbX6Sf (1, 0, 0x37, 3), {F1, F2, F3}}, + + {"fpabs", f, OpXbX6F2 (1, 0, 0x10, 0), {F1, F3}, PSEUDO}, + {"fpneg", f, OpXbX6 (1, 0, 0x11), {F1, F3}, PSEUDO | F2_EQ_F3}, + {"fpnegabs", f, OpXbX6F2 (1, 0, 0x11, 0), {F1, F3}, PSEUDO}, + {"fpmerge.s", f, OpXbX6 (1, 0, 0x10), {F1, F2, F3}}, + {"fpmerge.ns", f, OpXbX6 (1, 0, 0x11), {F1, F2, F3}}, + {"fpmerge.se", f, OpXbX6 (1, 0, 0x12), {F1, F2, F3}}, + + {"fpcvt.fx.s0", f, OpXbX6Sf (1, 0, 0x18, 0), {F1, F2}}, + {"fpcvt.fx", f, OpXbX6Sf (1, 0, 0x18, 0), {F1, F2}, PSEUDO}, + {"fpcvt.fx.s1", f, OpXbX6Sf (1, 0, 0x18, 1), {F1, F2}}, + {"fpcvt.fx.s2", f, OpXbX6Sf (1, 0, 0x18, 2), {F1, F2}}, + {"fpcvt.fx.s3", f, OpXbX6Sf (1, 0, 0x18, 3), {F1, F2}}, + {"fpcvt.fxu.s0", f, OpXbX6Sf (1, 0, 0x19, 0), {F1, F2}}, + {"fpcvt.fxu", f, OpXbX6Sf (1, 0, 0x19, 0), {F1, F2}, PSEUDO}, + {"fpcvt.fxu.s1", f, OpXbX6Sf (1, 0, 0x19, 1), {F1, F2}}, + {"fpcvt.fxu.s2", f, OpXbX6Sf (1, 0, 0x19, 2), {F1, F2}}, + {"fpcvt.fxu.s3", f, OpXbX6Sf (1, 0, 0x19, 3), {F1, F2}}, + {"fpcvt.fx.trunc.s0", f, OpXbX6Sf (1, 0, 0x1a, 0), {F1, F2}}, + {"fpcvt.fx.trunc", f, OpXbX6Sf (1, 0, 0x1a, 0), {F1, F2}, PSEUDO}, + {"fpcvt.fx.trunc.s1", f, OpXbX6Sf (1, 0, 0x1a, 1), {F1, F2}}, + {"fpcvt.fx.trunc.s2", f, OpXbX6Sf (1, 0, 0x1a, 2), {F1, F2}}, + {"fpcvt.fx.trunc.s3", f, OpXbX6Sf (1, 0, 0x1a, 3), {F1, F2}}, + {"fpcvt.fxu.trunc.s0", f, OpXbX6Sf (1, 0, 0x1b, 0), {F1, F2}}, + {"fpcvt.fxu.trunc", f, OpXbX6Sf (1, 0, 0x1b, 0), {F1, F2}, PSEUDO}, + {"fpcvt.fxu.trunc.s1", f, OpXbX6Sf (1, 0, 0x1b, 1), {F1, F2}}, + {"fpcvt.fxu.trunc.s2", f, OpXbX6Sf (1, 0, 0x1b, 2), {F1, F2}}, + {"fpcvt.fxu.trunc.s3", f, OpXbX6Sf (1, 0, 0x1b, 3), {F1, F2}}, + + {"fcmp.eq.s0", f2, OpRaRbTaSf (4, 0, 0, 0, 0), {P1, P2, F2, F3}}, + {"fcmp.eq", f2, OpRaRbTaSf (4, 0, 0, 0, 0), {P1, P2, F2, F3}, PSEUDO}, + {"fcmp.eq.s1", f2, OpRaRbTaSf (4, 0, 0, 0, 1), {P1, P2, F2, F3}}, + {"fcmp.eq.s2", f2, OpRaRbTaSf (4, 0, 0, 0, 2), {P1, P2, F2, F3}}, + {"fcmp.eq.s3", f2, OpRaRbTaSf (4, 0, 0, 0, 3), {P1, P2, F2, F3}}, + {"fcmp.lt.s0", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P1, P2, F2, F3}}, + {"fcmp.lt", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P1, P2, F2, F3}, PSEUDO}, + {"fcmp.lt.s1", f2, OpRaRbTaSf (4, 0, 1, 0, 1), {P1, P2, F2, F3}}, + {"fcmp.lt.s2", f2, OpRaRbTaSf (4, 0, 1, 0, 2), {P1, P2, F2, F3}}, + {"fcmp.lt.s3", f2, OpRaRbTaSf (4, 0, 1, 0, 3), {P1, P2, F2, F3}}, + {"fcmp.le.s0", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P1, P2, F2, F3}}, + {"fcmp.le", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P1, P2, F2, F3}, PSEUDO}, + {"fcmp.le.s1", f2, OpRaRbTaSf (4, 1, 0, 0, 1), {P1, P2, F2, F3}}, + {"fcmp.le.s2", f2, OpRaRbTaSf (4, 1, 0, 0, 2), {P1, P2, F2, F3}}, + {"fcmp.le.s3", f2, OpRaRbTaSf (4, 1, 0, 0, 3), {P1, P2, F2, F3}}, + {"fcmp.unord.s0", f2, OpRaRbTaSf (4, 1, 1, 0, 0), {P1, P2, F2, F3}}, + {"fcmp.unord", f2, OpRaRbTaSf (4, 1, 1, 0, 0), {P1, P2, F2, F3}, PSEUDO}, + {"fcmp.unord.s1", f2, OpRaRbTaSf (4, 1, 1, 0, 1), {P1, P2, F2, F3}}, + {"fcmp.unord.s2", f2, OpRaRbTaSf (4, 1, 1, 0, 2), {P1, P2, F2, F3}}, + {"fcmp.unord.s3", f2, OpRaRbTaSf (4, 1, 1, 0, 3), {P1, P2, F2, F3}}, + {"fcmp.eq.unc.s0", f2, OpRaRbTaSf (4, 0, 0, 1, 0), {P1, P2, F2, F3}}, + {"fcmp.eq.unc", f2, OpRaRbTaSf (4, 0, 0, 1, 0), {P1, P2, F2, F3}, PSEUDO}, + {"fcmp.eq.unc.s1", f2, OpRaRbTaSf (4, 0, 0, 1, 1), {P1, P2, F2, F3}}, + {"fcmp.eq.unc.s2", f2, OpRaRbTaSf (4, 0, 0, 1, 2), {P1, P2, F2, F3}}, + {"fcmp.eq.unc.s3", f2, OpRaRbTaSf (4, 0, 0, 1, 3), {P1, P2, F2, F3}}, + {"fcmp.lt.unc.s0", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P1, P2, F2, F3}}, + {"fcmp.lt.unc", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P1, P2, F2, F3}, PSEUDO}, + {"fcmp.lt.unc.s1", f2, OpRaRbTaSf (4, 0, 1, 1, 1), {P1, P2, F2, F3}}, + {"fcmp.lt.unc.s2", f2, OpRaRbTaSf (4, 0, 1, 1, 2), {P1, P2, F2, F3}}, + {"fcmp.lt.unc.s3", f2, OpRaRbTaSf (4, 0, 1, 1, 3), {P1, P2, F2, F3}}, + {"fcmp.le.unc.s0", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P1, P2, F2, F3}}, + {"fcmp.le.unc", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P1, P2, F2, F3}, PSEUDO}, + {"fcmp.le.unc.s1", f2, OpRaRbTaSf (4, 1, 0, 1, 1), {P1, P2, F2, F3}}, + {"fcmp.le.unc.s2", f2, OpRaRbTaSf (4, 1, 0, 1, 2), {P1, P2, F2, F3}}, + {"fcmp.le.unc.s3", f2, OpRaRbTaSf (4, 1, 0, 1, 3), {P1, P2, F2, F3}}, + {"fcmp.unord.unc.s0", f2, OpRaRbTaSf (4, 1, 1, 1, 0), {P1, P2, F2, F3}}, + {"fcmp.unord.unc", f2, OpRaRbTaSf (4, 1, 1, 1, 0), {P1, P2, F2, F3}, PSEUDO}, + {"fcmp.unord.unc.s1", f2, OpRaRbTaSf (4, 1, 1, 1, 1), {P1, P2, F2, F3}}, + {"fcmp.unord.unc.s2", f2, OpRaRbTaSf (4, 1, 1, 1, 2), {P1, P2, F2, F3}}, + {"fcmp.unord.unc.s3", f2, OpRaRbTaSf (4, 1, 1, 1, 3), {P1, P2, F2, F3}}, + + /* pseudo-ops of the above */ + {"fcmp.gt.s0", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P1, P2, F3, F2}}, + {"fcmp.gt", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P1, P2, F3, F2}, PSEUDO}, + {"fcmp.gt.s1", f2, OpRaRbTaSf (4, 0, 1, 0, 1), {P1, P2, F3, F2}}, + {"fcmp.gt.s2", f2, OpRaRbTaSf (4, 0, 1, 0, 2), {P1, P2, F3, F2}}, + {"fcmp.gt.s3", f2, OpRaRbTaSf (4, 0, 1, 0, 3), {P1, P2, F3, F2}}, + {"fcmp.ge.s0", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P1, P2, F3, F2}}, + {"fcmp.ge", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P1, P2, F3, F2}, PSEUDO}, + {"fcmp.ge.s1", f2, OpRaRbTaSf (4, 1, 0, 0, 1), {P1, P2, F3, F2}}, + {"fcmp.ge.s2", f2, OpRaRbTaSf (4, 1, 0, 0, 2), {P1, P2, F3, F2}}, + {"fcmp.ge.s3", f2, OpRaRbTaSf (4, 1, 0, 0, 3), {P1, P2, F3, F2}}, + {"fcmp.neq.s0", f2, OpRaRbTaSf (4, 0, 0, 0, 0), {P2, P1, F2, F3}}, + {"fcmp.neq", f2, OpRaRbTaSf (4, 0, 0, 0, 0), {P2, P1, F2, F3}, PSEUDO}, + {"fcmp.neq.s1", f2, OpRaRbTaSf (4, 0, 0, 0, 1), {P2, P1, F2, F3}}, + {"fcmp.neq.s2", f2, OpRaRbTaSf (4, 0, 0, 0, 2), {P2, P1, F2, F3}}, + {"fcmp.neq.s3", f2, OpRaRbTaSf (4, 0, 0, 0, 3), {P2, P1, F2, F3}}, + {"fcmp.nlt.s0", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P2, P1, F2, F3}}, + {"fcmp.nlt", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P2, P1, F2, F3}, PSEUDO}, + {"fcmp.nlt.s1", f2, OpRaRbTaSf (4, 0, 1, 0, 1), {P2, P1, F2, F3}}, + {"fcmp.nlt.s2", f2, OpRaRbTaSf (4, 0, 1, 0, 2), {P2, P1, F2, F3}}, + {"fcmp.nlt.s3", f2, OpRaRbTaSf (4, 0, 1, 0, 3), {P2, P1, F2, F3}}, + {"fcmp.nle.s0", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P2, P1, F2, F3}}, + {"fcmp.nle", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P2, P1, F2, F3}, PSEUDO}, + {"fcmp.nle.s1", f2, OpRaRbTaSf (4, 1, 0, 0, 1), {P2, P1, F2, F3}}, + {"fcmp.nle.s2", f2, OpRaRbTaSf (4, 1, 0, 0, 2), {P2, P1, F2, F3}}, + {"fcmp.nle.s3", f2, OpRaRbTaSf (4, 1, 0, 0, 3), {P2, P1, F2, F3}}, + {"fcmp.ngt.s0", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P2, P1, F3, F2}}, + {"fcmp.ngt", f2, OpRaRbTaSf (4, 0, 1, 0, 0), {P2, P1, F3, F2}, PSEUDO}, + {"fcmp.ngt.s1", f2, OpRaRbTaSf (4, 0, 1, 0, 1), {P2, P1, F3, F2}}, + {"fcmp.ngt.s2", f2, OpRaRbTaSf (4, 0, 1, 0, 2), {P2, P1, F3, F2}}, + {"fcmp.ngt.s3", f2, OpRaRbTaSf (4, 0, 1, 0, 3), {P2, P1, F3, F2}}, + {"fcmp.nge.s0", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P2, P1, F3, F2}}, + {"fcmp.nge", f2, OpRaRbTaSf (4, 1, 0, 0, 0), {P2, P1, F3, F2}, PSEUDO}, + {"fcmp.nge.s1", f2, OpRaRbTaSf (4, 1, 0, 0, 1), {P2, P1, F3, F2}}, + {"fcmp.nge.s2", f2, OpRaRbTaSf (4, 1, 0, 0, 2), {P2, P1, F3, F2}}, + {"fcmp.nge.s3", f2, OpRaRbTaSf (4, 1, 0, 0, 3), {P2, P1, F3, F2}}, + {"fcmp.ord.s0", f2, OpRaRbTaSf (4, 1, 1, 0, 0), {P2, P1, F2, F3}}, + {"fcmp.ord", f2, OpRaRbTaSf (4, 1, 1, 0, 0), {P2, P1, F2, F3}, PSEUDO}, + {"fcmp.ord.s1", f2, OpRaRbTaSf (4, 1, 1, 0, 1), {P2, P1, F2, F3}}, + {"fcmp.ord.s2", f2, OpRaRbTaSf (4, 1, 1, 0, 2), {P2, P1, F2, F3}}, + {"fcmp.ord.s3", f2, OpRaRbTaSf (4, 1, 1, 0, 3), {P2, P1, F2, F3}}, + {"fcmp.gt.unc.s0", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P1, P2, F3, F2}}, + {"fcmp.gt.unc", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P1, P2, F3, F2}, PSEUDO}, + {"fcmp.gt.unc.s1", f2, OpRaRbTaSf (4, 0, 1, 1, 1), {P1, P2, F3, F2}}, + {"fcmp.gt.unc.s2", f2, OpRaRbTaSf (4, 0, 1, 1, 2), {P1, P2, F3, F2}}, + {"fcmp.gt.unc.s3", f2, OpRaRbTaSf (4, 0, 1, 1, 3), {P1, P2, F3, F2}}, + {"fcmp.ge.unc.s0", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P1, P2, F3, F2}}, + {"fcmp.ge.unc", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P1, P2, F3, F2}, PSEUDO}, + {"fcmp.ge.unc.s1", f2, OpRaRbTaSf (4, 1, 0, 1, 1), {P1, P2, F3, F2}}, + {"fcmp.ge.unc.s2", f2, OpRaRbTaSf (4, 1, 0, 1, 2), {P1, P2, F3, F2}}, + {"fcmp.ge.unc.s3", f2, OpRaRbTaSf (4, 1, 0, 1, 3), {P1, P2, F3, F2}}, + {"fcmp.neq.unc.s0", f2, OpRaRbTaSf (4, 0, 0, 1, 0), {P2, P1, F2, F3}}, + {"fcmp.neq.unc", f2, OpRaRbTaSf (4, 0, 0, 1, 0), {P2, P1, F2, F3}, PSEUDO}, + {"fcmp.neq.unc.s1", f2, OpRaRbTaSf (4, 0, 0, 1, 1), {P2, P1, F2, F3}}, + {"fcmp.neq.unc.s2", f2, OpRaRbTaSf (4, 0, 0, 1, 2), {P2, P1, F2, F3}}, + {"fcmp.neq.unc.s3", f2, OpRaRbTaSf (4, 0, 0, 1, 3), {P2, P1, F2, F3}}, + {"fcmp.nlt.unc.s0", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P2, P1, F2, F3}}, + {"fcmp.nlt.unc", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P2, P1, F2, F3}, PSEUDO}, + {"fcmp.nlt.unc.s1", f2, OpRaRbTaSf (4, 0, 1, 1, 1), {P2, P1, F2, F3}}, + {"fcmp.nlt.unc.s2", f2, OpRaRbTaSf (4, 0, 1, 1, 2), {P2, P1, F2, F3}}, + {"fcmp.nlt.unc.s3", f2, OpRaRbTaSf (4, 0, 1, 1, 3), {P2, P1, F2, F3}}, + {"fcmp.nle.unc.s0", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P2, P1, F2, F3}}, + {"fcmp.nle.unc", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P2, P1, F2, F3}, PSEUDO}, + {"fcmp.nle.unc.s1", f2, OpRaRbTaSf (4, 1, 0, 1, 1), {P2, P1, F2, F3}}, + {"fcmp.nle.unc.s2", f2, OpRaRbTaSf (4, 1, 0, 1, 2), {P2, P1, F2, F3}}, + {"fcmp.nle.unc.s3", f2, OpRaRbTaSf (4, 1, 0, 1, 3), {P2, P1, F2, F3}}, + {"fcmp.ngt.unc.s0", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P2, P1, F3, F2}}, + {"fcmp.ngt.unc", f2, OpRaRbTaSf (4, 0, 1, 1, 0), {P2, P1, F3, F2}, PSEUDO}, + {"fcmp.ngt.unc.s1", f2, OpRaRbTaSf (4, 0, 1, 1, 1), {P2, P1, F3, F2}}, + {"fcmp.ngt.unc.s2", f2, OpRaRbTaSf (4, 0, 1, 1, 2), {P2, P1, F3, F2}}, + {"fcmp.ngt.unc.s3", f2, OpRaRbTaSf (4, 0, 1, 1, 3), {P2, P1, F3, F2}}, + {"fcmp.nge.unc.s0", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P2, P1, F3, F2}}, + {"fcmp.nge.unc", f2, OpRaRbTaSf (4, 1, 0, 1, 0), {P2, P1, F3, F2}, PSEUDO}, + {"fcmp.nge.unc.s1", f2, OpRaRbTaSf (4, 1, 0, 1, 1), {P2, P1, F3, F2}}, + {"fcmp.nge.unc.s2", f2, OpRaRbTaSf (4, 1, 0, 1, 2), {P2, P1, F3, F2}}, + {"fcmp.nge.unc.s3", f2, OpRaRbTaSf (4, 1, 0, 1, 3), {P2, P1, F3, F2}}, + {"fcmp.ord.unc.s0", f2, OpRaRbTaSf (4, 1, 1, 1, 0), {P2, P1, F2, F3}}, + {"fcmp.ord.unc", f2, OpRaRbTaSf (4, 1, 1, 1, 0), {P2, P1, F2, F3}, PSEUDO}, + {"fcmp.ord.unc.s1", f2, OpRaRbTaSf (4, 1, 1, 1, 1), {P2, P1, F2, F3}}, + {"fcmp.ord.unc.s2", f2, OpRaRbTaSf (4, 1, 1, 1, 2), {P2, P1, F2, F3}}, + {"fcmp.ord.unc.s3", f2, OpRaRbTaSf (4, 1, 1, 1, 3), {P2, P1, F2, F3}}, + + {"fclass.m", f2, OpTa (5, 0), {P1, P2, F2, IMMU9}}, + {"fclass.nm", f2, OpTa (5, 0), {P2, P1, F2, IMMU9}, PSEUDO}, + {"fclass.m.unc", f2, OpTa (5, 1), {P1, P2, F2, IMMU9}}, + {"fclass.nm.unc", f2, OpTa (5, 1), {P2, P1, F2, IMMU9}, PSEUDO}, + + /* note: fnorm and fcvt.xuf have identical encodings! */ + {"fnorm.s0", f, OpXaSfF2F4 (0x8, 0, 0, 0, 1), {F1, F3}, PSEUDO}, + {"fnorm", f, OpXaSfF2F4 (0x8, 0, 0, 0, 1), {F1, F3}, PSEUDO}, + {"fnorm.s1", f, OpXaSfF2F4 (0x8, 0, 1, 0, 1), {F1, F3}, PSEUDO}, + {"fnorm.s2", f, OpXaSfF2F4 (0x8, 0, 2, 0, 1), {F1, F3}, PSEUDO}, + {"fnorm.s3", f, OpXaSfF2F4 (0x8, 0, 3, 0, 1), {F1, F3}, PSEUDO}, + {"fnorm.s.s0", f, OpXaSfF2F4 (0x8, 1, 0, 0, 1), {F1, F3}, PSEUDO}, + {"fnorm.s", f, OpXaSfF2F4 (0x8, 1, 0, 0, 1), {F1, F3}, PSEUDO}, + {"fnorm.s.s1", f, OpXaSfF2F4 (0x8, 1, 1, 0, 1), {F1, F3}, PSEUDO}, + {"fnorm.s.s2", f, OpXaSfF2F4 (0x8, 1, 2, 0, 1), {F1, F3}, PSEUDO}, + {"fnorm.s.s3", f, OpXaSfF2F4 (0x8, 1, 3, 0, 1), {F1, F3}, PSEUDO}, + {"fcvt.xuf.s0", f, OpXaSfF2F4 (0x8, 0, 0, 0, 1), {F1, F3}, PSEUDO}, + {"fcvt.xuf", f, OpXaSfF2F4 (0x8, 0, 0, 0, 1), {F1, F3}, PSEUDO}, + {"fcvt.xuf.s1", f, OpXaSfF2F4 (0x8, 0, 1, 0, 1), {F1, F3}, PSEUDO}, + {"fcvt.xuf.s2", f, OpXaSfF2F4 (0x8, 0, 2, 0, 1), {F1, F3}, PSEUDO}, + {"fcvt.xuf.s3", f, OpXaSfF2F4 (0x8, 0, 3, 0, 1), {F1, F3}, PSEUDO}, + {"fcvt.xuf.s.s0", f, OpXaSfF2F4 (0x8, 1, 0, 0, 1), {F1, F3}, PSEUDO}, + {"fcvt.xuf.s", f, OpXaSfF2F4 (0x8, 1, 0, 0, 1), {F1, F3}, PSEUDO}, + {"fcvt.xuf.s.s1", f, OpXaSfF2F4 (0x8, 1, 1, 0, 1), {F1, F3}, PSEUDO}, + {"fcvt.xuf.s.s2", f, OpXaSfF2F4 (0x8, 1, 2, 0, 1), {F1, F3}, PSEUDO}, + {"fcvt.xuf.s.s3", f, OpXaSfF2F4 (0x8, 1, 3, 0, 1), {F1, F3}, PSEUDO}, + {"fadd.s0", f, OpXaSfF4 (0x8, 0, 0, 1), {F1, F3, F2}, PSEUDO}, + {"fadd", f, OpXaSfF4 (0x8, 0, 0, 1), {F1, F3, F2}, PSEUDO}, + {"fadd.s1", f, OpXaSfF4 (0x8, 0, 1, 1), {F1, F3, F2}, PSEUDO}, + {"fadd.s2", f, OpXaSfF4 (0x8, 0, 2, 1), {F1, F3, F2}, PSEUDO}, + {"fadd.s3", f, OpXaSfF4 (0x8, 0, 3, 1), {F1, F3, F2}, PSEUDO}, + {"fadd.s.s0", f, OpXaSfF4 (0x8, 1, 0, 1), {F1, F3, F2}, PSEUDO}, + {"fadd.s", f, OpXaSfF4 (0x8, 1, 0, 1), {F1, F3, F2}, PSEUDO}, + {"fadd.s.s1", f, OpXaSfF4 (0x8, 1, 1, 1), {F1, F3, F2}, PSEUDO}, + {"fadd.s.s2", f, OpXaSfF4 (0x8, 1, 2, 1), {F1, F3, F2}, PSEUDO}, + {"fadd.s.s3", f, OpXaSfF4 (0x8, 1, 3, 1), {F1, F3, F2}, PSEUDO}, + {"fmpy.s0", f, OpXaSfF2 (0x8, 0, 0, 0), {F1, F3, F4}, PSEUDO}, + {"fmpy", f, OpXaSfF2 (0x8, 0, 0, 0), {F1, F3, F4}, PSEUDO}, + {"fmpy.s1", f, OpXaSfF2 (0x8, 0, 1, 0), {F1, F3, F4}, PSEUDO}, + {"fmpy.s2", f, OpXaSfF2 (0x8, 0, 2, 0), {F1, F3, F4}, PSEUDO}, + {"fmpy.s3", f, OpXaSfF2 (0x8, 0, 3, 0), {F1, F3, F4}, PSEUDO}, + {"fmpy.s.s0", f, OpXaSfF2 (0x8, 1, 0, 0), {F1, F3, F4}, PSEUDO}, + {"fmpy.s", f, OpXaSfF2 (0x8, 1, 0, 0), {F1, F3, F4}, PSEUDO}, + {"fmpy.s.s1", f, OpXaSfF2 (0x8, 1, 1, 0), {F1, F3, F4}, PSEUDO}, + {"fmpy.s.s2", f, OpXaSfF2 (0x8, 1, 2, 0), {F1, F3, F4}, PSEUDO}, + {"fmpy.s.s3", f, OpXaSfF2 (0x8, 1, 3, 0), {F1, F3, F4}, PSEUDO}, + {"fma.s0", f, OpXaSf (0x8, 0, 0), {F1, F3, F4, F2}}, + {"fma", f, OpXaSf (0x8, 0, 0), {F1, F3, F4, F2}, PSEUDO}, + {"fma.s1", f, OpXaSf (0x8, 0, 1), {F1, F3, F4, F2}}, + {"fma.s2", f, OpXaSf (0x8, 0, 2), {F1, F3, F4, F2}}, + {"fma.s3", f, OpXaSf (0x8, 0, 3), {F1, F3, F4, F2}}, + {"fma.s.s0", f, OpXaSf (0x8, 1, 0), {F1, F3, F4, F2}}, + {"fma.s", f, OpXaSf (0x8, 1, 0), {F1, F3, F4, F2}, PSEUDO}, + {"fma.s.s1", f, OpXaSf (0x8, 1, 1), {F1, F3, F4, F2}}, + {"fma.s.s2", f, OpXaSf (0x8, 1, 2), {F1, F3, F4, F2}}, + {"fma.s.s3", f, OpXaSf (0x8, 1, 3), {F1, F3, F4, F2}}, + + {"fnorm.d.s0", f, OpXaSfF2F4 (0x9, 0, 0, 0, 1), {F1, F3}, PSEUDO}, + {"fnorm.d", f, OpXaSfF2F4 (0x9, 0, 0, 0, 1), {F1, F3}, PSEUDO}, + {"fnorm.d.s1", f, OpXaSfF2F4 (0x9, 0, 1, 0, 1), {F1, F3}, PSEUDO}, + {"fnorm.d.s2", f, OpXaSfF2F4 (0x9, 0, 2, 0, 1), {F1, F3}, PSEUDO}, + {"fnorm.d.s3", f, OpXaSfF2F4 (0x9, 0, 3, 0, 1), {F1, F3}, PSEUDO}, + {"fcvt.xuf.d.s0", f, OpXaSfF2F4 (0x9, 0, 0, 0, 1), {F1, F3}, PSEUDO}, + {"fcvt.xuf.d", f, OpXaSfF2F4 (0x9, 0, 0, 0, 1), {F1, F3}, PSEUDO}, + {"fcvt.xuf.d.s1", f, OpXaSfF2F4 (0x9, 0, 1, 0, 1), {F1, F3}, PSEUDO}, + {"fcvt.xuf.d.s2", f, OpXaSfF2F4 (0x9, 0, 2, 0, 1), {F1, F3}, PSEUDO}, + {"fcvt.xuf.d.s3", f, OpXaSfF2F4 (0x9, 0, 3, 0, 1), {F1, F3}, PSEUDO}, + {"fadd.d.s0", f, OpXaSfF4 (0x9, 0, 0, 1), {F1, F3, F2}, PSEUDO}, + {"fadd.d", f, OpXaSfF4 (0x9, 0, 0, 1), {F1, F3, F2}, PSEUDO}, + {"fadd.d.s1", f, OpXaSfF4 (0x9, 0, 1, 1), {F1, F3, F2}, PSEUDO}, + {"fadd.d.s2", f, OpXaSfF4 (0x9, 0, 2, 1), {F1, F3, F2}, PSEUDO}, + {"fadd.d.s3", f, OpXaSfF4 (0x9, 0, 3, 1), {F1, F3, F2}, PSEUDO}, + {"fmpy.d.s0", f, OpXaSfF2 (0x9, 0, 0, 0), {F1, F3, F4}, PSEUDO}, + {"fmpy.d", f, OpXaSfF2 (0x9, 0, 0, 0), {F1, F3, F4}, PSEUDO}, + {"fmpy.d.s1", f, OpXaSfF2 (0x9, 0, 1, 0), {F1, F3, F4}, PSEUDO}, + {"fmpy.d.s2", f, OpXaSfF2 (0x9, 0, 2, 0), {F1, F3, F4}, PSEUDO}, + {"fmpy.d.s3", f, OpXaSfF2 (0x9, 0, 3, 0), {F1, F3, F4}, PSEUDO}, + {"fma.d.s0", f, OpXaSf (0x9, 0, 0), {F1, F3, F4, F2}}, + {"fma.d", f, OpXaSf (0x9, 0, 0), {F1, F3, F4, F2}, PSEUDO}, + {"fma.d.s1", f, OpXaSf (0x9, 0, 1), {F1, F3, F4, F2}}, + {"fma.d.s2", f, OpXaSf (0x9, 0, 2), {F1, F3, F4, F2}}, + {"fma.d.s3", f, OpXaSf (0x9, 0, 3), {F1, F3, F4, F2}}, + + {"fpmpy.s0", f, OpXaSfF2 (0x9, 1, 0, 0), {F1, F3, F4}, PSEUDO}, + {"fpmpy", f, OpXaSfF2 (0x9, 1, 0, 0), {F1, F3, F4}, PSEUDO}, + {"fpmpy.s1", f, OpXaSfF2 (0x9, 1, 1, 0), {F1, F3, F4}, PSEUDO}, + {"fpmpy.s2", f, OpXaSfF2 (0x9, 1, 2, 0), {F1, F3, F4}, PSEUDO}, + {"fpmpy.s3", f, OpXaSfF2 (0x9, 1, 3, 0), {F1, F3, F4}, PSEUDO}, + {"fpma.s0", f, OpXaSf (0x9, 1, 0), {F1, F3, F4, F2}}, + {"fpma", f, OpXaSf (0x9, 1, 0), {F1, F3, F4, F2}, PSEUDO}, + {"fpma.s1", f, OpXaSf (0x9, 1, 1), {F1, F3, F4, F2}}, + {"fpma.s2", f, OpXaSf (0x9, 1, 2), {F1, F3, F4, F2}}, + {"fpma.s3", f, OpXaSf (0x9, 1, 3), {F1, F3, F4, F2}}, + + {"fsub.s0", f, OpXaSfF4 (0xa, 0, 0, 1), {F1, F3, F2}, PSEUDO}, + {"fsub", f, OpXaSfF4 (0xa, 0, 0, 1), {F1, F3, F2}, PSEUDO}, + {"fsub.s1", f, OpXaSfF4 (0xa, 0, 1, 1), {F1, F3, F2}, PSEUDO}, + {"fsub.s2", f, OpXaSfF4 (0xa, 0, 2, 1), {F1, F3, F2}, PSEUDO}, + {"fsub.s3", f, OpXaSfF4 (0xa, 0, 3, 1), {F1, F3, F2}, PSEUDO}, + {"fsub.s.s0", f, OpXaSfF4 (0xa, 1, 0, 1), {F1, F3, F2}, PSEUDO}, + {"fsub.s", f, OpXaSfF4 (0xa, 1, 0, 1), {F1, F3, F2}, PSEUDO}, + {"fsub.s.s1", f, OpXaSfF4 (0xa, 1, 1, 1), {F1, F3, F2}, PSEUDO}, + {"fsub.s.s2", f, OpXaSfF4 (0xa, 1, 2, 1), {F1, F3, F2}, PSEUDO}, + {"fsub.s.s3", f, OpXaSfF4 (0xa, 1, 3, 1), {F1, F3, F2}, PSEUDO}, + {"fms.s0", f, OpXaSf (0xa, 0, 0), {F1, F3, F4, F2}}, + {"fms", f, OpXaSf (0xa, 0, 0), {F1, F3, F4, F2}, PSEUDO}, + {"fms.s1", f, OpXaSf (0xa, 0, 1), {F1, F3, F4, F2}}, + {"fms.s2", f, OpXaSf (0xa, 0, 2), {F1, F3, F4, F2}}, + {"fms.s3", f, OpXaSf (0xa, 0, 3), {F1, F3, F4, F2}}, + {"fms.s.s0", f, OpXaSf (0xa, 1, 0), {F1, F3, F4, F2}}, + {"fms.s", f, OpXaSf (0xa, 1, 0), {F1, F3, F4, F2}, PSEUDO}, + {"fms.s.s1", f, OpXaSf (0xa, 1, 1), {F1, F3, F4, F2}}, + {"fms.s.s2", f, OpXaSf (0xa, 1, 2), {F1, F3, F4, F2}}, + {"fms.s.s3", f, OpXaSf (0xa, 1, 3), {F1, F3, F4, F2}}, + {"fsub.d.s0", f, OpXaSfF4 (0xb, 0, 0, 1), {F1, F3, F2}, PSEUDO}, + {"fsub.d", f, OpXaSfF4 (0xb, 0, 0, 1), {F1, F3, F2}, PSEUDO}, + {"fsub.d.s1", f, OpXaSfF4 (0xb, 0, 1, 1), {F1, F3, F2}, PSEUDO}, + {"fsub.d.s2", f, OpXaSfF4 (0xb, 0, 2, 1), {F1, F3, F2}, PSEUDO}, + {"fsub.d.s3", f, OpXaSfF4 (0xb, 0, 3, 1), {F1, F3, F2}, PSEUDO}, + {"fms.d.s0", f, OpXaSf (0xb, 0, 0), {F1, F3, F4, F2}}, + {"fms.d", f, OpXaSf (0xb, 0, 0), {F1, F3, F4, F2}, PSEUDO}, + {"fms.d.s1", f, OpXaSf (0xb, 0, 1), {F1, F3, F4, F2}}, + {"fms.d.s2", f, OpXaSf (0xb, 0, 2), {F1, F3, F4, F2}}, + {"fms.d.s3", f, OpXaSf (0xb, 0, 3), {F1, F3, F4, F2}}, + + {"fpms.s0", f, OpXaSf (0xb, 1, 0), {F1, F3, F4, F2}}, + {"fpms", f, OpXaSf (0xb, 1, 0), {F1, F3, F4, F2}, PSEUDO}, + {"fpms.s1", f, OpXaSf (0xb, 1, 1), {F1, F3, F4, F2}}, + {"fpms.s2", f, OpXaSf (0xb, 1, 2), {F1, F3, F4, F2}}, + {"fpms.s3", f, OpXaSf (0xb, 1, 3), {F1, F3, F4, F2}}, + + {"fnmpy.s0", f, OpXaSfF2 (0xc, 0, 0, 0), {F1, F3, F4}, PSEUDO}, + {"fnmpy", f, OpXaSfF2 (0xc, 0, 0, 0), {F1, F3, F4}, PSEUDO}, + {"fnmpy.s1", f, OpXaSfF2 (0xc, 0, 1, 0), {F1, F3, F4}, PSEUDO}, + {"fnmpy.s2", f, OpXaSfF2 (0xc, 0, 2, 0), {F1, F3, F4}, PSEUDO}, + {"fnmpy.s3", f, OpXaSfF2 (0xc, 0, 3, 0), {F1, F3, F4}, PSEUDO}, + {"fnmpy.s.s0", f, OpXaSfF2 (0xc, 1, 0, 0), {F1, F3, F4}, PSEUDO}, + {"fnmpy.s", f, OpXaSfF2 (0xc, 1, 0, 0), {F1, F3, F4}, PSEUDO}, + {"fnmpy.s.s1", f, OpXaSfF2 (0xc, 1, 1, 0), {F1, F3, F4}, PSEUDO}, + {"fnmpy.s.s2", f, OpXaSfF2 (0xc, 1, 2, 0), {F1, F3, F4}, PSEUDO}, + {"fnmpy.s.s3", f, OpXaSfF2 (0xc, 1, 3, 0), {F1, F3, F4}, PSEUDO}, + {"fnma.s0", f, OpXaSf (0xc, 0, 0), {F1, F3, F4, F2}}, + {"fnma", f, OpXaSf (0xc, 0, 0), {F1, F3, F4, F2}, PSEUDO}, + {"fnma.s1", f, OpXaSf (0xc, 0, 1), {F1, F3, F4, F2}}, + {"fnma.s2", f, OpXaSf (0xc, 0, 2), {F1, F3, F4, F2}}, + {"fnma.s3", f, OpXaSf (0xc, 0, 3), {F1, F3, F4, F2}}, + {"fnma.s.s0", f, OpXaSf (0xc, 1, 0), {F1, F3, F4, F2}}, + {"fnma.s", f, OpXaSf (0xc, 1, 0), {F1, F3, F4, F2}, PSEUDO}, + {"fnma.s.s1", f, OpXaSf (0xc, 1, 1), {F1, F3, F4, F2}}, + {"fnma.s.s2", f, OpXaSf (0xc, 1, 2), {F1, F3, F4, F2}}, + {"fnma.s.s3", f, OpXaSf (0xc, 1, 3), {F1, F3, F4, F2}}, + {"fnmpy.d.s0", f, OpXaSfF2 (0xd, 0, 0, 0), {F1, F3, F4}, PSEUDO}, + {"fnmpy.d", f, OpXaSfF2 (0xd, 0, 0, 0), {F1, F3, F4}, PSEUDO}, + {"fnmpy.d.s1", f, OpXaSfF2 (0xd, 0, 1, 0), {F1, F3, F4}, PSEUDO}, + {"fnmpy.d.s2", f, OpXaSfF2 (0xd, 0, 2, 0), {F1, F3, F4}, PSEUDO}, + {"fnmpy.d.s3", f, OpXaSfF2 (0xd, 0, 3, 0), {F1, F3, F4}, PSEUDO}, + {"fnma.d.s0", f, OpXaSf (0xd, 0, 0), {F1, F3, F4, F2}}, + {"fnma.d", f, OpXaSf (0xd, 0, 0), {F1, F3, F4, F2}, PSEUDO}, + {"fnma.d.s1", f, OpXaSf (0xd, 0, 1), {F1, F3, F4, F2}}, + {"fnma.d.s2", f, OpXaSf (0xd, 0, 2), {F1, F3, F4, F2}}, + {"fnma.d.s3", f, OpXaSf (0xd, 0, 3), {F1, F3, F4, F2}}, + + {"fpnmpy.s0", f, OpXaSfF2 (0xd, 1, 0, 0), {F1, F3, F4}, PSEUDO}, + {"fpnmpy", f, OpXaSfF2 (0xd, 1, 0, 0), {F1, F3, F4}, PSEUDO}, + {"fpnmpy.s1", f, OpXaSfF2 (0xd, 1, 1, 0), {F1, F3, F4}, PSEUDO}, + {"fpnmpy.s2", f, OpXaSfF2 (0xd, 1, 2, 0), {F1, F3, F4}, PSEUDO}, + {"fpnmpy.s3", f, OpXaSfF2 (0xd, 1, 3, 0), {F1, F3, F4}, PSEUDO}, + {"fpnma.s0", f, OpXaSf (0xd, 1, 0), {F1, F3, F4, F2}}, + {"fpnma", f, OpXaSf (0xd, 1, 0), {F1, F3, F4, F2}, PSEUDO}, + {"fpnma.s1", f, OpXaSf (0xd, 1, 1), {F1, F3, F4, F2}}, + {"fpnma.s2", f, OpXaSf (0xd, 1, 2), {F1, F3, F4, F2}}, + {"fpnma.s3", f, OpXaSf (0xd, 1, 3), {F1, F3, F4, F2}}, + + {"xmpy.l", f, OpXaX2F2 (0xe, 1, 0, 0), {F1, F3, F4}, PSEUDO}, + {"xmpy.lu", f, OpXaX2F2 (0xe, 1, 0, 0), {F1, F3, F4}, PSEUDO}, + {"xmpy.h", f, OpXaX2F2 (0xe, 1, 3, 0), {F1, F3, F4}, PSEUDO}, + {"xmpy.hu", f, OpXaX2F2 (0xe, 1, 2, 0), {F1, F3, F4}, PSEUDO}, + {"xma.l", f, OpXaX2 (0xe, 1, 0), {F1, F3, F4, F2}}, + {"xma.lu", f, OpXaX2 (0xe, 1, 0), {F1, F3, F4, F2}, PSEUDO}, + {"xma.h", f, OpXaX2 (0xe, 1, 3), {F1, F3, F4, F2}}, + {"xma.hu", f, OpXaX2 (0xe, 1, 2), {F1, F3, F4, F2}}, + + {"fselect", f, OpXa (0xe, 0), {F1, F3, F4, F2}}, + + {0} + }; + +#undef f0 +#undef f +#undef f2 +#undef bF2 +#undef bF4 +#undef bQ +#undef bRa +#undef bRb +#undef bSf +#undef bTa +#undef bXa +#undef bXb +#undef bX2 +#undef bX6 +#undef mF2 +#undef mF4 +#undef mQ +#undef mRa +#undef mRb +#undef mSf +#undef mTa +#undef mXa +#undef mXb +#undef mX2 +#undef mX6 +#undef OpXa +#undef OpXaSf +#undef OpXaSfF2 +#undef OpXaSfF4 +#undef OpXaSfF2F4 +#undef OpXaX2 +#undef OpRaRbTaSf +#undef OpTa +#undef OpXbQSf +#undef OpXbX6 +#undef OpXbX6F2 +#undef OpXbX6Sf diff --git a/contrib/binutils/opcodes/ia64-opc-i.c b/contrib/binutils/opcodes/ia64-opc-i.c new file mode 100644 index 0000000..899e651 --- /dev/null +++ b/contrib/binutils/opcodes/ia64-opc-i.c @@ -0,0 +1,296 @@ +/* ia64-opc-i.c -- IA-64 `I' opcode table. + Copyright 1998, 1999, 2000 Free Software Foundation, Inc. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + This file is part of GDB, GAS, and the GNU binutils. + + GDB, GAS, and the GNU binutils are free software; you can redistribute + them and/or modify them under the terms of the GNU General Public + License as published by the Free Software Foundation; either version + 2, or (at your option) any later version. + + GDB, GAS, and the GNU binutils are distributed in the hope that they + will be useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this file; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#include "ia64-opc.h" + +#define I0 IA64_TYPE_I, 0 +#define I IA64_TYPE_I, 1 +#define I2 IA64_TYPE_I, 2 + +/* instruction bit fields: */ +#define bC(x) (((ia64_insn) ((x) & 0x1)) << 12) +#define bIh(x) (((ia64_insn) ((x) & 0x1)) << 23) +#define bTa(x) (((ia64_insn) ((x) & 0x1)) << 33) +#define bTag13(x) (((ia64_insn) ((x) & 0x1)) << 33) +#define bTb(x) (((ia64_insn) ((x) & 0x1)) << 36) +#define bVc(x) (((ia64_insn) ((x) & 0x1)) << 20) +#define bVe(x) (((ia64_insn) ((x) & 0x1)) << 32) +#define bWh(x) (((ia64_insn) ((x) & 0x3)) << 20) +#define bX(x) (((ia64_insn) ((x) & 0x1)) << 33) +#define bXb(x) (((ia64_insn) ((x) & 0x1)) << 22) +#define bX2(x) (((ia64_insn) ((x) & 0x3)) << 34) +#define bX2a(x) (((ia64_insn) ((x) & 0x3)) << 34) +#define bX2b(x) (((ia64_insn) ((x) & 0x3)) << 28) +#define bX2c(x) (((ia64_insn) ((x) & 0x3)) << 30) +#define bX3(x) (((ia64_insn) ((x) & 0x7)) << 33) +#define bX6(x) (((ia64_insn) ((x) & 0x3f)) << 27) +#define bYa(x) (((ia64_insn) ((x) & 0x1)) << 13) +#define bYb(x) (((ia64_insn) ((x) & 0x1)) << 26) +#define bZa(x) (((ia64_insn) ((x) & 0x1)) << 36) +#define bZb(x) (((ia64_insn) ((x) & 0x1)) << 33) + +/* instruction bit masks: */ +#define mC bC (-1) +#define mIh bIh (-1) +#define mTa bTa (-1) +#define mTag13 bTag13 (-1) +#define mTb bTb (-1) +#define mVc bVc (-1) +#define mVe bVe (-1) +#define mWh bWh (-1) +#define mX bX (-1) +#define mXb bXb (-1) +#define mX2 bX2 (-1) +#define mX2a bX2a (-1) +#define mX2b bX2b (-1) +#define mX2c bX2c (-1) +#define mX3 bX3 (-1) +#define mX6 bX6 (-1) +#define mYa bYa (-1) +#define mYb bYb (-1) +#define mZa bZa (-1) +#define mZb bZb (-1) + +#define OpZaZbVeX2aX2b(a,b,c,d,e,f) \ + (bOp (a) | bZa (b) | bZb (c) | bVe (d) | bX2a (e) | bX2b (f)), \ + (mOp | mZa | mZb | mVe | mX2a | mX2b) +#define OpZaZbVeX2aX2bX2c(a,b,c,d,e,f,g) \ + (bOp (a) | bZa (b) | bZb (c) | bVe (d) | bX2a (e) | bX2b (f) | bX2c (g)), \ + (mOp | mZa | mZb | mVe | mX2a | mX2b | mX2c) +#define OpX2X(a,b,c) (bOp (a) | bX2 (b) | bX (c)), (mOp | mX2 | mX) +#define OpX2XYa(a,b,c,d) (bOp (a) | bX2 (b) | bX (c) | bYa (d)), \ + (mOp | mX2 | mX | mYa) +#define OpX2XYb(a,b,c,d) (bOp (a) | bX2 (b) | bX (c) | bYb (d)), \ + (mOp | mX2 | mX | mYb) +#define OpX2TaTbYaC(a,b,c,d,e,f) \ + (bOp (a) | bX2 (b) | bTa (c) | bTb (d) | bYa (e) | bC (f)), \ + (mOp | mX2 | mTa | mTb | mYa | mC) +#define OpX3(a,b) (bOp (a) | bX3 (b)), (mOp | mX3) +#define OpX3X6(a,b,c) (bOp (a) | bX3 (b) | bX6(c)), \ + (mOp | mX3 | mX6) +#define OpX3XbIhWh(a,b,c,d,e) \ + (bOp (a) | bX3 (b) | bXb (c) | bIh (d) | bWh (e)), \ + (mOp | mX3 | mXb | mIh | mWh) +#define OpX3XbIhWhTag13(a,b,c,d,e,f) \ + (bOp (a) | bX3 (b) | bXb (c) | bIh (d) | bWh (e) | bTag13 (f)), \ + (mOp | mX3 | mXb | mIh | mWh | mTag13) + +struct ia64_opcode ia64_opcodes_i[] = + { + /* I-type instruction encodings (sorted according to major opcode) */ + + {"break.i", I0, OpX3X6 (0, 0, 0x00), {IMMU21}, X_IN_MLX}, + {"nop.i", I0, OpX3X6 (0, 0, 0x01), {IMMU21}, X_IN_MLX}, + {"chk.s.i", I0, OpX3 (0, 1), {R2, TGT25b}}, + + {"mov", I, OpX3XbIhWhTag13 (0, 7, 0, 0, 1, 0), {B1, R2}, PSEUDO}, +#define MOV(a,b,c,d) \ + I, OpX3XbIhWh (0, a, b, c, d), {B1, R2, TAG13b} + {"mov.sptk", MOV (7, 0, 0, 0)}, + {"mov.sptk.imp", MOV (7, 0, 1, 0)}, + {"mov", MOV (7, 0, 0, 1)}, + {"mov.imp", MOV (7, 0, 1, 1)}, + {"mov.dptk", MOV (7, 0, 0, 2)}, + {"mov.dptk.imp", MOV (7, 0, 1, 2)}, + {"mov.ret.sptk", MOV (7, 1, 0, 0)}, + {"mov.ret.sptk.imp", MOV (7, 1, 1, 0)}, + {"mov.ret", MOV (7, 1, 0, 1)}, + {"mov.ret.imp", MOV (7, 1, 1, 1)}, + {"mov.ret.dptk", MOV (7, 1, 0, 2)}, + {"mov.ret.dptk.imp", MOV (7, 1, 1, 2)}, +#undef MOV + {"mov", I, OpX3X6 (0, 0, 0x31), {R1, B2}}, + {"mov", I, OpX3 (0, 3), {PR, R2, IMM17}}, + {"mov", I, OpX3 (0, 2), {PR_ROT, IMM44}}, + {"mov", I, OpX3X6 (0, 0, 0x30), {R1, IP}}, + {"mov", I, OpX3X6 (0, 0, 0x33), {R1, PR}}, + {"mov.i", I, OpX3X6 (0, 0, 0x2a), {AR3, R2}}, + {"mov.i", I, OpX3X6 (0, 0, 0x0a), {AR3, IMM8}}, + {"mov.i", I, OpX3X6 (0, 0, 0x32), {R1, AR3}}, + {"zxt1", I, OpX3X6 (0, 0, 0x10), {R1, R3}}, + {"zxt2", I, OpX3X6 (0, 0, 0x11), {R1, R3}}, + {"zxt4", I, OpX3X6 (0, 0, 0x12), {R1, R3}}, + {"sxt1", I, OpX3X6 (0, 0, 0x14), {R1, R3}}, + {"sxt2", I, OpX3X6 (0, 0, 0x15), {R1, R3}}, + {"sxt4", I, OpX3X6 (0, 0, 0x16), {R1, R3}}, + {"czx1.l", I, OpX3X6 (0, 0, 0x18), {R1, R3}}, + {"czx2.l", I, OpX3X6 (0, 0, 0x19), {R1, R3}}, + {"czx1.r", I, OpX3X6 (0, 0, 0x1c), {R1, R3}}, + {"czx2.r", I, OpX3X6 (0, 0, 0x1d), {R1, R3}}, + + {"dep", I, Op (4), {R1, R2, R3, CPOS6c, LEN4}}, + + {"shrp", I, OpX2X (5, 3, 0), {R1, R2, R3, CNT6}}, + + {"shr.u", I, OpX2XYa (5, 1, 0, 0), {R1, R3, POS6}, + PSEUDO | LEN_EQ_64MCNT}, + {"extr.u", I, OpX2XYa (5, 1, 0, 0), {R1, R3, POS6, LEN6}}, + + {"shr", I, OpX2XYa (5, 1, 0, 1), {R1, R3, POS6}, + PSEUDO | LEN_EQ_64MCNT}, + {"extr", I, OpX2XYa (5, 1, 0, 1), {R1, R3, POS6, LEN6}}, + + {"shl", I, OpX2XYb (5, 1, 1, 0), {R1, R2, CPOS6a}, + PSEUDO | LEN_EQ_64MCNT}, + {"dep.z", I, OpX2XYb (5, 1, 1, 0), {R1, R2, CPOS6a, LEN6}}, + {"dep.z", I, OpX2XYb (5, 1, 1, 1), {R1, IMM8, CPOS6a, LEN6}}, + {"dep", I, OpX2X (5, 3, 1), {R1, IMM1, R3, CPOS6b, LEN6}}, +#define TBIT(a,b,c,d) \ + I2, OpX2TaTbYaC (5, 0, a, b, c, d), {P1, P2, R3, POS6} +#define TBITCM(a,b,c,d) \ + I2, OpX2TaTbYaC (5, 0, a, b, c, d), {P2, P1, R3, POS6}, PSEUDO + {"tbit.z", TBIT (0, 0, 0, 0)}, + {"tbit.nz", TBITCM (0, 0, 0, 0)}, + {"tbit.z.unc", TBIT (0, 0, 0, 1)}, + {"tbit.nz.unc", TBITCM (0, 0, 0, 1)}, + {"tbit.z.and", TBIT (0, 1, 0, 0)}, + {"tbit.nz.andcm", TBITCM (0, 1, 0, 0)}, + {"tbit.nz.and", TBIT (0, 1, 0, 1)}, + {"tbit.z.andcm", TBITCM (0, 1, 0, 1)}, + {"tbit.z.or", TBIT (1, 0, 0, 0)}, + {"tbit.nz.orcm", TBITCM (1, 0, 0, 0)}, + {"tbit.nz.or", TBIT (1, 0, 0, 1)}, + {"tbit.z.orcm", TBITCM (1, 0, 0, 1)}, + {"tbit.z.or.andcm", TBIT (1, 1, 0, 0)}, + {"tbit.nz.and.orcm", TBITCM (1, 1, 0, 0)}, + {"tbit.nz.or.andcm", TBIT (1, 1, 0, 1)}, + {"tbit.z.and.orcm", TBITCM (1, 1, 0, 1)}, +#undef TBIT +#define TNAT(a,b,c,d) \ + I2, OpX2TaTbYaC (5, 0, a, b, c, d), {P1, P2, R3} +#define TNATCM(a,b,c,d) \ + I2, OpX2TaTbYaC (5, 0, a, b, c, d), {P2, P1, R3}, PSEUDO + {"tnat.z", TNAT (0, 0, 1, 0)}, + {"tnat.nz", TNATCM (0, 0, 1, 0)}, + {"tnat.z.unc", TNAT (0, 0, 1, 1)}, + {"tnat.nz.unc", TNATCM (0, 0, 1, 1)}, + {"tnat.z.and", TNAT (0, 1, 1, 0)}, + {"tnat.nz.andcm", TNATCM (0, 1, 1, 0)}, + {"tnat.nz.and", TNAT (0, 1, 1, 1)}, + {"tnat.z.andcm", TNATCM (0, 1, 1, 1)}, + {"tnat.z.or", TNAT (1, 0, 1, 0)}, + {"tnat.nz.orcm", TNATCM (1, 0, 1, 0)}, + {"tnat.nz.or", TNAT (1, 0, 1, 1)}, + {"tnat.z.orcm", TNATCM (1, 0, 1, 1)}, + {"tnat.z.or.andcm", TNAT (1, 1, 1, 0)}, + {"tnat.nz.and.orcm", TNATCM (1, 1, 1, 0)}, + {"tnat.nz.or.andcm", TNAT (1, 1, 1, 1)}, + {"tnat.z.and.orcm", TNATCM (1, 1, 1, 1)}, +#undef TNAT + + {"pmpyshr2", I, OpZaZbVeX2aX2b (7, 0, 1, 0, 0, 3), {R1, R2, R3, CNT2c}}, + {"pmpyshr2.u", I, OpZaZbVeX2aX2b (7, 0, 1, 0, 0, 1), {R1, R2, R3, CNT2c}}, + {"pmpy2.r", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 1, 3), {R1, R2, R3}}, + {"pmpy2.l", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 3, 3), {R1, R2, R3}}, + {"mix1.r", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 2, 0, 2), {R1, R2, R3}}, + {"mix2.r", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 0, 2), {R1, R2, R3}}, + {"mix4.r", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 2, 0, 2), {R1, R2, R3}}, + {"mix1.l", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 2, 2, 2), {R1, R2, R3}}, + {"mix2.l", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 2, 2), {R1, R2, R3}}, + {"mix4.l", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 2, 2, 2), {R1, R2, R3}}, + {"pack2.uss", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 0, 0), {R1, R2, R3}}, + {"pack2.sss", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 2, 0), {R1, R2, R3}}, + {"pack4.sss", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 2, 2, 0), {R1, R2, R3}}, + {"unpack1.h", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 2, 0, 1), {R1, R2, R3}}, + {"unpack2.h", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 0, 1), {R1, R2, R3}}, + {"unpack4.h", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 2, 0, 1), {R1, R2, R3}}, + {"unpack1.l", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 2, 2, 1), {R1, R2, R3}}, + {"unpack2.l", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 2, 1), {R1, R2, R3}}, + {"unpack4.l", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 2, 2, 1), {R1, R2, R3}}, + {"pmin1.u", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 2, 1, 0), {R1, R2, R3}}, + {"pmax1.u", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 2, 1, 1), {R1, R2, R3}}, + {"pmin2", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 3, 0), {R1, R2, R3}}, + {"pmax2", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 2, 3, 1), {R1, R2, R3}}, + {"psad1", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 2, 3, 2), {R1, R2, R3}}, + {"mux1", I, OpZaZbVeX2aX2bX2c (7, 0, 0, 0, 3, 2, 2), {R1, R2, MBTYPE4}}, + {"mux2", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 3, 2, 2), {R1, R2, MHTYPE8}}, + {"pshr2", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 0, 2, 0), {R1, R3, R2}}, + {"pshr4", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 0, 2, 0), {R1, R3, R2}}, + {"shr", I, OpZaZbVeX2aX2bX2c (7, 1, 1, 0, 0, 2, 0), {R1, R3, R2}}, + {"pshr2.u", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 0, 0, 0), {R1, R3, R2}}, + {"pshr4.u", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 0, 0, 0), {R1, R3, R2}}, + {"shr.u", I, OpZaZbVeX2aX2bX2c (7, 1, 1, 0, 0, 0, 0), {R1, R3, R2}}, + {"pshr2", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 1, 3, 0), {R1, R3, CNT5}}, + {"pshr4", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 1, 3, 0), {R1, R3, CNT5}}, + {"pshr2.u", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 1, 1, 0), {R1, R3, CNT5}}, + {"pshr4.u", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 1, 1, 0), {R1, R3, CNT5}}, + {"pshl2", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 0, 0, 1), {R1, R2, R3}}, + {"pshl4", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 0, 0, 1), {R1, R2, R3}}, + {"shl", I, OpZaZbVeX2aX2bX2c (7, 1, 1, 0, 0, 0, 1), {R1, R2, R3}}, + {"pshl2", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 3, 1, 1), {R1, R2, CCNT5}}, + {"pshl4", I, OpZaZbVeX2aX2bX2c (7, 1, 0, 0, 3, 1, 1), {R1, R2, CCNT5}}, + {"popcnt", I, OpZaZbVeX2aX2bX2c (7, 0, 1, 0, 1, 1, 2), {R1, R3}}, + + {0} + }; + +#undef I0 +#undef I +#undef I2 +#undef L +#undef bC +#undef bIh +#undef bTa +#undef bTag13 +#undef bTb +#undef bVc +#undef bVe +#undef bWh +#undef bX +#undef bXb +#undef bX2 +#undef bX2a +#undef bX2b +#undef bX2c +#undef bX3 +#undef bX6 +#undef bY +#undef bZa +#undef bZb +#undef mC +#undef mIh +#undef mTa +#undef mTag13 +#undef mTb +#undef mVc +#undef mVe +#undef mWh +#undef mX +#undef mXb +#undef mX2 +#undef mX2a +#undef mX2b +#undef mX2c +#undef mX3 +#undef mX6 +#undef mY +#undef mZa +#undef mZb +#undef OpZaZbVeX2aX2b +#undef OpZaZbVeX2aX2bX2c +#undef OpX2X +#undef OpX2XYa +#undef OpX2XYb +#undef OpX2TaTbYaC +#undef OpX3 +#undef OpX3X6 +#undef OpX3XbIhWh +#undef OpX3XbIhWhTag13 diff --git a/contrib/binutils/opcodes/ia64-opc-m.c b/contrib/binutils/opcodes/ia64-opc-m.c new file mode 100644 index 0000000..bc09816 --- /dev/null +++ b/contrib/binutils/opcodes/ia64-opc-m.c @@ -0,0 +1,1060 @@ +/* ia64-opc-m.c -- IA-64 `M' opcode table. + Copyright 1998, 1999, 2000 Free Software Foundation, Inc. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + This file is part of GDB, GAS, and the GNU binutils. + + GDB, GAS, and the GNU binutils are free software; you can redistribute + them and/or modify them under the terms of the GNU General Public + License as published by the Free Software Foundation; either version + 2, or (at your option) any later version. + + GDB, GAS, and the GNU binutils are distributed in the hope that they + will be useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this file; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#include "ia64-opc.h" + +#define M0 IA64_TYPE_M, 0 +#define M IA64_TYPE_M, 1 +#define M2 IA64_TYPE_M, 2 + +/* instruction bit fields: */ +#define bM(x) (((ia64_insn) ((x) & 0x1)) << 36) +#define bX(x) (((ia64_insn) ((x) & 0x1)) << 27) +#define bX2(x) (((ia64_insn) ((x) & 0x3)) << 31) +#define bX3(x) (((ia64_insn) ((x) & 0x7)) << 33) +#define bX4(x) (((ia64_insn) ((x) & 0xf)) << 27) +#define bX6a(x) (((ia64_insn) ((x) & 0x3f)) << 30) +#define bX6b(x) (((ia64_insn) ((x) & 0x3f)) << 27) +#define bHint(x) (((ia64_insn) ((x) & 0x3)) << 28) + +#define mM bM (-1) +#define mX bX (-1) +#define mX2 bX2 (-1) +#define mX3 bX3 (-1) +#define mX4 bX4 (-1) +#define mX6a bX6a (-1) +#define mX6b bX6b (-1) +#define mHint bHint (-1) + +#define OpX3(a,b) (bOp (a) | bX3 (b)), (mOp | mX3) +#define OpX3X6b(a,b,c) (bOp (a) | bX3 (b) | bX6b (c)), \ + (mOp | mX3 | mX6b) +#define OpX3X4(a,b,c) (bOp (a) | bX3 (b) | bX4 (c)), \ + (mOp | mX3 | mX4) +#define OpX3X4X2(a,b,c,d) (bOp (a) | bX3 (b) | bX4 (c) | bX2 (d)), \ + (mOp | mX3 | mX4 | mX2) +#define OpX6aHint(a,b,c) (bOp (a) | bX6a (b) | bHint (c)), \ + (mOp | mX6a | mHint) +#define OpXX6aHint(a,b,c,d) (bOp (a) | bX (b) | bX6a (c) | bHint (d)), \ + (mOp | mX | mX6a | mHint) +#define OpMXX6a(a,b,c,d) \ + (bOp (a) | bM (b) | bX (c) | bX6a (d)), (mOp | mM | mX | mX6a) +#define OpMXX6aHint(a,b,c,d,e) \ + (bOp (a) | bM (b) | bX (c) | bX6a (d) | bHint (e)), \ + (mOp | mM | mX | mX6a | mHint) + +struct ia64_opcode ia64_opcodes_m[] = + { + /* M-type instruction encodings (sorted according to major opcode) */ + + {"chk.a.nc", M0, OpX3 (0, 4), {R1, TGT25c}}, + {"chk.a.clr", M0, OpX3 (0, 5), {R1, TGT25c}}, + {"chk.a.nc", M0, OpX3 (0, 6), {F1, TGT25c}}, + {"chk.a.clr", M0, OpX3 (0, 7), {F1, TGT25c}}, + + {"invala", M0, OpX3X4X2 (0, 0, 0, 1)}, + {"fwb", M0, OpX3X4X2 (0, 0, 0, 2)}, + {"mf", M0, OpX3X4X2 (0, 0, 2, 2)}, + {"mf.a", M0, OpX3X4X2 (0, 0, 3, 2)}, + {"srlz.d", M0, OpX3X4X2 (0, 0, 0, 3)}, + {"srlz.i", M0, OpX3X4X2 (0, 0, 1, 3)}, + {"sync.i", M0, OpX3X4X2 (0, 0, 3, 3)}, + {"flushrs", M0, OpX3X4X2 (0, 0, 0xc, 0), {0, }, FIRST | NO_PRED}, + {"loadrs", M0, OpX3X4X2 (0, 0, 0xa, 0), {0, }, FIRST | NO_PRED}, + {"invala.e", M0, OpX3X4X2 (0, 0, 2, 1), {R1}}, + {"invala.e", M0, OpX3X4X2 (0, 0, 3, 1), {F1}}, + {"mov.m", M, OpX3X4X2 (0, 0, 8, 2), {AR3, IMM8}}, + + {"break.m", M0, OpX3X4X2 (0, 0, 0, 0), {IMMU21}}, + {"nop.m", M0, OpX3X4X2 (0, 0, 1, 0), {IMMU21}}, + + {"sum", M0, OpX3X4 (0, 0, 4), {IMMU24}}, + {"rum", M0, OpX3X4 (0, 0, 5), {IMMU24}}, + {"ssm", M0, OpX3X4 (0, 0, 6), {IMMU24}, PRIV}, + {"rsm", M0, OpX3X4 (0, 0, 7), {IMMU24}, PRIV}, + + {"mov.m", M, OpX3X6b (1, 0, 0x2a), {AR3, R2}}, + {"mov.m", M, OpX3X6b (1, 0, 0x22), {R1, AR3}}, + {"mov", M, OpX3X6b (1, 0, 0x2c), {CR3, R2}, PRIV}, + {"mov", M, OpX3X6b (1, 0, 0x24), {R1, CR3}, PRIV}, + + {"alloc", M, OpX3 (1, 6), {R1, AR_PFS, SOF, SOL, SOR}, FIRST|NO_PRED|MOD_RRBS}, + + {"mov", M, OpX3X6b (1, 0, 0x2d), {PSR_L, R2}, PRIV}, + {"mov", M, OpX3X6b (1, 0, 0x29), {PSR_UM, R2}}, + {"mov", M, OpX3X6b (1, 0, 0x25), {R1, PSR}, PRIV}, + {"mov", M, OpX3X6b (1, 0, 0x21), {R1, PSR_UM}}, + {"probe.r", M, OpX3X6b (1, 0, 0x38), {R1, R3, R2}}, + {"probe.w", M, OpX3X6b (1, 0, 0x39), {R1, R3, R2}}, + {"probe.r", M, OpX3X6b (1, 0, 0x18), {R1, R3, IMMU2}}, + {"probe.w", M, OpX3X6b (1, 0, 0x19), {R1, R3, IMMU2}}, + {"probe.rw.fault", M0, OpX3X6b (1, 0, 0x31), {R3, IMMU2}}, + {"probe.r.fault", M0, OpX3X6b (1, 0, 0x32), {R3, IMMU2}}, + {"probe.w.fault", M0, OpX3X6b (1, 0, 0x33), {R3, IMMU2}}, + {"itc.d", M0, OpX3X6b (1, 0, 0x2e), {R2}, LAST | PRIV}, + {"itc.i", M0, OpX3X6b (1, 0, 0x2f), {R2}, LAST | PRIV}, + + {"mov", M, OpX3X6b (1, 0, 0x00), {RR_R3, R2}, PRIV}, + {"mov", M, OpX3X6b (1, 0, 0x01), {DBR_R3, R2}, PRIV}, + {"mov", M, OpX3X6b (1, 0, 0x02), {IBR_R3, R2}, PRIV}, + {"mov", M, OpX3X6b (1, 0, 0x03), {PKR_R3, R2}, PRIV}, + {"mov", M, OpX3X6b (1, 0, 0x04), {PMC_R3, R2}, PRIV}, + {"mov", M, OpX3X6b (1, 0, 0x05), {PMD_R3, R2}, PRIV}, + {"mov", M, OpX3X6b (1, 0, 0x06), {MSR_R3, R2}, PRIV}, + {"itr.d", M, OpX3X6b (1, 0, 0x0e), {DTR_R3, R2}, PRIV}, + {"itr.i", M, OpX3X6b (1, 0, 0x0f), {ITR_R3, R2}, PRIV}, + + {"mov", M, OpX3X6b (1, 0, 0x10), {R1, RR_R3}, PRIV}, + {"mov", M, OpX3X6b (1, 0, 0x11), {R1, DBR_R3}, PRIV}, + {"mov", M, OpX3X6b (1, 0, 0x12), {R1, IBR_R3}, PRIV}, + {"mov", M, OpX3X6b (1, 0, 0x13), {R1, PKR_R3}, PRIV}, + {"mov", M, OpX3X6b (1, 0, 0x14), {R1, PMC_R3}, PRIV}, + {"mov", M, OpX3X6b (1, 0, 0x15), {R1, PMD_R3}}, + {"mov", M, OpX3X6b (1, 0, 0x16), {R1, MSR_R3}, PRIV}, + {"mov", M, OpX3X6b (1, 0, 0x17), {R1, CPUID_R3}}, + + {"ptc.l", M0, OpX3X6b (1, 0, 0x09), {R3, R2}, PRIV}, + {"ptc.g", M0, OpX3X6b (1, 0, 0x0a), {R3, R2}, LAST | PRIV}, + {"ptc.ga", M0, OpX3X6b (1, 0, 0x0b), {R3, R2}, LAST | PRIV}, + {"ptr.d", M0, OpX3X6b (1, 0, 0x0c), {R3, R2}, PRIV}, + {"ptr.i", M0, OpX3X6b (1, 0, 0x0d), {R3, R2}, PRIV}, + + {"thash", M, OpX3X6b (1, 0, 0x1a), {R1, R3}}, + {"ttag", M, OpX3X6b (1, 0, 0x1b), {R1, R3}}, + {"tpa", M, OpX3X6b (1, 0, 0x1e), {R1, R3}, PRIV}, + {"tak", M, OpX3X6b (1, 0, 0x1f), {R1, R3}, PRIV}, + + {"chk.s.m", M0, OpX3 (1, 1), {R2, TGT25b}}, + {"chk.s", M0, OpX3 (1, 3), {F2, TGT25b}}, + + {"fc", M0, OpX3X6b (1, 0, 0x30), {R3}}, + {"ptc.e", M0, OpX3X6b (1, 0, 0x34), {R3}, PRIV}, + + /* integer load */ + {"ld1", M, OpMXX6aHint (4, 0, 0, 0x00, 0), {R1, MR3}}, + {"ld1.nt1", M, OpMXX6aHint (4, 0, 0, 0x00, 1), {R1, MR3}}, + {"ld1.nta", M, OpMXX6aHint (4, 0, 0, 0x00, 3), {R1, MR3}}, + {"ld2", M, OpMXX6aHint (4, 0, 0, 0x01, 0), {R1, MR3}}, + {"ld2.nt1", M, OpMXX6aHint (4, 0, 0, 0x01, 1), {R1, MR3}}, + {"ld2.nta", M, OpMXX6aHint (4, 0, 0, 0x01, 3), {R1, MR3}}, + {"ld4", M, OpMXX6aHint (4, 0, 0, 0x02, 0), {R1, MR3}}, + {"ld4.nt1", M, OpMXX6aHint (4, 0, 0, 0x02, 1), {R1, MR3}}, + {"ld4.nta", M, OpMXX6aHint (4, 0, 0, 0x02, 3), {R1, MR3}}, + {"ld8", M, OpMXX6aHint (4, 0, 0, 0x03, 0), {R1, MR3}}, + {"ld8.nt1", M, OpMXX6aHint (4, 0, 0, 0x03, 1), {R1, MR3}}, + {"ld8.nta", M, OpMXX6aHint (4, 0, 0, 0x03, 3), {R1, MR3}}, + {"ld1.s", M, OpMXX6aHint (4, 0, 0, 0x04, 0), {R1, MR3}}, + {"ld1.s.nt1", M, OpMXX6aHint (4, 0, 0, 0x04, 1), {R1, MR3}}, + {"ld1.s.nta", M, OpMXX6aHint (4, 0, 0, 0x04, 3), {R1, MR3}}, + {"ld2.s", M, OpMXX6aHint (4, 0, 0, 0x05, 0), {R1, MR3}}, + {"ld2.s.nt1", M, OpMXX6aHint (4, 0, 0, 0x05, 1), {R1, MR3}}, + {"ld2.s.nta", M, OpMXX6aHint (4, 0, 0, 0x05, 3), {R1, MR3}}, + {"ld4.s", M, OpMXX6aHint (4, 0, 0, 0x06, 0), {R1, MR3}}, + {"ld4.s.nt1", M, OpMXX6aHint (4, 0, 0, 0x06, 1), {R1, MR3}}, + {"ld4.s.nta", M, OpMXX6aHint (4, 0, 0, 0x06, 3), {R1, MR3}}, + {"ld8.s", M, OpMXX6aHint (4, 0, 0, 0x07, 0), {R1, MR3}}, + {"ld8.s.nt1", M, OpMXX6aHint (4, 0, 0, 0x07, 1), {R1, MR3}}, + {"ld8.s.nta", M, OpMXX6aHint (4, 0, 0, 0x07, 3), {R1, MR3}}, + {"ld1.a", M, OpMXX6aHint (4, 0, 0, 0x08, 0), {R1, MR3}}, + {"ld1.a.nt1", M, OpMXX6aHint (4, 0, 0, 0x08, 1), {R1, MR3}}, + {"ld1.a.nta", M, OpMXX6aHint (4, 0, 0, 0x08, 3), {R1, MR3}}, + {"ld2.a", M, OpMXX6aHint (4, 0, 0, 0x09, 0), {R1, MR3}}, + {"ld2.a.nt1", M, OpMXX6aHint (4, 0, 0, 0x09, 1), {R1, MR3}}, + {"ld2.a.nta", M, OpMXX6aHint (4, 0, 0, 0x09, 3), {R1, MR3}}, + {"ld4.a", M, OpMXX6aHint (4, 0, 0, 0x0a, 0), {R1, MR3}}, + {"ld4.a.nt1", M, OpMXX6aHint (4, 0, 0, 0x0a, 1), {R1, MR3}}, + {"ld4.a.nta", M, OpMXX6aHint (4, 0, 0, 0x0a, 3), {R1, MR3}}, + {"ld8.a", M, OpMXX6aHint (4, 0, 0, 0x0b, 0), {R1, MR3}}, + {"ld8.a.nt1", M, OpMXX6aHint (4, 0, 0, 0x0b, 1), {R1, MR3}}, + {"ld8.a.nta", M, OpMXX6aHint (4, 0, 0, 0x0b, 3), {R1, MR3}}, + {"ld1.sa", M, OpMXX6aHint (4, 0, 0, 0x0c, 0), {R1, MR3}}, + {"ld1.sa.nt1", M, OpMXX6aHint (4, 0, 0, 0x0c, 1), {R1, MR3}}, + {"ld1.sa.nta", M, OpMXX6aHint (4, 0, 0, 0x0c, 3), {R1, MR3}}, + {"ld2.sa", M, OpMXX6aHint (4, 0, 0, 0x0d, 0), {R1, MR3}}, + {"ld2.sa.nt1", M, OpMXX6aHint (4, 0, 0, 0x0d, 1), {R1, MR3}}, + {"ld2.sa.nta", M, OpMXX6aHint (4, 0, 0, 0x0d, 3), {R1, MR3}}, + {"ld4.sa", M, OpMXX6aHint (4, 0, 0, 0x0e, 0), {R1, MR3}}, + {"ld4.sa.nt1", M, OpMXX6aHint (4, 0, 0, 0x0e, 1), {R1, MR3}}, + {"ld4.sa.nta", M, OpMXX6aHint (4, 0, 0, 0x0e, 3), {R1, MR3}}, + {"ld8.sa", M, OpMXX6aHint (4, 0, 0, 0x0f, 0), {R1, MR3}}, + {"ld8.sa.nt1", M, OpMXX6aHint (4, 0, 0, 0x0f, 1), {R1, MR3}}, + {"ld8.sa.nta", M, OpMXX6aHint (4, 0, 0, 0x0f, 3), {R1, MR3}}, + {"ld1.bias", M, OpMXX6aHint (4, 0, 0, 0x10, 0), {R1, MR3}}, + {"ld1.bias.nt1", M, OpMXX6aHint (4, 0, 0, 0x10, 1), {R1, MR3}}, + {"ld1.bias.nta", M, OpMXX6aHint (4, 0, 0, 0x10, 3), {R1, MR3}}, + {"ld2.bias", M, OpMXX6aHint (4, 0, 0, 0x11, 0), {R1, MR3}}, + {"ld2.bias.nt1", M, OpMXX6aHint (4, 0, 0, 0x11, 1), {R1, MR3}}, + {"ld2.bias.nta", M, OpMXX6aHint (4, 0, 0, 0x11, 3), {R1, MR3}}, + {"ld4.bias", M, OpMXX6aHint (4, 0, 0, 0x12, 0), {R1, MR3}}, + {"ld4.bias.nt1", M, OpMXX6aHint (4, 0, 0, 0x12, 1), {R1, MR3}}, + {"ld4.bias.nta", M, OpMXX6aHint (4, 0, 0, 0x12, 3), {R1, MR3}}, + {"ld8.bias", M, OpMXX6aHint (4, 0, 0, 0x13, 0), {R1, MR3}}, + {"ld8.bias.nt1", M, OpMXX6aHint (4, 0, 0, 0x13, 1), {R1, MR3}}, + {"ld8.bias.nta", M, OpMXX6aHint (4, 0, 0, 0x13, 3), {R1, MR3}}, + {"ld1.acq", M, OpMXX6aHint (4, 0, 0, 0x14, 0), {R1, MR3}}, + {"ld1.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x14, 1), {R1, MR3}}, + {"ld1.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x14, 3), {R1, MR3}}, + {"ld2.acq", M, OpMXX6aHint (4, 0, 0, 0x15, 0), {R1, MR3}}, + {"ld2.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x15, 1), {R1, MR3}}, + {"ld2.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x15, 3), {R1, MR3}}, + {"ld4.acq", M, OpMXX6aHint (4, 0, 0, 0x16, 0), {R1, MR3}}, + {"ld4.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x16, 1), {R1, MR3}}, + {"ld4.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x16, 3), {R1, MR3}}, + {"ld8.acq", M, OpMXX6aHint (4, 0, 0, 0x17, 0), {R1, MR3}}, + {"ld8.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x17, 1), {R1, MR3}}, + {"ld8.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x17, 3), {R1, MR3}}, + {"ld8.fill", M, OpMXX6aHint (4, 0, 0, 0x1b, 0), {R1, MR3}}, + {"ld8.fill.nt1", M, OpMXX6aHint (4, 0, 0, 0x1b, 1), {R1, MR3}}, + {"ld8.fill.nta", M, OpMXX6aHint (4, 0, 0, 0x1b, 3), {R1, MR3}}, + {"ld1.c.clr", M, OpMXX6aHint (4, 0, 0, 0x20, 0), {R1, MR3}}, + {"ld1.c.clr.nt1", M, OpMXX6aHint (4, 0, 0, 0x20, 1), {R1, MR3}}, + {"ld1.c.clr.nta", M, OpMXX6aHint (4, 0, 0, 0x20, 3), {R1, MR3}}, + {"ld2.c.clr", M, OpMXX6aHint (4, 0, 0, 0x21, 0), {R1, MR3}}, + {"ld2.c.clr.nt1", M, OpMXX6aHint (4, 0, 0, 0x21, 1), {R1, MR3}}, + {"ld2.c.clr.nta", M, OpMXX6aHint (4, 0, 0, 0x21, 3), {R1, MR3}}, + {"ld4.c.clr", M, OpMXX6aHint (4, 0, 0, 0x22, 0), {R1, MR3}}, + {"ld4.c.clr.nt1", M, OpMXX6aHint (4, 0, 0, 0x22, 1), {R1, MR3}}, + {"ld4.c.clr.nta", M, OpMXX6aHint (4, 0, 0, 0x22, 3), {R1, MR3}}, + {"ld8.c.clr", M, OpMXX6aHint (4, 0, 0, 0x23, 0), {R1, MR3}}, + {"ld8.c.clr.nt1", M, OpMXX6aHint (4, 0, 0, 0x23, 1), {R1, MR3}}, + {"ld8.c.clr.nta", M, OpMXX6aHint (4, 0, 0, 0x23, 3), {R1, MR3}}, + {"ld1.c.nc", M, OpMXX6aHint (4, 0, 0, 0x24, 0), {R1, MR3}}, + {"ld1.c.nc.nt1", M, OpMXX6aHint (4, 0, 0, 0x24, 1), {R1, MR3}}, + {"ld1.c.nc.nta", M, OpMXX6aHint (4, 0, 0, 0x24, 3), {R1, MR3}}, + {"ld2.c.nc", M, OpMXX6aHint (4, 0, 0, 0x25, 0), {R1, MR3}}, + {"ld2.c.nc.nt1", M, OpMXX6aHint (4, 0, 0, 0x25, 1), {R1, MR3}}, + {"ld2.c.nc.nta", M, OpMXX6aHint (4, 0, 0, 0x25, 3), {R1, MR3}}, + {"ld4.c.nc", M, OpMXX6aHint (4, 0, 0, 0x26, 0), {R1, MR3}}, + {"ld4.c.nc.nt1", M, OpMXX6aHint (4, 0, 0, 0x26, 1), {R1, MR3}}, + {"ld4.c.nc.nta", M, OpMXX6aHint (4, 0, 0, 0x26, 3), {R1, MR3}}, + {"ld8.c.nc", M, OpMXX6aHint (4, 0, 0, 0x27, 0), {R1, MR3}}, + {"ld8.c.nc.nt1", M, OpMXX6aHint (4, 0, 0, 0x27, 1), {R1, MR3}}, + {"ld8.c.nc.nta", M, OpMXX6aHint (4, 0, 0, 0x27, 3), {R1, MR3}}, + {"ld1.c.clr.acq", M, OpMXX6aHint (4, 0, 0, 0x28, 0), {R1, MR3}}, + {"ld1.c.clr.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x28, 1), {R1, MR3}}, + {"ld1.c.clr.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x28, 3), {R1, MR3}}, + {"ld2.c.clr.acq", M, OpMXX6aHint (4, 0, 0, 0x29, 0), {R1, MR3}}, + {"ld2.c.clr.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x29, 1), {R1, MR3}}, + {"ld2.c.clr.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x29, 3), {R1, MR3}}, + {"ld4.c.clr.acq", M, OpMXX6aHint (4, 0, 0, 0x2a, 0), {R1, MR3}}, + {"ld4.c.clr.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x2a, 1), {R1, MR3}}, + {"ld4.c.clr.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x2a, 3), {R1, MR3}}, + {"ld8.c.clr.acq", M, OpMXX6aHint (4, 0, 0, 0x2b, 0), {R1, MR3}}, + {"ld8.c.clr.acq.nt1", M, OpMXX6aHint (4, 0, 0, 0x2b, 1), {R1, MR3}}, + {"ld8.c.clr.acq.nta", M, OpMXX6aHint (4, 0, 0, 0x2b, 3), {R1, MR3}}, + + /* integer load w/increment by register */ +#define LDINCREG(c,h) M, OpMXX6aHint (4, 1, 0, c, h), {R1, MR3, R2}, POSTINC, + {"ld1", LDINCREG (0x00, 0)}, + {"ld1.nt1", LDINCREG (0x00, 1)}, + {"ld1.nta", LDINCREG (0x00, 3)}, + {"ld2", LDINCREG (0x01, 0)}, + {"ld2.nt1", LDINCREG (0x01, 1)}, + {"ld2.nta", LDINCREG (0x01, 3)}, + {"ld4", LDINCREG (0x02, 0)}, + {"ld4.nt1", LDINCREG (0x02, 1)}, + {"ld4.nta", LDINCREG (0x02, 3)}, + {"ld8", LDINCREG (0x03, 0)}, + {"ld8.nt1", LDINCREG (0x03, 1)}, + {"ld8.nta", LDINCREG (0x03, 3)}, + {"ld1.s", LDINCREG (0x04, 0)}, + {"ld1.s.nt1", LDINCREG (0x04, 1)}, + {"ld1.s.nta", LDINCREG (0x04, 3)}, + {"ld2.s", LDINCREG (0x05, 0)}, + {"ld2.s.nt1", LDINCREG (0x05, 1)}, + {"ld2.s.nta", LDINCREG (0x05, 3)}, + {"ld4.s", LDINCREG (0x06, 0)}, + {"ld4.s.nt1", LDINCREG (0x06, 1)}, + {"ld4.s.nta", LDINCREG (0x06, 3)}, + {"ld8.s", LDINCREG (0x07, 0)}, + {"ld8.s.nt1", LDINCREG (0x07, 1)}, + {"ld8.s.nta", LDINCREG (0x07, 3)}, + {"ld1.a", LDINCREG (0x08, 0)}, + {"ld1.a.nt1", LDINCREG (0x08, 1)}, + {"ld1.a.nta", LDINCREG (0x08, 3)}, + {"ld2.a", LDINCREG (0x09, 0)}, + {"ld2.a.nt1", LDINCREG (0x09, 1)}, + {"ld2.a.nta", LDINCREG (0x09, 3)}, + {"ld4.a", LDINCREG (0x0a, 0)}, + {"ld4.a.nt1", LDINCREG (0x0a, 1)}, + {"ld4.a.nta", LDINCREG (0x0a, 3)}, + {"ld8.a", LDINCREG (0x0b, 0)}, + {"ld8.a.nt1", LDINCREG (0x0b, 1)}, + {"ld8.a.nta", LDINCREG (0x0b, 3)}, + {"ld1.sa", LDINCREG (0x0c, 0)}, + {"ld1.sa.nt1", LDINCREG (0x0c, 1)}, + {"ld1.sa.nta", LDINCREG (0x0c, 3)}, + {"ld2.sa", LDINCREG (0x0d, 0)}, + {"ld2.sa.nt1", LDINCREG (0x0d, 1)}, + {"ld2.sa.nta", LDINCREG (0x0d, 3)}, + {"ld4.sa", LDINCREG (0x0e, 0)}, + {"ld4.sa.nt1", LDINCREG (0x0e, 1)}, + {"ld4.sa.nta", LDINCREG (0x0e, 3)}, + {"ld8.sa", LDINCREG (0x0f, 0)}, + {"ld8.sa.nt1", LDINCREG (0x0f, 1)}, + {"ld8.sa.nta", LDINCREG (0x0f, 3)}, + {"ld1.bias", LDINCREG (0x10, 0)}, + {"ld1.bias.nt1", LDINCREG (0x10, 1)}, + {"ld1.bias.nta", LDINCREG (0x10, 3)}, + {"ld2.bias", LDINCREG (0x11, 0)}, + {"ld2.bias.nt1", LDINCREG (0x11, 1)}, + {"ld2.bias.nta", LDINCREG (0x11, 3)}, + {"ld4.bias", LDINCREG (0x12, 0)}, + {"ld4.bias.nt1", LDINCREG (0x12, 1)}, + {"ld4.bias.nta", LDINCREG (0x12, 3)}, + {"ld8.bias", LDINCREG (0x13, 0)}, + {"ld8.bias.nt1", LDINCREG (0x13, 1)}, + {"ld8.bias.nta", LDINCREG (0x13, 3)}, + {"ld1.acq", LDINCREG (0x14, 0)}, + {"ld1.acq.nt1", LDINCREG (0x14, 1)}, + {"ld1.acq.nta", LDINCREG (0x14, 3)}, + {"ld2.acq", LDINCREG (0x15, 0)}, + {"ld2.acq.nt1", LDINCREG (0x15, 1)}, + {"ld2.acq.nta", LDINCREG (0x15, 3)}, + {"ld4.acq", LDINCREG (0x16, 0)}, + {"ld4.acq.nt1", LDINCREG (0x16, 1)}, + {"ld4.acq.nta", LDINCREG (0x16, 3)}, + {"ld8.acq", LDINCREG (0x17, 0)}, + {"ld8.acq.nt1", LDINCREG (0x17, 1)}, + {"ld8.acq.nta", LDINCREG (0x17, 3)}, + {"ld8.fill", LDINCREG (0x1b, 0)}, + {"ld8.fill.nt1", LDINCREG (0x1b, 1)}, + {"ld8.fill.nta", LDINCREG (0x1b, 3)}, + {"ld1.c.clr", LDINCREG (0x20, 0)}, + {"ld1.c.clr.nt1", LDINCREG (0x20, 1)}, + {"ld1.c.clr.nta", LDINCREG (0x20, 3)}, + {"ld2.c.clr", LDINCREG (0x21, 0)}, + {"ld2.c.clr.nt1", LDINCREG (0x21, 1)}, + {"ld2.c.clr.nta", LDINCREG (0x21, 3)}, + {"ld4.c.clr", LDINCREG (0x22, 0)}, + {"ld4.c.clr.nt1", LDINCREG (0x22, 1)}, + {"ld4.c.clr.nta", LDINCREG (0x22, 3)}, + {"ld8.c.clr", LDINCREG (0x23, 0)}, + {"ld8.c.clr.nt1", LDINCREG (0x23, 1)}, + {"ld8.c.clr.nta", LDINCREG (0x23, 3)}, + {"ld1.c.nc", LDINCREG (0x24, 0)}, + {"ld1.c.nc.nt1", LDINCREG (0x24, 1)}, + {"ld1.c.nc.nta", LDINCREG (0x24, 3)}, + {"ld2.c.nc", LDINCREG (0x25, 0)}, + {"ld2.c.nc.nt1", LDINCREG (0x25, 1)}, + {"ld2.c.nc.nta", LDINCREG (0x25, 3)}, + {"ld4.c.nc", LDINCREG (0x26, 0)}, + {"ld4.c.nc.nt1", LDINCREG (0x26, 1)}, + {"ld4.c.nc.nta", LDINCREG (0x26, 3)}, + {"ld8.c.nc", LDINCREG (0x27, 0)}, + {"ld8.c.nc.nt1", LDINCREG (0x27, 1)}, + {"ld8.c.nc.nta", LDINCREG (0x27, 3)}, + {"ld1.c.clr.acq", LDINCREG (0x28, 0)}, + {"ld1.c.clr.acq.nt1", LDINCREG (0x28, 1)}, + {"ld1.c.clr.acq.nta", LDINCREG (0x28, 3)}, + {"ld2.c.clr.acq", LDINCREG (0x29, 0)}, + {"ld2.c.clr.acq.nt1", LDINCREG (0x29, 1)}, + {"ld2.c.clr.acq.nta", LDINCREG (0x29, 3)}, + {"ld4.c.clr.acq", LDINCREG (0x2a, 0)}, + {"ld4.c.clr.acq.nt1", LDINCREG (0x2a, 1)}, + {"ld4.c.clr.acq.nta", LDINCREG (0x2a, 3)}, + {"ld8.c.clr.acq", LDINCREG (0x2b, 0)}, + {"ld8.c.clr.acq.nt1", LDINCREG (0x2b, 1)}, + {"ld8.c.clr.acq.nta", LDINCREG (0x2b, 3)}, +#undef LDINCREG + + {"st1", M, OpMXX6aHint (4, 0, 0, 0x30, 0), {MR3, R2}}, + {"st1.nta", M, OpMXX6aHint (4, 0, 0, 0x30, 3), {MR3, R2}}, + {"st2", M, OpMXX6aHint (4, 0, 0, 0x31, 0), {MR3, R2}}, + {"st2.nta", M, OpMXX6aHint (4, 0, 0, 0x31, 3), {MR3, R2}}, + {"st4", M, OpMXX6aHint (4, 0, 0, 0x32, 0), {MR3, R2}}, + {"st4.nta", M, OpMXX6aHint (4, 0, 0, 0x32, 3), {MR3, R2}}, + {"st8", M, OpMXX6aHint (4, 0, 0, 0x33, 0), {MR3, R2}}, + {"st8.nta", M, OpMXX6aHint (4, 0, 0, 0x33, 3), {MR3, R2}}, + {"st1.rel", M, OpMXX6aHint (4, 0, 0, 0x34, 0), {MR3, R2}}, + {"st1.rel.nta", M, OpMXX6aHint (4, 0, 0, 0x34, 3), {MR3, R2}}, + {"st2.rel", M, OpMXX6aHint (4, 0, 0, 0x35, 0), {MR3, R2}}, + {"st2.rel.nta", M, OpMXX6aHint (4, 0, 0, 0x35, 3), {MR3, R2}}, + {"st4.rel", M, OpMXX6aHint (4, 0, 0, 0x36, 0), {MR3, R2}}, + {"st4.rel.nta", M, OpMXX6aHint (4, 0, 0, 0x36, 3), {MR3, R2}}, + {"st8.rel", M, OpMXX6aHint (4, 0, 0, 0x37, 0), {MR3, R2}}, + {"st8.rel.nta", M, OpMXX6aHint (4, 0, 0, 0x37, 3), {MR3, R2}}, + {"st8.spill", M, OpMXX6aHint (4, 0, 0, 0x3b, 0), {MR3, R2}}, + {"st8.spill.nta", M, OpMXX6aHint (4, 0, 0, 0x3b, 3), {MR3, R2}}, + +#define CMPXCHG(c,h) M, OpMXX6aHint (4, 0, 1, c, h), {R1, MR3, R2, AR_CCV} + {"cmpxchg1.acq", CMPXCHG (0x00, 0)}, + {"cmpxchg1.acq.nt1", CMPXCHG (0x00, 1)}, + {"cmpxchg1.acq.nta", CMPXCHG (0x00, 3)}, + {"cmpxchg2.acq", CMPXCHG (0x01, 0)}, + {"cmpxchg2.acq.nt1", CMPXCHG (0x01, 1)}, + {"cmpxchg2.acq.nta", CMPXCHG (0x01, 3)}, + {"cmpxchg4.acq", CMPXCHG (0x02, 0)}, + {"cmpxchg4.acq.nt1", CMPXCHG (0x02, 1)}, + {"cmpxchg4.acq.nta", CMPXCHG (0x02, 3)}, + {"cmpxchg8.acq", CMPXCHG (0x03, 0)}, + {"cmpxchg8.acq.nt1", CMPXCHG (0x03, 1)}, + {"cmpxchg8.acq.nta", CMPXCHG (0x03, 3)}, + {"cmpxchg1.rel", CMPXCHG (0x04, 0)}, + {"cmpxchg1.rel.nt1", CMPXCHG (0x04, 1)}, + {"cmpxchg1.rel.nta", CMPXCHG (0x04, 3)}, + {"cmpxchg2.rel", CMPXCHG (0x05, 0)}, + {"cmpxchg2.rel.nt1", CMPXCHG (0x05, 1)}, + {"cmpxchg2.rel.nta", CMPXCHG (0x05, 3)}, + {"cmpxchg4.rel", CMPXCHG (0x06, 0)}, + {"cmpxchg4.rel.nt1", CMPXCHG (0x06, 1)}, + {"cmpxchg4.rel.nta", CMPXCHG (0x06, 3)}, + {"cmpxchg8.rel", CMPXCHG (0x07, 0)}, + {"cmpxchg8.rel.nt1", CMPXCHG (0x07, 1)}, + {"cmpxchg8.rel.nta", CMPXCHG (0x07, 3)}, +#undef CMPXCHG + {"xchg1", M, OpMXX6aHint (4, 0, 1, 0x08, 0), {R1, MR3, R2}}, + {"xchg1.nt1", M, OpMXX6aHint (4, 0, 1, 0x08, 1), {R1, MR3, R2}}, + {"xchg1.nta", M, OpMXX6aHint (4, 0, 1, 0x08, 3), {R1, MR3, R2}}, + {"xchg2", M, OpMXX6aHint (4, 0, 1, 0x09, 0), {R1, MR3, R2}}, + {"xchg2.nt1", M, OpMXX6aHint (4, 0, 1, 0x09, 1), {R1, MR3, R2}}, + {"xchg2.nta", M, OpMXX6aHint (4, 0, 1, 0x09, 3), {R1, MR3, R2}}, + {"xchg4", M, OpMXX6aHint (4, 0, 1, 0x0a, 0), {R1, MR3, R2}}, + {"xchg4.nt1", M, OpMXX6aHint (4, 0, 1, 0x0a, 1), {R1, MR3, R2}}, + {"xchg4.nta", M, OpMXX6aHint (4, 0, 1, 0x0a, 3), {R1, MR3, R2}}, + {"xchg8", M, OpMXX6aHint (4, 0, 1, 0x0b, 0), {R1, MR3, R2}}, + {"xchg8.nt1", M, OpMXX6aHint (4, 0, 1, 0x0b, 1), {R1, MR3, R2}}, + {"xchg8.nta", M, OpMXX6aHint (4, 0, 1, 0x0b, 3), {R1, MR3, R2}}, + + {"fetchadd4.acq", M, OpMXX6aHint (4, 0, 1, 0x12, 0), {R1, MR3, INC3}}, + {"fetchadd4.acq.nt1", M, OpMXX6aHint (4, 0, 1, 0x12, 1), {R1, MR3, INC3}}, + {"fetchadd4.acq.nta", M, OpMXX6aHint (4, 0, 1, 0x12, 3), {R1, MR3, INC3}}, + {"fetchadd8.acq", M, OpMXX6aHint (4, 0, 1, 0x13, 0), {R1, MR3, INC3}}, + {"fetchadd8.acq.nt1", M, OpMXX6aHint (4, 0, 1, 0x13, 1), {R1, MR3, INC3}}, + {"fetchadd8.acq.nta", M, OpMXX6aHint (4, 0, 1, 0x13, 3), {R1, MR3, INC3}}, + {"fetchadd4.rel", M, OpMXX6aHint (4, 0, 1, 0x16, 0), {R1, MR3, INC3}}, + {"fetchadd4.rel.nt1", M, OpMXX6aHint (4, 0, 1, 0x16, 1), {R1, MR3, INC3}}, + {"fetchadd4.rel.nta", M, OpMXX6aHint (4, 0, 1, 0x16, 3), {R1, MR3, INC3}}, + {"fetchadd8.rel", M, OpMXX6aHint (4, 0, 1, 0x17, 0), {R1, MR3, INC3}}, + {"fetchadd8.rel.nt1", M, OpMXX6aHint (4, 0, 1, 0x17, 1), {R1, MR3, INC3}}, + {"fetchadd8.rel.nta", M, OpMXX6aHint (4, 0, 1, 0x17, 3), {R1, MR3, INC3}}, + + {"getf.sig", M, OpMXX6a (4, 0, 1, 0x1c), {R1, F2}}, + {"getf.exp", M, OpMXX6a (4, 0, 1, 0x1d), {R1, F2}}, + {"getf.s", M, OpMXX6a (4, 0, 1, 0x1e), {R1, F2}}, + {"getf.d", M, OpMXX6a (4, 0, 1, 0x1f), {R1, F2}}, + + /* integer load w/increment by immediate */ +#define LDINCIMMED(c,h) M, OpX6aHint (5, c, h), {R1, MR3, IMM9b}, POSTINC + {"ld1", LDINCIMMED (0x00, 0)}, + {"ld1.nt1", LDINCIMMED (0x00, 1)}, + {"ld1.nta", LDINCIMMED (0x00, 3)}, + {"ld2", LDINCIMMED (0x01, 0)}, + {"ld2.nt1", LDINCIMMED (0x01, 1)}, + {"ld2.nta", LDINCIMMED (0x01, 3)}, + {"ld4", LDINCIMMED (0x02, 0)}, + {"ld4.nt1", LDINCIMMED (0x02, 1)}, + {"ld4.nta", LDINCIMMED (0x02, 3)}, + {"ld8", LDINCIMMED (0x03, 0)}, + {"ld8.nt1", LDINCIMMED (0x03, 1)}, + {"ld8.nta", LDINCIMMED (0x03, 3)}, + {"ld1.s", LDINCIMMED (0x04, 0)}, + {"ld1.s.nt1", LDINCIMMED (0x04, 1)}, + {"ld1.s.nta", LDINCIMMED (0x04, 3)}, + {"ld2.s", LDINCIMMED (0x05, 0)}, + {"ld2.s.nt1", LDINCIMMED (0x05, 1)}, + {"ld2.s.nta", LDINCIMMED (0x05, 3)}, + {"ld4.s", LDINCIMMED (0x06, 0)}, + {"ld4.s.nt1", LDINCIMMED (0x06, 1)}, + {"ld4.s.nta", LDINCIMMED (0x06, 3)}, + {"ld8.s", LDINCIMMED (0x07, 0)}, + {"ld8.s.nt1", LDINCIMMED (0x07, 1)}, + {"ld8.s.nta", LDINCIMMED (0x07, 3)}, + {"ld1.a", LDINCIMMED (0x08, 0)}, + {"ld1.a.nt1", LDINCIMMED (0x08, 1)}, + {"ld1.a.nta", LDINCIMMED (0x08, 3)}, + {"ld2.a", LDINCIMMED (0x09, 0)}, + {"ld2.a.nt1", LDINCIMMED (0x09, 1)}, + {"ld2.a.nta", LDINCIMMED (0x09, 3)}, + {"ld4.a", LDINCIMMED (0x0a, 0)}, + {"ld4.a.nt1", LDINCIMMED (0x0a, 1)}, + {"ld4.a.nta", LDINCIMMED (0x0a, 3)}, + {"ld8.a", LDINCIMMED (0x0b, 0)}, + {"ld8.a.nt1", LDINCIMMED (0x0b, 1)}, + {"ld8.a.nta", LDINCIMMED (0x0b, 3)}, + {"ld1.sa", LDINCIMMED (0x0c, 0)}, + {"ld1.sa.nt1", LDINCIMMED (0x0c, 1)}, + {"ld1.sa.nta", LDINCIMMED (0x0c, 3)}, + {"ld2.sa", LDINCIMMED (0x0d, 0)}, + {"ld2.sa.nt1", LDINCIMMED (0x0d, 1)}, + {"ld2.sa.nta", LDINCIMMED (0x0d, 3)}, + {"ld4.sa", LDINCIMMED (0x0e, 0)}, + {"ld4.sa.nt1", LDINCIMMED (0x0e, 1)}, + {"ld4.sa.nta", LDINCIMMED (0x0e, 3)}, + {"ld8.sa", LDINCIMMED (0x0f, 0)}, + {"ld8.sa.nt1", LDINCIMMED (0x0f, 1)}, + {"ld8.sa.nta", LDINCIMMED (0x0f, 3)}, + {"ld1.bias", LDINCIMMED (0x10, 0)}, + {"ld1.bias.nt1", LDINCIMMED (0x10, 1)}, + {"ld1.bias.nta", LDINCIMMED (0x10, 3)}, + {"ld2.bias", LDINCIMMED (0x11, 0)}, + {"ld2.bias.nt1", LDINCIMMED (0x11, 1)}, + {"ld2.bias.nta", LDINCIMMED (0x11, 3)}, + {"ld4.bias", LDINCIMMED (0x12, 0)}, + {"ld4.bias.nt1", LDINCIMMED (0x12, 1)}, + {"ld4.bias.nta", LDINCIMMED (0x12, 3)}, + {"ld8.bias", LDINCIMMED (0x13, 0)}, + {"ld8.bias.nt1", LDINCIMMED (0x13, 1)}, + {"ld8.bias.nta", LDINCIMMED (0x13, 3)}, + {"ld1.acq", LDINCIMMED (0x14, 0)}, + {"ld1.acq.nt1", LDINCIMMED (0x14, 1)}, + {"ld1.acq.nta", LDINCIMMED (0x14, 3)}, + {"ld2.acq", LDINCIMMED (0x15, 0)}, + {"ld2.acq.nt1", LDINCIMMED (0x15, 1)}, + {"ld2.acq.nta", LDINCIMMED (0x15, 3)}, + {"ld4.acq", LDINCIMMED (0x16, 0)}, + {"ld4.acq.nt1", LDINCIMMED (0x16, 1)}, + {"ld4.acq.nta", LDINCIMMED (0x16, 3)}, + {"ld8.acq", LDINCIMMED (0x17, 0)}, + {"ld8.acq.nt1", LDINCIMMED (0x17, 1)}, + {"ld8.acq.nta", LDINCIMMED (0x17, 3)}, + {"ld8.fill", LDINCIMMED (0x1b, 0)}, + {"ld8.fill.nt1", LDINCIMMED (0x1b, 1)}, + {"ld8.fill.nta", LDINCIMMED (0x1b, 3)}, + {"ld1.c.clr", LDINCIMMED (0x20, 0)}, + {"ld1.c.clr.nt1", LDINCIMMED (0x20, 1)}, + {"ld1.c.clr.nta", LDINCIMMED (0x20, 3)}, + {"ld2.c.clr", LDINCIMMED (0x21, 0)}, + {"ld2.c.clr.nt1", LDINCIMMED (0x21, 1)}, + {"ld2.c.clr.nta", LDINCIMMED (0x21, 3)}, + {"ld4.c.clr", LDINCIMMED (0x22, 0)}, + {"ld4.c.clr.nt1", LDINCIMMED (0x22, 1)}, + {"ld4.c.clr.nta", LDINCIMMED (0x22, 3)}, + {"ld8.c.clr", LDINCIMMED (0x23, 0)}, + {"ld8.c.clr.nt1", LDINCIMMED (0x23, 1)}, + {"ld8.c.clr.nta", LDINCIMMED (0x23, 3)}, + {"ld1.c.nc", LDINCIMMED (0x24, 0)}, + {"ld1.c.nc.nt1", LDINCIMMED (0x24, 1)}, + {"ld1.c.nc.nta", LDINCIMMED (0x24, 3)}, + {"ld2.c.nc", LDINCIMMED (0x25, 0)}, + {"ld2.c.nc.nt1", LDINCIMMED (0x25, 1)}, + {"ld2.c.nc.nta", LDINCIMMED (0x25, 3)}, + {"ld4.c.nc", LDINCIMMED (0x26, 0)}, + {"ld4.c.nc.nt1", LDINCIMMED (0x26, 1)}, + {"ld4.c.nc.nta", LDINCIMMED (0x26, 3)}, + {"ld8.c.nc", LDINCIMMED (0x27, 0)}, + {"ld8.c.nc.nt1", LDINCIMMED (0x27, 1)}, + {"ld8.c.nc.nta", LDINCIMMED (0x27, 3)}, + {"ld1.c.clr.acq", LDINCIMMED (0x28, 0)}, + {"ld1.c.clr.acq.nt1", LDINCIMMED (0x28, 1)}, + {"ld1.c.clr.acq.nta", LDINCIMMED (0x28, 3)}, + {"ld2.c.clr.acq", LDINCIMMED (0x29, 0)}, + {"ld2.c.clr.acq.nt1", LDINCIMMED (0x29, 1)}, + {"ld2.c.clr.acq.nta", LDINCIMMED (0x29, 3)}, + {"ld4.c.clr.acq", LDINCIMMED (0x2a, 0)}, + {"ld4.c.clr.acq.nt1", LDINCIMMED (0x2a, 1)}, + {"ld4.c.clr.acq.nta", LDINCIMMED (0x2a, 3)}, + {"ld8.c.clr.acq", LDINCIMMED (0x2b, 0)}, + {"ld8.c.clr.acq.nt1", LDINCIMMED (0x2b, 1)}, + {"ld8.c.clr.acq.nta", LDINCIMMED (0x2b, 3)}, +#undef LDINCIMMED + + /* store w/increment by immediate */ +#define STINCIMMED(c,h) M, OpX6aHint (5, c, h), {MR3, R2, IMM9a}, POSTINC + {"st1", STINCIMMED (0x30, 0)}, + {"st1.nta", STINCIMMED (0x30, 3)}, + {"st2", STINCIMMED (0x31, 0)}, + {"st2.nta", STINCIMMED (0x31, 3)}, + {"st4", STINCIMMED (0x32, 0)}, + {"st4.nta", STINCIMMED (0x32, 3)}, + {"st8", STINCIMMED (0x33, 0)}, + {"st8.nta", STINCIMMED (0x33, 3)}, + {"st1.rel", STINCIMMED (0x34, 0)}, + {"st1.rel.nta", STINCIMMED (0x34, 3)}, + {"st2.rel", STINCIMMED (0x35, 0)}, + {"st2.rel.nta", STINCIMMED (0x35, 3)}, + {"st4.rel", STINCIMMED (0x36, 0)}, + {"st4.rel.nta", STINCIMMED (0x36, 3)}, + {"st8.rel", STINCIMMED (0x37, 0)}, + {"st8.rel.nta", STINCIMMED (0x37, 3)}, + {"st8.spill", STINCIMMED (0x3b, 0)}, + {"st8.spill.nta", STINCIMMED (0x3b, 3)}, +#undef STINCIMMED + + /* floating-point load */ + {"ldfs", M, OpMXX6aHint (6, 0, 0, 0x02, 0), {F1, MR3}}, + {"ldfs.nt1", M, OpMXX6aHint (6, 0, 0, 0x02, 1), {F1, MR3}}, + {"ldfs.nta", M, OpMXX6aHint (6, 0, 0, 0x02, 3), {F1, MR3}}, + {"ldfd", M, OpMXX6aHint (6, 0, 0, 0x03, 0), {F1, MR3}}, + {"ldfd.nt1", M, OpMXX6aHint (6, 0, 0, 0x03, 1), {F1, MR3}}, + {"ldfd.nta", M, OpMXX6aHint (6, 0, 0, 0x03, 3), {F1, MR3}}, + {"ldf8", M, OpMXX6aHint (6, 0, 0, 0x01, 0), {F1, MR3}}, + {"ldf8.nt1", M, OpMXX6aHint (6, 0, 0, 0x01, 1), {F1, MR3}}, + {"ldf8.nta", M, OpMXX6aHint (6, 0, 0, 0x01, 3), {F1, MR3}}, + {"ldfe", M, OpMXX6aHint (6, 0, 0, 0x00, 0), {F1, MR3}}, + {"ldfe.nt1", M, OpMXX6aHint (6, 0, 0, 0x00, 1), {F1, MR3}}, + {"ldfe.nta", M, OpMXX6aHint (6, 0, 0, 0x00, 3), {F1, MR3}}, + {"ldfs.s", M, OpMXX6aHint (6, 0, 0, 0x06, 0), {F1, MR3}}, + {"ldfs.s.nt1", M, OpMXX6aHint (6, 0, 0, 0x06, 1), {F1, MR3}}, + {"ldfs.s.nta", M, OpMXX6aHint (6, 0, 0, 0x06, 3), {F1, MR3}}, + {"ldfd.s", M, OpMXX6aHint (6, 0, 0, 0x07, 0), {F1, MR3}}, + {"ldfd.s.nt1", M, OpMXX6aHint (6, 0, 0, 0x07, 1), {F1, MR3}}, + {"ldfd.s.nta", M, OpMXX6aHint (6, 0, 0, 0x07, 3), {F1, MR3}}, + {"ldf8.s", M, OpMXX6aHint (6, 0, 0, 0x05, 0), {F1, MR3}}, + {"ldf8.s.nt1", M, OpMXX6aHint (6, 0, 0, 0x05, 1), {F1, MR3}}, + {"ldf8.s.nta", M, OpMXX6aHint (6, 0, 0, 0x05, 3), {F1, MR3}}, + {"ldfe.s", M, OpMXX6aHint (6, 0, 0, 0x04, 0), {F1, MR3}}, + {"ldfe.s.nt1", M, OpMXX6aHint (6, 0, 0, 0x04, 1), {F1, MR3}}, + {"ldfe.s.nta", M, OpMXX6aHint (6, 0, 0, 0x04, 3), {F1, MR3}}, + {"ldfs.a", M, OpMXX6aHint (6, 0, 0, 0x0a, 0), {F1, MR3}}, + {"ldfs.a.nt1", M, OpMXX6aHint (6, 0, 0, 0x0a, 1), {F1, MR3}}, + {"ldfs.a.nta", M, OpMXX6aHint (6, 0, 0, 0x0a, 3), {F1, MR3}}, + {"ldfd.a", M, OpMXX6aHint (6, 0, 0, 0x0b, 0), {F1, MR3}}, + {"ldfd.a.nt1", M, OpMXX6aHint (6, 0, 0, 0x0b, 1), {F1, MR3}}, + {"ldfd.a.nta", M, OpMXX6aHint (6, 0, 0, 0x0b, 3), {F1, MR3}}, + {"ldf8.a", M, OpMXX6aHint (6, 0, 0, 0x09, 0), {F1, MR3}}, + {"ldf8.a.nt1", M, OpMXX6aHint (6, 0, 0, 0x09, 1), {F1, MR3}}, + {"ldf8.a.nta", M, OpMXX6aHint (6, 0, 0, 0x09, 3), {F1, MR3}}, + {"ldfe.a", M, OpMXX6aHint (6, 0, 0, 0x08, 0), {F1, MR3}}, + {"ldfe.a.nt1", M, OpMXX6aHint (6, 0, 0, 0x08, 1), {F1, MR3}}, + {"ldfe.a.nta", M, OpMXX6aHint (6, 0, 0, 0x08, 3), {F1, MR3}}, + {"ldfs.sa", M, OpMXX6aHint (6, 0, 0, 0x0e, 0), {F1, MR3}}, + {"ldfs.sa.nt1", M, OpMXX6aHint (6, 0, 0, 0x0e, 1), {F1, MR3}}, + {"ldfs.sa.nta", M, OpMXX6aHint (6, 0, 0, 0x0e, 3), {F1, MR3}}, + {"ldfd.sa", M, OpMXX6aHint (6, 0, 0, 0x0f, 0), {F1, MR3}}, + {"ldfd.sa.nt1", M, OpMXX6aHint (6, 0, 0, 0x0f, 1), {F1, MR3}}, + {"ldfd.sa.nta", M, OpMXX6aHint (6, 0, 0, 0x0f, 3), {F1, MR3}}, + {"ldf8.sa", M, OpMXX6aHint (6, 0, 0, 0x0d, 0), {F1, MR3}}, + {"ldf8.sa.nt1", M, OpMXX6aHint (6, 0, 0, 0x0d, 1), {F1, MR3}}, + {"ldf8.sa.nta", M, OpMXX6aHint (6, 0, 0, 0x0d, 3), {F1, MR3}}, + {"ldfe.sa", M, OpMXX6aHint (6, 0, 0, 0x0c, 0), {F1, MR3}}, + {"ldfe.sa.nt1", M, OpMXX6aHint (6, 0, 0, 0x0c, 1), {F1, MR3}}, + {"ldfe.sa.nta", M, OpMXX6aHint (6, 0, 0, 0x0c, 3), {F1, MR3}}, + {"ldf.fill", M, OpMXX6aHint (6, 0, 0, 0x1b, 0), {F1, MR3}}, + {"ldf.fill.nt1", M, OpMXX6aHint (6, 0, 0, 0x1b, 1), {F1, MR3}}, + {"ldf.fill.nta", M, OpMXX6aHint (6, 0, 0, 0x1b, 3), {F1, MR3}}, + {"ldfs.c.clr", M, OpMXX6aHint (6, 0, 0, 0x22, 0), {F1, MR3}}, + {"ldfs.c.clr.nt1", M, OpMXX6aHint (6, 0, 0, 0x22, 1), {F1, MR3}}, + {"ldfs.c.clr.nta", M, OpMXX6aHint (6, 0, 0, 0x22, 3), {F1, MR3}}, + {"ldfd.c.clr", M, OpMXX6aHint (6, 0, 0, 0x23, 0), {F1, MR3}}, + {"ldfd.c.clr.nt1", M, OpMXX6aHint (6, 0, 0, 0x23, 1), {F1, MR3}}, + {"ldfd.c.clr.nta", M, OpMXX6aHint (6, 0, 0, 0x23, 3), {F1, MR3}}, + {"ldf8.c.clr", M, OpMXX6aHint (6, 0, 0, 0x21, 0), {F1, MR3}}, + {"ldf8.c.clr.nt1", M, OpMXX6aHint (6, 0, 0, 0x21, 1), {F1, MR3}}, + {"ldf8.c.clr.nta", M, OpMXX6aHint (6, 0, 0, 0x21, 3), {F1, MR3}}, + {"ldfe.c.clr", M, OpMXX6aHint (6, 0, 0, 0x20, 0), {F1, MR3}}, + {"ldfe.c.clr.nt1", M, OpMXX6aHint (6, 0, 0, 0x20, 1), {F1, MR3}}, + {"ldfe.c.clr.nta", M, OpMXX6aHint (6, 0, 0, 0x20, 3), {F1, MR3}}, + {"ldfs.c.nc", M, OpMXX6aHint (6, 0, 0, 0x26, 0), {F1, MR3}}, + {"ldfs.c.nc.nt1", M, OpMXX6aHint (6, 0, 0, 0x26, 1), {F1, MR3}}, + {"ldfs.c.nc.nta", M, OpMXX6aHint (6, 0, 0, 0x26, 3), {F1, MR3}}, + {"ldfd.c.nc", M, OpMXX6aHint (6, 0, 0, 0x27, 0), {F1, MR3}}, + {"ldfd.c.nc.nt1", M, OpMXX6aHint (6, 0, 0, 0x27, 1), {F1, MR3}}, + {"ldfd.c.nc.nta", M, OpMXX6aHint (6, 0, 0, 0x27, 3), {F1, MR3}}, + {"ldf8.c.nc", M, OpMXX6aHint (6, 0, 0, 0x25, 0), {F1, MR3}}, + {"ldf8.c.nc.nt1", M, OpMXX6aHint (6, 0, 0, 0x25, 1), {F1, MR3}}, + {"ldf8.c.nc.nta", M, OpMXX6aHint (6, 0, 0, 0x25, 3), {F1, MR3}}, + {"ldfe.c.nc", M, OpMXX6aHint (6, 0, 0, 0x24, 0), {F1, MR3}}, + {"ldfe.c.nc.nt1", M, OpMXX6aHint (6, 0, 0, 0x24, 1), {F1, MR3}}, + {"ldfe.c.nc.nta", M, OpMXX6aHint (6, 0, 0, 0x24, 3), {F1, MR3}}, + + /* floating-point load w/increment by register */ +#define FLDINCREG(c,h) M, OpMXX6aHint (6, 1, 0, c, h), {F1, MR3, R2}, POSTINC + {"ldfs", FLDINCREG (0x02, 0)}, + {"ldfs.nt1", FLDINCREG (0x02, 1)}, + {"ldfs.nta", FLDINCREG (0x02, 3)}, + {"ldfd", FLDINCREG (0x03, 0)}, + {"ldfd.nt1", FLDINCREG (0x03, 1)}, + {"ldfd.nta", FLDINCREG (0x03, 3)}, + {"ldf8", FLDINCREG (0x01, 0)}, + {"ldf8.nt1", FLDINCREG (0x01, 1)}, + {"ldf8.nta", FLDINCREG (0x01, 3)}, + {"ldfe", FLDINCREG (0x00, 0)}, + {"ldfe.nt1", FLDINCREG (0x00, 1)}, + {"ldfe.nta", FLDINCREG (0x00, 3)}, + {"ldfs.s", FLDINCREG (0x06, 0)}, + {"ldfs.s.nt1", FLDINCREG (0x06, 1)}, + {"ldfs.s.nta", FLDINCREG (0x06, 3)}, + {"ldfd.s", FLDINCREG (0x07, 0)}, + {"ldfd.s.nt1", FLDINCREG (0x07, 1)}, + {"ldfd.s.nta", FLDINCREG (0x07, 3)}, + {"ldf8.s", FLDINCREG (0x05, 0)}, + {"ldf8.s.nt1", FLDINCREG (0x05, 1)}, + {"ldf8.s.nta", FLDINCREG (0x05, 3)}, + {"ldfe.s", FLDINCREG (0x04, 0)}, + {"ldfe.s.nt1", FLDINCREG (0x04, 1)}, + {"ldfe.s.nta", FLDINCREG (0x04, 3)}, + {"ldfs.a", FLDINCREG (0x0a, 0)}, + {"ldfs.a.nt1", FLDINCREG (0x0a, 1)}, + {"ldfs.a.nta", FLDINCREG (0x0a, 3)}, + {"ldfd.a", FLDINCREG (0x0b, 0)}, + {"ldfd.a.nt1", FLDINCREG (0x0b, 1)}, + {"ldfd.a.nta", FLDINCREG (0x0b, 3)}, + {"ldf8.a", FLDINCREG (0x09, 0)}, + {"ldf8.a.nt1", FLDINCREG (0x09, 1)}, + {"ldf8.a.nta", FLDINCREG (0x09, 3)}, + {"ldfe.a", FLDINCREG (0x08, 0)}, + {"ldfe.a.nt1", FLDINCREG (0x08, 1)}, + {"ldfe.a.nta", FLDINCREG (0x08, 3)}, + {"ldfs.sa", FLDINCREG (0x0e, 0)}, + {"ldfs.sa.nt1", FLDINCREG (0x0e, 1)}, + {"ldfs.sa.nta", FLDINCREG (0x0e, 3)}, + {"ldfd.sa", FLDINCREG (0x0f, 0)}, + {"ldfd.sa.nt1", FLDINCREG (0x0f, 1)}, + {"ldfd.sa.nta", FLDINCREG (0x0f, 3)}, + {"ldf8.sa", FLDINCREG (0x0d, 0)}, + {"ldf8.sa.nt1", FLDINCREG (0x0d, 1)}, + {"ldf8.sa.nta", FLDINCREG (0x0d, 3)}, + {"ldfe.sa", FLDINCREG (0x0c, 0)}, + {"ldfe.sa.nt1", FLDINCREG (0x0c, 1)}, + {"ldfe.sa.nta", FLDINCREG (0x0c, 3)}, + {"ldf.fill", FLDINCREG (0x1b, 0)}, + {"ldf.fill.nt1", FLDINCREG (0x1b, 1)}, + {"ldf.fill.nta", FLDINCREG (0x1b, 3)}, + {"ldfs.c.clr", FLDINCREG (0x22, 0)}, + {"ldfs.c.clr.nt1", FLDINCREG (0x22, 1)}, + {"ldfs.c.clr.nta", FLDINCREG (0x22, 3)}, + {"ldfd.c.clr", FLDINCREG (0x23, 0)}, + {"ldfd.c.clr.nt1", FLDINCREG (0x23, 1)}, + {"ldfd.c.clr.nta", FLDINCREG (0x23, 3)}, + {"ldf8.c.clr", FLDINCREG (0x21, 0)}, + {"ldf8.c.clr.nt1", FLDINCREG (0x21, 1)}, + {"ldf8.c.clr.nta", FLDINCREG (0x21, 3)}, + {"ldfe.c.clr", FLDINCREG (0x20, 0)}, + {"ldfe.c.clr.nt1", FLDINCREG (0x20, 1)}, + {"ldfe.c.clr.nta", FLDINCREG (0x20, 3)}, + {"ldfs.c.nc", FLDINCREG (0x26, 0)}, + {"ldfs.c.nc.nt1", FLDINCREG (0x26, 1)}, + {"ldfs.c.nc.nta", FLDINCREG (0x26, 3)}, + {"ldfd.c.nc", FLDINCREG (0x27, 0)}, + {"ldfd.c.nc.nt1", FLDINCREG (0x27, 1)}, + {"ldfd.c.nc.nta", FLDINCREG (0x27, 3)}, + {"ldf8.c.nc", FLDINCREG (0x25, 0)}, + {"ldf8.c.nc.nt1", FLDINCREG (0x25, 1)}, + {"ldf8.c.nc.nta", FLDINCREG (0x25, 3)}, + {"ldfe.c.nc", FLDINCREG (0x24, 0)}, + {"ldfe.c.nc.nt1", FLDINCREG (0x24, 1)}, + {"ldfe.c.nc.nta", FLDINCREG (0x24, 3)}, +#undef FLDINCREG + + /* floating-point store */ + {"stfs", M, OpMXX6aHint (6, 0, 0, 0x32, 0), {MR3, F2}}, + {"stfs.nta", M, OpMXX6aHint (6, 0, 0, 0x32, 3), {MR3, F2}}, + {"stfd", M, OpMXX6aHint (6, 0, 0, 0x33, 0), {MR3, F2}}, + {"stfd.nta", M, OpMXX6aHint (6, 0, 0, 0x33, 3), {MR3, F2}}, + {"stf8", M, OpMXX6aHint (6, 0, 0, 0x31, 0), {MR3, F2}}, + {"stf8.nta", M, OpMXX6aHint (6, 0, 0, 0x31, 3), {MR3, F2}}, + {"stfe", M, OpMXX6aHint (6, 0, 0, 0x30, 0), {MR3, F2}}, + {"stfe.nta", M, OpMXX6aHint (6, 0, 0, 0x30, 3), {MR3, F2}}, + {"stf.spill", M, OpMXX6aHint (6, 0, 0, 0x3b, 0), {MR3, F2}}, + {"stf.spill.nta", M, OpMXX6aHint (6, 0, 0, 0x3b, 3), {MR3, F2}}, + + /* floating-point load pair */ + {"ldfps", M2, OpMXX6aHint (6, 0, 1, 0x02, 0), {F1, F2, MR3}}, + {"ldfps.nt1", M2, OpMXX6aHint (6, 0, 1, 0x02, 1), {F1, F2, MR3}}, + {"ldfps.nta", M2, OpMXX6aHint (6, 0, 1, 0x02, 3), {F1, F2, MR3}}, + {"ldfpd", M2, OpMXX6aHint (6, 0, 1, 0x03, 0), {F1, F2, MR3}}, + {"ldfpd.nt1", M2, OpMXX6aHint (6, 0, 1, 0x03, 1), {F1, F2, MR3}}, + {"ldfpd.nta", M2, OpMXX6aHint (6, 0, 1, 0x03, 3), {F1, F2, MR3}}, + {"ldfp8", M2, OpMXX6aHint (6, 0, 1, 0x01, 0), {F1, F2, MR3}}, + {"ldfp8.nt1", M2, OpMXX6aHint (6, 0, 1, 0x01, 1), {F1, F2, MR3}}, + {"ldfp8.nta", M2, OpMXX6aHint (6, 0, 1, 0x01, 3), {F1, F2, MR3}}, + {"ldfps.s", M2, OpMXX6aHint (6, 0, 1, 0x06, 0), {F1, F2, MR3}}, + {"ldfps.s.nt1", M2, OpMXX6aHint (6, 0, 1, 0x06, 1), {F1, F2, MR3}}, + {"ldfps.s.nta", M2, OpMXX6aHint (6, 0, 1, 0x06, 3), {F1, F2, MR3}}, + {"ldfpd.s", M2, OpMXX6aHint (6, 0, 1, 0x07, 0), {F1, F2, MR3}}, + {"ldfpd.s.nt1", M2, OpMXX6aHint (6, 0, 1, 0x07, 1), {F1, F2, MR3}}, + {"ldfpd.s.nta", M2, OpMXX6aHint (6, 0, 1, 0x07, 3), {F1, F2, MR3}}, + {"ldfp8.s", M2, OpMXX6aHint (6, 0, 1, 0x05, 0), {F1, F2, MR3}}, + {"ldfp8.s.nt1", M2, OpMXX6aHint (6, 0, 1, 0x05, 1), {F1, F2, MR3}}, + {"ldfp8.s.nta", M2, OpMXX6aHint (6, 0, 1, 0x05, 3), {F1, F2, MR3}}, + {"ldfps.a", M2, OpMXX6aHint (6, 0, 1, 0x0a, 0), {F1, F2, MR3}}, + {"ldfps.a.nt1", M2, OpMXX6aHint (6, 0, 1, 0x0a, 1), {F1, F2, MR3}}, + {"ldfps.a.nta", M2, OpMXX6aHint (6, 0, 1, 0x0a, 3), {F1, F2, MR3}}, + {"ldfpd.a", M2, OpMXX6aHint (6, 0, 1, 0x0b, 0), {F1, F2, MR3}}, + {"ldfpd.a.nt1", M2, OpMXX6aHint (6, 0, 1, 0x0b, 1), {F1, F2, MR3}}, + {"ldfpd.a.nta", M2, OpMXX6aHint (6, 0, 1, 0x0b, 3), {F1, F2, MR3}}, + {"ldfp8.a", M2, OpMXX6aHint (6, 0, 1, 0x09, 0), {F1, F2, MR3}}, + {"ldfp8.a.nt1", M2, OpMXX6aHint (6, 0, 1, 0x09, 1), {F1, F2, MR3}}, + {"ldfp8.a.nta", M2, OpMXX6aHint (6, 0, 1, 0x09, 3), {F1, F2, MR3}}, + {"ldfps.sa", M2, OpMXX6aHint (6, 0, 1, 0x0e, 0), {F1, F2, MR3}}, + {"ldfps.sa.nt1", M2, OpMXX6aHint (6, 0, 1, 0x0e, 1), {F1, F2, MR3}}, + {"ldfps.sa.nta", M2, OpMXX6aHint (6, 0, 1, 0x0e, 3), {F1, F2, MR3}}, + {"ldfpd.sa", M2, OpMXX6aHint (6, 0, 1, 0x0f, 0), {F1, F2, MR3}}, + {"ldfpd.sa.nt1", M2, OpMXX6aHint (6, 0, 1, 0x0f, 1), {F1, F2, MR3}}, + {"ldfpd.sa.nta", M2, OpMXX6aHint (6, 0, 1, 0x0f, 3), {F1, F2, MR3}}, + {"ldfp8.sa", M2, OpMXX6aHint (6, 0, 1, 0x0d, 0), {F1, F2, MR3}}, + {"ldfp8.sa.nt1", M2, OpMXX6aHint (6, 0, 1, 0x0d, 1), {F1, F2, MR3}}, + {"ldfp8.sa.nta", M2, OpMXX6aHint (6, 0, 1, 0x0d, 3), {F1, F2, MR3}}, + {"ldfps.c.clr", M2, OpMXX6aHint (6, 0, 1, 0x22, 0), {F1, F2, MR3}}, + {"ldfps.c.clr.nt1", M2, OpMXX6aHint (6, 0, 1, 0x22, 1), {F1, F2, MR3}}, + {"ldfps.c.clr.nta", M2, OpMXX6aHint (6, 0, 1, 0x22, 3), {F1, F2, MR3}}, + {"ldfpd.c.clr", M2, OpMXX6aHint (6, 0, 1, 0x23, 0), {F1, F2, MR3}}, + {"ldfpd.c.clr.nt1", M2, OpMXX6aHint (6, 0, 1, 0x23, 1), {F1, F2, MR3}}, + {"ldfpd.c.clr.nta", M2, OpMXX6aHint (6, 0, 1, 0x23, 3), {F1, F2, MR3}}, + {"ldfp8.c.clr", M2, OpMXX6aHint (6, 0, 1, 0x21, 0), {F1, F2, MR3}}, + {"ldfp8.c.clr.nt1", M2, OpMXX6aHint (6, 0, 1, 0x21, 1), {F1, F2, MR3}}, + {"ldfp8.c.clr.nta", M2, OpMXX6aHint (6, 0, 1, 0x21, 3), {F1, F2, MR3}}, + {"ldfps.c.nc", M2, OpMXX6aHint (6, 0, 1, 0x26, 0), {F1, F2, MR3}}, + {"ldfps.c.nc.nt1", M2, OpMXX6aHint (6, 0, 1, 0x26, 1), {F1, F2, MR3}}, + {"ldfps.c.nc.nta", M2, OpMXX6aHint (6, 0, 1, 0x26, 3), {F1, F2, MR3}}, + {"ldfpd.c.nc", M2, OpMXX6aHint (6, 0, 1, 0x27, 0), {F1, F2, MR3}}, + {"ldfpd.c.nc.nt1", M2, OpMXX6aHint (6, 0, 1, 0x27, 1), {F1, F2, MR3}}, + {"ldfpd.c.nc.nta", M2, OpMXX6aHint (6, 0, 1, 0x27, 3), {F1, F2, MR3}}, + {"ldfp8.c.nc", M2, OpMXX6aHint (6, 0, 1, 0x25, 0), {F1, F2, MR3}}, + {"ldfp8.c.nc.nt1", M2, OpMXX6aHint (6, 0, 1, 0x25, 1), {F1, F2, MR3}}, + {"ldfp8.c.nc.nta", M2, OpMXX6aHint (6, 0, 1, 0x25, 3), {F1, F2, MR3}}, + + /* floating-point load pair w/increment by immediate */ +#define LD(a,b,c) M2, OpMXX6aHint (6, 1, 1, a, b), {F1, F2, MR3, c}, POSTINC + {"ldfps", LD (0x02, 0, C8)}, + {"ldfps.nt1", LD (0x02, 1, C8)}, + {"ldfps.nta", LD (0x02, 3, C8)}, + {"ldfpd", LD (0x03, 0, C16)}, + {"ldfpd.nt1", LD (0x03, 1, C16)}, + {"ldfpd.nta", LD (0x03, 3, C16)}, + {"ldfp8", LD (0x01, 0, C16)}, + {"ldfp8.nt1", LD (0x01, 1, C16)}, + {"ldfp8.nta", LD (0x01, 3, C16)}, + {"ldfps.s", LD (0x06, 0, C8)}, + {"ldfps.s.nt1", LD (0x06, 1, C8)}, + {"ldfps.s.nta", LD (0x06, 3, C8)}, + {"ldfpd.s", LD (0x07, 0, C16)}, + {"ldfpd.s.nt1", LD (0x07, 1, C16)}, + {"ldfpd.s.nta", LD (0x07, 3, C16)}, + {"ldfp8.s", LD (0x05, 0, C16)}, + {"ldfp8.s.nt1", LD (0x05, 1, C16)}, + {"ldfp8.s.nta", LD (0x05, 3, C16)}, + {"ldfps.a", LD (0x0a, 0, C8)}, + {"ldfps.a.nt1", LD (0x0a, 1, C8)}, + {"ldfps.a.nta", LD (0x0a, 3, C8)}, + {"ldfpd.a", LD (0x0b, 0, C16)}, + {"ldfpd.a.nt1", LD (0x0b, 1, C16)}, + {"ldfpd.a.nta", LD (0x0b, 3, C16)}, + {"ldfp8.a", LD (0x09, 0, C16)}, + {"ldfp8.a.nt1", LD (0x09, 1, C16)}, + {"ldfp8.a.nta", LD (0x09, 3, C16)}, + {"ldfps.sa", LD (0x0e, 0, C8)}, + {"ldfps.sa.nt1", LD (0x0e, 1, C8)}, + {"ldfps.sa.nta", LD (0x0e, 3, C8)}, + {"ldfpd.sa", LD (0x0f, 0, C16)}, + {"ldfpd.sa.nt1", LD (0x0f, 1, C16)}, + {"ldfpd.sa.nta", LD (0x0f, 3, C16)}, + {"ldfp8.sa", LD (0x0d, 0, C16)}, + {"ldfp8.sa.nt1", LD (0x0d, 1, C16)}, + {"ldfp8.sa.nta", LD (0x0d, 3, C16)}, + {"ldfps.c.clr", LD (0x22, 0, C8)}, + {"ldfps.c.clr.nt1", LD (0x22, 1, C8)}, + {"ldfps.c.clr.nta", LD (0x22, 3, C8)}, + {"ldfpd.c.clr", LD (0x23, 0, C16)}, + {"ldfpd.c.clr.nt1", LD (0x23, 1, C16)}, + {"ldfpd.c.clr.nta", LD (0x23, 3, C16)}, + {"ldfp8.c.clr", LD (0x21, 0, C16)}, + {"ldfp8.c.clr.nt1", LD (0x21, 1, C16)}, + {"ldfp8.c.clr.nta", LD (0x21, 3, C16)}, + {"ldfps.c.nc", LD (0x26, 0, C8)}, + {"ldfps.c.nc.nt1", LD (0x26, 1, C8)}, + {"ldfps.c.nc.nta", LD (0x26, 3, C8)}, + {"ldfpd.c.nc", LD (0x27, 0, C16)}, + {"ldfpd.c.nc.nt1", LD (0x27, 1, C16)}, + {"ldfpd.c.nc.nta", LD (0x27, 3, C16)}, + {"ldfp8.c.nc", LD (0x25, 0, C16)}, + {"ldfp8.c.nc.nt1", LD (0x25, 1, C16)}, + {"ldfp8.c.nc.nta", LD (0x25, 3, C16)}, +#undef LD + + /* line prefetch */ + {"lfetch", M0, OpMXX6aHint (6, 0, 0, 0x2c, 0), {MR3}}, + {"lfetch.nt1", M0, OpMXX6aHint (6, 0, 0, 0x2c, 1), {MR3}}, + {"lfetch.nt2", M0, OpMXX6aHint (6, 0, 0, 0x2c, 2), {MR3}}, + {"lfetch.nta", M0, OpMXX6aHint (6, 0, 0, 0x2c, 3), {MR3}}, + {"lfetch.excl", M0, OpMXX6aHint (6, 0, 0, 0x2d, 0), {MR3}}, + {"lfetch.excl.nt1", M0, OpMXX6aHint (6, 0, 0, 0x2d, 1), {MR3}}, + {"lfetch.excl.nt2", M0, OpMXX6aHint (6, 0, 0, 0x2d, 2), {MR3}}, + {"lfetch.excl.nta", M0, OpMXX6aHint (6, 0, 0, 0x2d, 3), {MR3}}, + {"lfetch.fault", M0, OpMXX6aHint (6, 0, 0, 0x2e, 0), {MR3}}, + {"lfetch.fault.nt1", M0, OpMXX6aHint (6, 0, 0, 0x2e, 1), {MR3}}, + {"lfetch.fault.nt2", M0, OpMXX6aHint (6, 0, 0, 0x2e, 2), {MR3}}, + {"lfetch.fault.nta", M0, OpMXX6aHint (6, 0, 0, 0x2e, 3), {MR3}}, + {"lfetch.fault.excl", M0, OpMXX6aHint (6, 0, 0, 0x2f, 0), {MR3}}, + {"lfetch.fault.excl.nt1", M0, OpMXX6aHint (6, 0, 0, 0x2f, 1), {MR3}}, + {"lfetch.fault.excl.nt2", M0, OpMXX6aHint (6, 0, 0, 0x2f, 2), {MR3}}, + {"lfetch.fault.excl.nta", M0, OpMXX6aHint (6, 0, 0, 0x2f, 3), {MR3}}, + + /* line prefetch w/increment by register */ +#define LFETCHINCREG(c,h) M0, OpMXX6aHint (6, 1, 0, c, h), {MR3, R2}, POSTINC + {"lfetch", LFETCHINCREG (0x2c, 0)}, + {"lfetch.nt1", LFETCHINCREG (0x2c, 1)}, + {"lfetch.nt2", LFETCHINCREG (0x2c, 2)}, + {"lfetch.nta", LFETCHINCREG (0x2c, 3)}, + {"lfetch.excl", LFETCHINCREG (0x2d, 0)}, + {"lfetch.excl.nt1", LFETCHINCREG (0x2d, 1)}, + {"lfetch.excl.nt2", LFETCHINCREG (0x2d, 2)}, + {"lfetch.excl.nta", LFETCHINCREG (0x2d, 3)}, + {"lfetch.fault", LFETCHINCREG (0x2e, 0)}, + {"lfetch.fault.nt1", LFETCHINCREG (0x2e, 1)}, + {"lfetch.fault.nt2", LFETCHINCREG (0x2e, 2)}, + {"lfetch.fault.nta", LFETCHINCREG (0x2e, 3)}, + {"lfetch.fault.excl", LFETCHINCREG (0x2f, 0)}, + {"lfetch.fault.excl.nt1", LFETCHINCREG (0x2f, 1)}, + {"lfetch.fault.excl.nt2", LFETCHINCREG (0x2f, 2)}, + {"lfetch.fault.excl.nta", LFETCHINCREG (0x2f, 3)}, +#undef LFETCHINCREG + + /* semaphore operations */ + {"setf.sig", M, OpMXX6a (6, 0, 1, 0x1c), {F1, R2}}, + {"setf.exp", M, OpMXX6a (6, 0, 1, 0x1d), {F1, R2}}, + {"setf.s", M, OpMXX6a (6, 0, 1, 0x1e), {F1, R2}}, + {"setf.d", M, OpMXX6a (6, 0, 1, 0x1f), {F1, R2}}, + + /* floating-point load w/increment by immediate */ +#define FLDINCIMMED(c,h) M, OpX6aHint (7, c, h), {F1, MR3, IMM9b}, POSTINC + {"ldfs", FLDINCIMMED (0x02, 0)}, + {"ldfs.nt1", FLDINCIMMED (0x02, 1)}, + {"ldfs.nta", FLDINCIMMED (0x02, 3)}, + {"ldfd", FLDINCIMMED (0x03, 0)}, + {"ldfd.nt1", FLDINCIMMED (0x03, 1)}, + {"ldfd.nta", FLDINCIMMED (0x03, 3)}, + {"ldf8", FLDINCIMMED (0x01, 0)}, + {"ldf8.nt1", FLDINCIMMED (0x01, 1)}, + {"ldf8.nta", FLDINCIMMED (0x01, 3)}, + {"ldfe", FLDINCIMMED (0x00, 0)}, + {"ldfe.nt1", FLDINCIMMED (0x00, 1)}, + {"ldfe.nta", FLDINCIMMED (0x00, 3)}, + {"ldfs.s", FLDINCIMMED (0x06, 0)}, + {"ldfs.s.nt1", FLDINCIMMED (0x06, 1)}, + {"ldfs.s.nta", FLDINCIMMED (0x06, 3)}, + {"ldfd.s", FLDINCIMMED (0x07, 0)}, + {"ldfd.s.nt1", FLDINCIMMED (0x07, 1)}, + {"ldfd.s.nta", FLDINCIMMED (0x07, 3)}, + {"ldf8.s", FLDINCIMMED (0x05, 0)}, + {"ldf8.s.nt1", FLDINCIMMED (0x05, 1)}, + {"ldf8.s.nta", FLDINCIMMED (0x05, 3)}, + {"ldfe.s", FLDINCIMMED (0x04, 0)}, + {"ldfe.s.nt1", FLDINCIMMED (0x04, 1)}, + {"ldfe.s.nta", FLDINCIMMED (0x04, 3)}, + {"ldfs.a", FLDINCIMMED (0x0a, 0)}, + {"ldfs.a.nt1", FLDINCIMMED (0x0a, 1)}, + {"ldfs.a.nta", FLDINCIMMED (0x0a, 3)}, + {"ldfd.a", FLDINCIMMED (0x0b, 0)}, + {"ldfd.a.nt1", FLDINCIMMED (0x0b, 1)}, + {"ldfd.a.nta", FLDINCIMMED (0x0b, 3)}, + {"ldf8.a", FLDINCIMMED (0x09, 0)}, + {"ldf8.a.nt1", FLDINCIMMED (0x09, 1)}, + {"ldf8.a.nta", FLDINCIMMED (0x09, 3)}, + {"ldfe.a", FLDINCIMMED (0x08, 0)}, + {"ldfe.a.nt1", FLDINCIMMED (0x08, 1)}, + {"ldfe.a.nta", FLDINCIMMED (0x08, 3)}, + {"ldfs.sa", FLDINCIMMED (0x0e, 0)}, + {"ldfs.sa.nt1", FLDINCIMMED (0x0e, 1)}, + {"ldfs.sa.nta", FLDINCIMMED (0x0e, 3)}, + {"ldfd.sa", FLDINCIMMED (0x0f, 0)}, + {"ldfd.sa.nt1", FLDINCIMMED (0x0f, 1)}, + {"ldfd.sa.nta", FLDINCIMMED (0x0f, 3)}, + {"ldf8.sa", FLDINCIMMED (0x0d, 0)}, + {"ldf8.sa.nt1", FLDINCIMMED (0x0d, 1)}, + {"ldf8.sa.nta", FLDINCIMMED (0x0d, 3)}, + {"ldfe.sa", FLDINCIMMED (0x0c, 0)}, + {"ldfe.sa.nt1", FLDINCIMMED (0x0c, 1)}, + {"ldfe.sa.nta", FLDINCIMMED (0x0c, 3)}, + {"ldf.fill", FLDINCIMMED (0x1b, 0)}, + {"ldf.fill.nt1", FLDINCIMMED (0x1b, 1)}, + {"ldf.fill.nta", FLDINCIMMED (0x1b, 3)}, + {"ldfs.c.clr", FLDINCIMMED (0x22, 0)}, + {"ldfs.c.clr.nt1", FLDINCIMMED (0x22, 1)}, + {"ldfs.c.clr.nta", FLDINCIMMED (0x22, 3)}, + {"ldfd.c.clr", FLDINCIMMED (0x23, 0)}, + {"ldfd.c.clr.nt1", FLDINCIMMED (0x23, 1)}, + {"ldfd.c.clr.nta", FLDINCIMMED (0x23, 3)}, + {"ldf8.c.clr", FLDINCIMMED (0x21, 0)}, + {"ldf8.c.clr.nt1", FLDINCIMMED (0x21, 1)}, + {"ldf8.c.clr.nta", FLDINCIMMED (0x21, 3)}, + {"ldfe.c.clr", FLDINCIMMED (0x20, 0)}, + {"ldfe.c.clr.nt1", FLDINCIMMED (0x20, 1)}, + {"ldfe.c.clr.nta", FLDINCIMMED (0x20, 3)}, + {"ldfs.c.nc", FLDINCIMMED (0x26, 0)}, + {"ldfs.c.nc.nt1", FLDINCIMMED (0x26, 1)}, + {"ldfs.c.nc.nta", FLDINCIMMED (0x26, 3)}, + {"ldfd.c.nc", FLDINCIMMED (0x27, 0)}, + {"ldfd.c.nc.nt1", FLDINCIMMED (0x27, 1)}, + {"ldfd.c.nc.nta", FLDINCIMMED (0x27, 3)}, + {"ldf8.c.nc", FLDINCIMMED (0x25, 0)}, + {"ldf8.c.nc.nt1", FLDINCIMMED (0x25, 1)}, + {"ldf8.c.nc.nta", FLDINCIMMED (0x25, 3)}, + {"ldfe.c.nc", FLDINCIMMED (0x24, 0)}, + {"ldfe.c.nc.nt1", FLDINCIMMED (0x24, 1)}, + {"ldfe.c.nc.nta", FLDINCIMMED (0x24, 3)}, +#undef FLDINCIMMED + + /* floating-point store w/increment by immediate */ +#define FSTINCIMMED(c,h) M, OpX6aHint (7, c, h), {MR3, F2, IMM9a}, POSTINC + {"stfs", FSTINCIMMED (0x32, 0)}, + {"stfs.nta", FSTINCIMMED (0x32, 3)}, + {"stfd", FSTINCIMMED (0x33, 0)}, + {"stfd.nta", FSTINCIMMED (0x33, 3)}, + {"stf8", FSTINCIMMED (0x31, 0)}, + {"stf8.nta", FSTINCIMMED (0x31, 3)}, + {"stfe", FSTINCIMMED (0x30, 0)}, + {"stfe.nta", FSTINCIMMED (0x30, 3)}, + {"stf.spill", FSTINCIMMED (0x3b, 0)}, + {"stf.spill.nta", FSTINCIMMED (0x3b, 3)}, +#undef FSTINCIMMED + + /* line prefetch w/increment by immediate */ +#define LFETCHINCIMMED(c,h) M0, OpX6aHint (7, c, h), {MR3, IMM9b}, POSTINC + {"lfetch", LFETCHINCIMMED (0x2c, 0)}, + {"lfetch.nt1", LFETCHINCIMMED (0x2c, 1)}, + {"lfetch.nt2", LFETCHINCIMMED (0x2c, 2)}, + {"lfetch.nta", LFETCHINCIMMED (0x2c, 3)}, + {"lfetch.excl", LFETCHINCIMMED (0x2d, 0)}, + {"lfetch.excl.nt1", LFETCHINCIMMED (0x2d, 1)}, + {"lfetch.excl.nt2", LFETCHINCIMMED (0x2d, 2)}, + {"lfetch.excl.nta", LFETCHINCIMMED (0x2d, 3)}, + {"lfetch.fault", LFETCHINCIMMED (0x2e, 0)}, + {"lfetch.fault.nt1", LFETCHINCIMMED (0x2e, 1)}, + {"lfetch.fault.nt2", LFETCHINCIMMED (0x2e, 2)}, + {"lfetch.fault.nta", LFETCHINCIMMED (0x2e, 3)}, + {"lfetch.fault.excl", LFETCHINCIMMED (0x2f, 0)}, + {"lfetch.fault.excl.nt1", LFETCHINCIMMED (0x2f, 1)}, + {"lfetch.fault.excl.nt2", LFETCHINCIMMED (0x2f, 2)}, + {"lfetch.fault.excl.nta", LFETCHINCIMMED (0x2f, 3)}, +#undef LFETCHINCIMMED + + {0} + }; + +#undef M0 +#undef M +#undef M2 +#undef bM +#undef bX +#undef bX2 +#undef bX3 +#undef bX4 +#undef bX6a +#undef bX6b +#undef bHint +#undef mM +#undef mX +#undef mX2 +#undef mX3 +#undef mX4 +#undef mX6a +#undef mX6b +#undef mHint +#undef OpX3 +#undef OpX3X6b +#undef OpX3X4 +#undef OpX3X4X2 +#undef OpX6aHint +#undef OpXX6aHint +#undef OpMXX6a +#undef OpMXX6aHint diff --git a/contrib/binutils/opcodes/ia64-opc-x.c b/contrib/binutils/opcodes/ia64-opc-x.c new file mode 100644 index 0000000..5f382fd --- /dev/null +++ b/contrib/binutils/opcodes/ia64-opc-x.c @@ -0,0 +1,178 @@ +/* ia64-opc-x.c -- IA-64 `X' opcode table. + Copyright 1998, 1999, 2000 Free Software Foundation, Inc. + Contributed by Timothy Wall <twall@cygnus.com> + + This file is part of GDB, GAS, and the GNU binutils. + + GDB, GAS, and the GNU binutils are free software; you can redistribute + them and/or modify them under the terms of the GNU General Public + License as published by the Free Software Foundation; either version + 2, or (at your option) any later version. + + GDB, GAS, and the GNU binutils are distributed in the hope that they + will be useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this file; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#include "ia64-opc.h" + +/* identify the specific X-unit type */ +#define X0 IA64_TYPE_X, 0 +#define X IA64_TYPE_X, 1 + +/* instruction bit fields: */ +#define bBtype(x) (((ia64_insn) ((x) & 0x7)) << 6) +#define bD(x) (((ia64_insn) ((x) & 0x1)) << 35) +#define bPa(x) (((ia64_insn) ((x) & 0x1)) << 12) +#define bPr(x) (((ia64_insn) ((x) & 0x3f)) << 0) +#define bVc(x) (((ia64_insn) ((x) & 0x1)) << 20) +#define bWha(x) (((ia64_insn) ((x) & 0x3)) << 33) +#define bX3(x) (((ia64_insn) ((x) & 0x7)) << 33) +#define bX6(x) (((ia64_insn) ((x) & 0x3f)) << 27) + +#define mBtype bBtype (-1) +#define mD bD (-1) +#define mPa bPa (-1) +#define mPr bPr (-1) +#define mVc bVc (-1) +#define mWha bWha (-1) +#define mX3 bX3 (-1) +#define mX6 bX6 (-1) + +#define OpX3X6(a,b,c) (bOp (a) | bX3 (b) | bX6(c)), \ + (mOp | mX3 | mX6) +#define OpVc(a,b) (bOp (a) | bVc (b)), (mOp | mVc) +#define OpPaWhaD(a,b,c,d) \ + (bOp (a) | bPa (b) | bWha (c) | bD (d)), (mOp | mPa | mWha | mD) +#define OpBtypePaWhaD(a,b,c,d,e) \ + (bOp (a) | bBtype (b) | bPa (c) | bWha (d) | bD (e)), \ + (mOp | mBtype | mPa | mWha | mD) +#define OpBtypePaWhaDPr(a,b,c,d,e,f) \ + (bOp (a) | bBtype (b) | bPa (c) | bWha (d) | bD (e) | bPr (f)), \ + (mOp | mBtype | mPa | mWha | mD | mPr) + +struct ia64_opcode ia64_opcodes_x[] = + { + {"break.x", X0, OpX3X6 (0, 0, 0x00), {IMMU62}}, + {"nop.x", X0, OpX3X6 (0, 0, 0x01), {IMMU62}}, + {"movl", X, OpVc (6, 0), {R1, IMMU64}}, +#define BRL(a,b) \ + X0, OpBtypePaWhaDPr (0xC, 0, a, 0, b, 0), {TGT64}, 0 + {"brl.few", BRL (0, 0) | PSEUDO}, + {"brl", BRL (0, 0) | PSEUDO}, + {"brl.few.clr", BRL (0, 1) | PSEUDO}, + {"brl.clr", BRL (0, 1) | PSEUDO}, + {"brl.many", BRL (1, 0) | PSEUDO}, + {"brl.many.clr", BRL (1, 1) | PSEUDO}, +#undef BRL +#define BRL(a,b,c) \ + X0, OpBtypePaWhaD (0xC, 0, a, b, c), {TGT64}, 0 + {"brl.cond.sptk.few", BRL (0, 0, 0)}, + {"brl.cond.sptk", BRL (0, 0, 0) | PSEUDO}, + {"brl.cond.sptk.few.clr", BRL (0, 0, 1)}, + {"brl.cond.sptk.clr", BRL (0, 0, 1) | PSEUDO}, + {"brl.cond.spnt.few", BRL (0, 1, 0)}, + {"brl.cond.spnt", BRL (0, 1, 0) | PSEUDO}, + {"brl.cond.spnt.few.clr", BRL (0, 1, 1)}, + {"brl.cond.spnt.clr", BRL (0, 1, 1) | PSEUDO}, + {"brl.cond.dptk.few", BRL (0, 2, 0)}, + {"brl.cond.dptk", BRL (0, 2, 0) | PSEUDO}, + {"brl.cond.dptk.few.clr", BRL (0, 2, 1)}, + {"brl.cond.dptk.clr", BRL (0, 2, 1) | PSEUDO}, + {"brl.cond.dpnt.few", BRL (0, 3, 0)}, + {"brl.cond.dpnt", BRL (0, 3, 0) | PSEUDO}, + {"brl.cond.dpnt.few.clr", BRL (0, 3, 1)}, + {"brl.cond.dpnt.clr", BRL (0, 3, 1) | PSEUDO}, + {"brl.cond.sptk.many", BRL (1, 0, 0)}, + {"brl.cond.sptk.many.clr", BRL (1, 0, 1)}, + {"brl.cond.spnt.many", BRL (1, 1, 0)}, + {"brl.cond.spnt.many.clr", BRL (1, 1, 1)}, + {"brl.cond.dptk.many", BRL (1, 2, 0)}, + {"brl.cond.dptk.many.clr", BRL (1, 2, 1)}, + {"brl.cond.dpnt.many", BRL (1, 3, 0)}, + {"brl.cond.dpnt.many.clr", BRL (1, 3, 1)}, + {"brl.sptk.few", BRL (0, 0, 0)}, + {"brl.sptk", BRL (0, 0, 0) | PSEUDO}, + {"brl.sptk.few.clr", BRL (0, 0, 1)}, + {"brl.sptk.clr", BRL (0, 0, 1) | PSEUDO}, + {"brl.spnt.few", BRL (0, 1, 0)}, + {"brl.spnt", BRL (0, 1, 0) | PSEUDO}, + {"brl.spnt.few.clr", BRL (0, 1, 1)}, + {"brl.spnt.clr", BRL (0, 1, 1) | PSEUDO}, + {"brl.dptk.few", BRL (0, 2, 0)}, + {"brl.dptk", BRL (0, 2, 0) | PSEUDO}, + {"brl.dptk.few.clr", BRL (0, 2, 1)}, + {"brl.dptk.clr", BRL (0, 2, 1) | PSEUDO}, + {"brl.dpnt.few", BRL (0, 3, 0)}, + {"brl.dpnt", BRL (0, 3, 0) | PSEUDO}, + {"brl.dpnt.few.clr", BRL (0, 3, 1)}, + {"brl.dpnt.clr", BRL (0, 3, 1) | PSEUDO}, + {"brl.sptk.many", BRL (1, 0, 0)}, + {"brl.sptk.many.clr", BRL (1, 0, 1)}, + {"brl.spnt.many", BRL (1, 1, 0)}, + {"brl.spnt.many.clr", BRL (1, 1, 1)}, + {"brl.dptk.many", BRL (1, 2, 0)}, + {"brl.dptk.many.clr", BRL (1, 2, 1)}, + {"brl.dpnt.many", BRL (1, 3, 0)}, + {"brl.dpnt.many.clr", BRL (1, 3, 1)}, +#undef BRL +#define BRL(a,b,c) X, OpPaWhaD (0xD, a, b, c), {B1, TGT64}, 0 + {"brl.call.sptk.few", BRL (0, 0, 0)}, + {"brl.call.sptk", BRL (0, 0, 0) | PSEUDO}, + {"brl.call.sptk.few.clr", BRL (0, 0, 1)}, + {"brl.call.sptk.clr", BRL (0, 0, 1) | PSEUDO}, + {"brl.call.spnt.few", BRL (0, 1, 0)}, + {"brl.call.spnt", BRL (0, 1, 0) | PSEUDO}, + {"brl.call.spnt.few.clr", BRL (0, 1, 1)}, + {"brl.call.spnt.clr", BRL (0, 1, 1) | PSEUDO}, + {"brl.call.dptk.few", BRL (0, 2, 0)}, + {"brl.call.dptk", BRL (0, 2, 0) | PSEUDO}, + {"brl.call.dptk.few.clr", BRL (0, 2, 1)}, + {"brl.call.dptk.clr", BRL (0, 2, 1) | PSEUDO}, + {"brl.call.dpnt.few", BRL (0, 3, 0)}, + {"brl.call.dpnt", BRL (0, 3, 0) | PSEUDO}, + {"brl.call.dpnt.few.clr", BRL (0, 3, 1)}, + {"brl.call.dpnt.clr", BRL (0, 3, 1) | PSEUDO}, + {"brl.call.sptk.many", BRL (1, 0, 0)}, + {"brl.call.sptk.many.clr", BRL (1, 0, 1)}, + {"brl.call.spnt.many", BRL (1, 1, 0)}, + {"brl.call.spnt.many.clr", BRL (1, 1, 1)}, + {"brl.call.dptk.many", BRL (1, 2, 0)}, + {"brl.call.dptk.many.clr", BRL (1, 2, 1)}, + {"brl.call.dpnt.many", BRL (1, 3, 0)}, + {"brl.call.dpnt.many.clr", BRL (1, 3, 1)}, +#undef BRL + {0} + }; + +#undef X0 +#undef X + +#undef bBtype +#undef bD +#undef bPa +#undef bPr +#undef bVc +#undef bWha +#undef bX3 +#undef bX6 + +#undef mBtype +#undef mD +#undef mPa +#undef mPr +#undef mVc +#undef mWha +#undef mX3 +#undef mX6 + +#undef OpX3X6 +#undef OpVc +#undef OpPaWhaD +#undef OpBtypePaWhaD +#undef OpBtypePaWhaDPr diff --git a/contrib/binutils/opcodes/ia64-opc.c b/contrib/binutils/opcodes/ia64-opc.c new file mode 100644 index 0000000..84e3837 --- /dev/null +++ b/contrib/binutils/opcodes/ia64-opc.c @@ -0,0 +1,748 @@ +/* ia64-opc.c -- Functions to access the compacted opcode table + Copyright 1999, 2000 Free Software Foundation, Inc. + Written by Bob Manson of Cygnus Solutions, <manson@cygnus.com> + + This file is part of GDB, GAS, and the GNU binutils. + + GDB, GAS, and the GNU binutils are free software; you can redistribute + them and/or modify them under the terms of the GNU General Public + License as published by the Free Software Foundation; either version + 2, or (at your option) any later version. + + GDB, GAS, and the GNU binutils are distributed in the hope that they + will be useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this file; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#include "ansidecl.h" +#include "libiberty.h" +#include "sysdep.h" +#include "ia64-asmtab.h" +#include "ia64-asmtab.c" + +const struct ia64_templ_desc ia64_templ_desc[16] = + { + { 0, { IA64_UNIT_M, IA64_UNIT_I, IA64_UNIT_I }, "MII" }, /* 0 */ + { 2, { IA64_UNIT_M, IA64_UNIT_I, IA64_UNIT_I }, "MII" }, + { 0, { IA64_UNIT_M, IA64_UNIT_L, IA64_UNIT_X }, "MLX" }, + { 0, { 0, }, "-3-" }, + { 0, { IA64_UNIT_M, IA64_UNIT_M, IA64_UNIT_I }, "MMI" }, /* 4 */ + { 1, { IA64_UNIT_M, IA64_UNIT_M, IA64_UNIT_I }, "MMI" }, + { 0, { IA64_UNIT_M, IA64_UNIT_F, IA64_UNIT_I }, "MFI" }, + { 0, { IA64_UNIT_M, IA64_UNIT_M, IA64_UNIT_F }, "MMF" }, + { 0, { IA64_UNIT_M, IA64_UNIT_I, IA64_UNIT_B }, "MIB" }, /* 8 */ + { 0, { IA64_UNIT_M, IA64_UNIT_B, IA64_UNIT_B }, "MBB" }, + { 0, { 0, }, "-a-" }, + { 0, { IA64_UNIT_B, IA64_UNIT_B, IA64_UNIT_B }, "BBB" }, + { 0, { IA64_UNIT_M, IA64_UNIT_M, IA64_UNIT_B }, "MMB" }, /* c */ + { 0, { 0, }, "-d-" }, + { 0, { IA64_UNIT_M, IA64_UNIT_F, IA64_UNIT_B }, "MFB" }, + { 0, { 0, }, "-f-" }, + }; + + +/* Copy the prefix contained in *PTR (up to a '.' or a NUL) to DEST. + PTR will be adjusted to point to the start of the next portion + of the opcode, or at the NUL character. */ + +static void +get_opc_prefix (ptr, dest) + const char **ptr; + char *dest; +{ + char *c = strchr (*ptr, '.'); + if (c != NULL) + { + memcpy (dest, *ptr, c - *ptr); + dest[c - *ptr] = '\0'; + *ptr = c + 1; + } + else + { + int l = strlen (*ptr); + memcpy (dest, *ptr, l); + dest[l] = '\0'; + *ptr += l; + } +} + +/* Find the index of the entry in the string table corresponding to + STR; return -1 if one does not exist. */ + +static short +find_string_ent (str) + const char *str; +{ + short start = 0; + short end = sizeof (ia64_strings) / sizeof (const char *); + short i = (start + end) / 2; + + if (strcmp (str, ia64_strings[end - 1]) > 0) + { + return -1; + } + while (start <= end) + { + int c = strcmp (str, ia64_strings[i]); + if (c < 0) + { + end = i - 1; + } + else if (c == 0) + { + return i; + } + else + { + start = i + 1; + } + i = (start + end) / 2; + } + return -1; +} + +/* Find the opcode in the main opcode table whose name is STRINGINDEX, or + return -1 if one does not exist. */ + +static short +find_main_ent (nameindex) + short nameindex; +{ + short start = 0; + short end = sizeof (main_table) / sizeof (struct ia64_main_table); + short i = (start + end) / 2; + + if (nameindex < main_table[0].name_index + || nameindex > main_table[end - 1].name_index) + { + return -1; + } + while (start <= end) + { + if (nameindex < main_table[i].name_index) + { + end = i - 1; + } + else if (nameindex == main_table[i].name_index) + { + while (i > 0 && main_table[i - 1].name_index == nameindex) + { + i--; + } + return i; + } + else + { + start = i + 1; + } + i = (start + end) / 2; + } + return -1; +} + +/* Find the index of the entry in the completer table that is part of + MAIN_ENT (starting from PREV_COMPLETER) that matches NAME, or + return -1 if one does not exist. */ + +static short +find_completer (main_ent, prev_completer, name) + short main_ent; + short prev_completer; + const char *name; +{ + short name_index = find_string_ent (name); + + if (name_index < 0) + { + return -1; + } + + if (prev_completer == -1) + { + prev_completer = main_table[main_ent].completers; + } + else + { + prev_completer = completer_table[prev_completer].subentries; + } + + while (prev_completer != -1) + { + if (completer_table[prev_completer].name_index == name_index) + { + return prev_completer; + } + prev_completer = completer_table[prev_completer].alternative; + } + return -1; +} + +/* Apply the completer referred to by COMPLETER_INDEX to OPCODE, and + return the result. */ + +static ia64_insn +apply_completer (opcode, completer_index) + ia64_insn opcode; + int completer_index; +{ + ia64_insn mask = completer_table[completer_index].mask; + ia64_insn bits = completer_table[completer_index].bits; + int shiftamt = (completer_table[completer_index].offset & 63); + + mask = mask << shiftamt; + bits = bits << shiftamt; + opcode = (opcode & ~mask) | bits; + return opcode; +} + +/* Extract BITS number of bits starting from OP_POINTER + BITOFFSET in + the dis_table array, and return its value. (BITOFFSET is numbered + starting from MSB to LSB, so a BITOFFSET of 0 indicates the MSB of the + first byte in OP_POINTER.) */ + +static int +extract_op_bits (op_pointer, bitoffset, bits) + int op_pointer; + int bitoffset; + int bits; +{ + int res = 0; + + op_pointer += (bitoffset / 8); + + if (bitoffset % 8) + { + unsigned int op = dis_table[op_pointer++]; + int numb = 8 - (bitoffset % 8); + int mask = (1 << numb) - 1; + int bata = (bits < numb) ? bits : numb; + int delta = numb - bata; + + res = (res << bata) | ((op & mask) >> delta); + bitoffset += bata; + bits -= bata; + } + while (bits >= 8) + { + res = (res << 8) | (dis_table[op_pointer++] & 255); + bits -= 8; + } + if (bits > 0) + { + unsigned int op = (dis_table[op_pointer++] & 255); + res = (res << bits) | (op >> (8 - bits)); + } + return res; +} + +/* Examine the state machine entry at OP_POINTER in the dis_table + array, and extract its values into OPVAL and OP. The length of the + state entry in bits is returned. */ + +static int +extract_op (op_pointer, opval, op) + int op_pointer; + int *opval; + unsigned int *op; +{ + int oplen = 5; + + *op = dis_table[op_pointer]; + + if ((*op) & 0x40) + { + opval[0] = extract_op_bits (op_pointer, oplen, 5); + oplen += 5; + } + switch ((*op) & 0x30) + { + case 0x10: + { + opval[1] = extract_op_bits (op_pointer, oplen, 8); + oplen += 8; + opval[1] += op_pointer; + break; + } + case 0x20: + { + opval[1] = extract_op_bits (op_pointer, oplen, 16); + if (! (opval[1] & 32768)) + { + opval[1] += op_pointer; + } + oplen += 16; + break; + } + case 0x30: + { + oplen--; + opval[2] = extract_op_bits (op_pointer, oplen, 12); + oplen += 12; + opval[2] |= 32768; + break; + } + } + if (((*op) & 0x08) && (((*op) & 0x30) != 0x30)) + { + opval[2] = extract_op_bits (op_pointer, oplen, 16); + oplen += 16; + if (! (opval[2] & 32768)) + { + opval[2] += op_pointer; + } + } + return oplen; +} + +/* Returns a non-zero value if the opcode in the main_table list at + PLACE matches OPCODE and is of type TYPE. */ + +static int +opcode_verify (opcode, place, type) + ia64_insn opcode; + int place; + enum ia64_insn_type type; +{ + if (main_table[place].opcode_type != type) + { + return 0; + } + if (main_table[place].flags + & (IA64_OPCODE_F2_EQ_F3 | IA64_OPCODE_LEN_EQ_64MCNT)) + { + const struct ia64_operand *o1, *o2; + ia64_insn f2, f3; + + if (main_table[place].flags & IA64_OPCODE_F2_EQ_F3) + { + o1 = elf64_ia64_operands + IA64_OPND_F2; + o2 = elf64_ia64_operands + IA64_OPND_F3; + (*o1->extract) (o1, opcode, &f2); + (*o2->extract) (o2, opcode, &f3); + if (f2 != f3) + return 0; + } + else + { + ia64_insn len, count; + + /* length must equal 64-count: */ + o1 = elf64_ia64_operands + IA64_OPND_LEN6; + o2 = elf64_ia64_operands + main_table[place].operands[2]; + (*o1->extract) (o1, opcode, &len); + (*o2->extract) (o2, opcode, &count); + if (len != 64 - count) + return 0; + } + } + return 1; +} + +/* Find an instruction entry in the ia64_dis_names array that matches + opcode OPCODE and is of type TYPE. Returns either a positive index + into the array, or a negative value if an entry for OPCODE could + not be found. Checks all matches and returns the one with the highest + priority. */ + +static int +locate_opcode_ent (opcode, type) + ia64_insn opcode; + enum ia64_insn_type type; +{ + int currtest[41]; + int bitpos[41]; + int op_ptr[41]; + int currstatenum = 0; + short found_disent = -1; + short found_priority = -1; + + currtest[currstatenum] = 0; + op_ptr[currstatenum] = 0; + bitpos[currstatenum] = 40; + + while (1) + { + int op_pointer = op_ptr[currstatenum]; + unsigned int op; + int currbitnum = bitpos[currstatenum]; + int oplen; + int opval[3]; + int next_op; + int currbit; + + oplen = extract_op (op_pointer, opval, &op); + + bitpos[currstatenum] = currbitnum; + + /* Skip opval[0] bits in the instruction. */ + if (op & 0x40) + { + currbitnum -= opval[0]; + } + + /* The value of the current bit being tested. */ + currbit = opcode & (((ia64_insn) 1) << currbitnum) ? 1 : 0; + next_op = -1; + + /* We always perform the tests specified in the current state in + a particular order, falling through to the next test if the + previous one failed. */ + switch (currtest[currstatenum]) + { + case 0: + currtest[currstatenum]++; + if (currbit == 0 && (op & 0x80)) + { + /* Check for a zero bit. If this test solely checks for + a zero bit, we can check for up to 8 consecutive zero + bits (the number to check is specified by the lower 3 + bits in the state code.) + + If the state instruction matches, we go to the very + next state instruction; otherwise, try the next test. */ + + if ((op & 0xf8) == 0x80) + { + int count = op & 0x7; + int x; + + for (x = 0; x <= count; x++) + { + int i = + opcode & (((ia64_insn) 1) << (currbitnum - x)) ? 1 : 0; + if (i) + { + break; + } + } + if (x > count) + { + next_op = op_pointer + ((oplen + 7) / 8); + currbitnum -= count; + break; + } + } + else if (! currbit) + { + next_op = op_pointer + ((oplen + 7) / 8); + break; + } + } + /* FALLTHROUGH */ + case 1: + /* If the bit in the instruction is one, go to the state + instruction specified by opval[1]. */ + currtest[currstatenum]++; + if (currbit && (op & 0x30) != 0 && ((op & 0x30) != 0x30)) + { + next_op = opval[1]; + break; + } + /* FALLTHROUGH */ + case 2: + /* Don't care. Skip the current bit and go to the state + instruction specified by opval[2]. + + An encoding of 0x30 is special; this means that a 12-bit + offset into the ia64_dis_names[] array is specified. */ + currtest[currstatenum]++; + if ((op & 0x08) || ((op & 0x30) == 0x30)) + { + next_op = opval[2]; + break; + } + } + + /* If bit 15 is set in the address of the next state, an offset + in the ia64_dis_names array was specified instead. We then + check to see if an entry in the list of opcodes matches the + opcode we were given; if so, we have succeeded. */ + + if ((next_op >= 0) && (next_op & 32768)) + { + short disent = next_op & 32767; + short priority = -1; + + if (next_op > 65535) + { + abort (); + } + + /* Run through the list of opcodes to check, trying to find + one that matches. */ + while (disent >= 0) + { + int place = ia64_dis_names[disent].insn_index; + + priority = ia64_dis_names[disent].priority; + + if (opcode_verify (opcode, place, type) + && priority > found_priority) + { + break; + } + if (ia64_dis_names[disent].next_flag) + { + disent++; + } + else + { + disent = -1; + } + } + + if (disent >= 0) + { + found_disent = disent; + found_priority = priority; + } + /* Try the next test in this state, regardless of whether a match + was found. */ + next_op = -2; + } + + /* next_op == -1 is "back up to the previous state". + next_op == -2 is "stay in this state and try the next test". + Otherwise, transition to the state indicated by next_op. */ + + if (next_op == -1) + { + currstatenum--; + if (currstatenum < 0) + { + return found_disent; + } + } + else if (next_op >= 0) + { + currstatenum++; + bitpos[currstatenum] = currbitnum - 1; + op_ptr[currstatenum] = next_op; + currtest[currstatenum] = 0; + } + } +} + +/* Construct an ia64_opcode entry based on OPCODE, NAME and PLACE. */ + +static struct ia64_opcode * +make_ia64_opcode (opcode, name, place, depind) + ia64_insn opcode; + const char *name; + int place; + int depind; +{ + struct ia64_opcode *res = + (struct ia64_opcode *) xmalloc (sizeof (struct ia64_opcode)); + res->name = xstrdup (name); + res->type = main_table[place].opcode_type; + res->num_outputs = main_table[place].num_outputs; + res->opcode = opcode; + res->mask = main_table[place].mask; + res->operands[0] = main_table[place].operands[0]; + res->operands[1] = main_table[place].operands[1]; + res->operands[2] = main_table[place].operands[2]; + res->operands[3] = main_table[place].operands[3]; + res->operands[4] = main_table[place].operands[4]; + res->flags = main_table[place].flags; + res->ent_index = place; + res->dependencies = &op_dependencies[depind]; + return res; +} + +/* Determine the ia64_opcode entry for the opcode specified by INSN + and TYPE. If a valid entry is not found, return NULL. */ +struct ia64_opcode * +ia64_dis_opcode (insn, type) + ia64_insn insn; + enum ia64_insn_type type; +{ + int disent = locate_opcode_ent (insn, type); + + if (disent < 0) + { + return NULL; + } + else + { + unsigned int cb = ia64_dis_names[disent].completer_index; + static char name[128]; + int place = ia64_dis_names[disent].insn_index; + int ci = main_table[place].completers; + ia64_insn tinsn = main_table[place].opcode; + + strcpy (name, ia64_strings [main_table[place].name_index]); + + while (cb) + { + if (cb & 1) + { + int cname = completer_table[ci].name_index; + + tinsn = apply_completer (tinsn, ci); + + if (ia64_strings[cname][0] != '\0') + { + strcat (name, "."); + strcat (name, ia64_strings[cname]); + } + if (cb != 1) + { + ci = completer_table[ci].subentries; + } + } + else + { + ci = completer_table[ci].alternative; + } + if (ci < 0) + { + abort (); + } + cb = cb >> 1; + } + if (tinsn != (insn & main_table[place].mask)) + { + abort (); + } + return make_ia64_opcode (insn, name, place, + completer_table[ci].dependencies); + } +} + +/* Search the main_opcode table starting from PLACE for an opcode that + matches NAME. Return NULL if one is not found. */ + +static struct ia64_opcode * +ia64_find_matching_opcode (name, place) + const char *name; + short place; +{ + char op[129]; + const char *suffix; + short name_index; + + if (strlen (name) > 128) + { + return NULL; + } + suffix = name; + get_opc_prefix (&suffix, op); + name_index = find_string_ent (op); + if (name_index < 0) + { + return NULL; + } + + while (main_table[place].name_index == name_index) + { + const char *curr_suffix = suffix; + ia64_insn curr_insn = main_table[place].opcode; + short completer = -1; + + do { + if (suffix[0] == '\0') + { + completer = find_completer (place, completer, suffix); + } + else + { + get_opc_prefix (&curr_suffix, op); + completer = find_completer (place, completer, op); + } + if (completer != -1) + { + curr_insn = apply_completer (curr_insn, completer); + } + } while (completer != -1 && curr_suffix[0] != '\0'); + + if (completer != -1 && curr_suffix[0] == '\0' + && completer_table[completer].terminal_completer) + { + int depind = completer_table[completer].dependencies; + return make_ia64_opcode (curr_insn, name, place, depind); + } + else + { + place++; + } + } + return NULL; +} + +/* Find the next opcode after PREV_ENT that matches PREV_ENT, or return NULL + if one does not exist. + + It is the caller's responsibility to invoke ia64_free_opcode () to + release any resources used by the returned entry. */ + +struct ia64_opcode * +ia64_find_next_opcode (prev_ent) + struct ia64_opcode *prev_ent; +{ + return ia64_find_matching_opcode (prev_ent->name, + prev_ent->ent_index + 1); +} + +/* Find the first opcode that matches NAME, or return NULL if it does + not exist. + + It is the caller's responsibility to invoke ia64_free_opcode () to + release any resources used by the returned entry. */ + +struct ia64_opcode * +ia64_find_opcode (name) + const char *name; +{ + char op[129]; + const char *suffix; + short place; + short name_index; + + if (strlen (name) > 128) + { + return NULL; + } + suffix = name; + get_opc_prefix (&suffix, op); + name_index = find_string_ent (op); + if (name_index < 0) + { + return NULL; + } + + place = find_main_ent (name_index); + + if (place < 0) + { + return NULL; + } + return ia64_find_matching_opcode (name, place); +} + +/* Free any resources used by ENT. */ +void +ia64_free_opcode (ent) + struct ia64_opcode *ent; +{ + free ((void *)ent->name); + free (ent); +} + +const struct ia64_dependency * +ia64_find_dependency (index) + int index; +{ + index = DEP(index); + + if (index < 0 + || index >= (int)(sizeof(dependencies) / sizeof(dependencies[0]))) + return NULL; + + return &dependencies[index]; +} diff --git a/contrib/binutils/opcodes/ia64-opc.h b/contrib/binutils/opcodes/ia64-opc.h new file mode 100644 index 0000000..b721cb8 --- /dev/null +++ b/contrib/binutils/opcodes/ia64-opc.h @@ -0,0 +1,130 @@ +/* ia64-opc.h -- IA-64 opcode table. + Copyright 1998, 1999, 2000 Free Software Foundation, Inc. + Contributed by David Mosberger-Tang <davidm@hpl.hp.com> + + This file is part of GDB, GAS, and the GNU binutils. + + GDB, GAS, and the GNU binutils are free software; you can redistribute + them and/or modify them under the terms of the GNU General Public + License as published by the Free Software Foundation; either version + 2, or (at your option) any later version. + + GDB, GAS, and the GNU binutils are distributed in the hope that they + will be useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this file; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#ifndef IA64_OPC_H +#define IA64_OPC_H + +#include "opcode/ia64.h" + +/* define a couple of abbreviations: */ + +#define bOp(x) (((ia64_insn) ((x) & 0xf)) << 37) +#define mOp bOp (-1) +#define Op(x) bOp (x), mOp + +#define FIRST IA64_OPCODE_FIRST +#define X_IN_MLX IA64_OPCODE_X_IN_MLX +#define LAST IA64_OPCODE_LAST +#define PRIV IA64_OPCODE_PRIV +#define NO_PRED IA64_OPCODE_NO_PRED +#define SLOT2 IA64_OPCODE_SLOT2 +#define PSEUDO IA64_OPCODE_PSEUDO +#define F2_EQ_F3 IA64_OPCODE_F2_EQ_F3 +#define LEN_EQ_64MCNT IA64_OPCODE_LEN_EQ_64MCNT +#define MOD_RRBS IA64_OPCODE_MOD_RRBS +#define POSTINC IA64_OPCODE_POSTINC + +#define AR_CCV IA64_OPND_AR_CCV +#define AR_PFS IA64_OPND_AR_PFS +#define C1 IA64_OPND_C1 +#define C8 IA64_OPND_C8 +#define C16 IA64_OPND_C16 +#define GR0 IA64_OPND_GR0 +#define IP IA64_OPND_IP +#define PR IA64_OPND_PR +#define PR_ROT IA64_OPND_PR_ROT +#define PSR IA64_OPND_PSR +#define PSR_L IA64_OPND_PSR_L +#define PSR_UM IA64_OPND_PSR_UM + +#define AR3 IA64_OPND_AR3 +#define B1 IA64_OPND_B1 +#define B2 IA64_OPND_B2 +#define CR3 IA64_OPND_CR3 +#define F1 IA64_OPND_F1 +#define F2 IA64_OPND_F2 +#define F3 IA64_OPND_F3 +#define F4 IA64_OPND_F4 +#define P1 IA64_OPND_P1 +#define P2 IA64_OPND_P2 +#define R1 IA64_OPND_R1 +#define R2 IA64_OPND_R2 +#define R3 IA64_OPND_R3 +#define R3_2 IA64_OPND_R3_2 + +#define CPUID_R3 IA64_OPND_CPUID_R3 +#define DBR_R3 IA64_OPND_DBR_R3 +#define DTR_R3 IA64_OPND_DTR_R3 +#define ITR_R3 IA64_OPND_ITR_R3 +#define IBR_R3 IA64_OPND_IBR_R3 +#define MR3 IA64_OPND_MR3 +#define MSR_R3 IA64_OPND_MSR_R3 +#define PKR_R3 IA64_OPND_PKR_R3 +#define PMC_R3 IA64_OPND_PMC_R3 +#define PMD_R3 IA64_OPND_PMD_R3 +#define RR_R3 IA64_OPND_RR_R3 + +#define CCNT5 IA64_OPND_CCNT5 +#define CNT2a IA64_OPND_CNT2a +#define CNT2b IA64_OPND_CNT2b +#define CNT2c IA64_OPND_CNT2c +#define CNT5 IA64_OPND_CNT5 +#define CNT6 IA64_OPND_CNT6 +#define CPOS6a IA64_OPND_CPOS6a +#define CPOS6b IA64_OPND_CPOS6b +#define CPOS6c IA64_OPND_CPOS6c +#define IMM1 IA64_OPND_IMM1 +#define IMM14 IA64_OPND_IMM14 +#define IMM17 IA64_OPND_IMM17 +#define IMM22 IA64_OPND_IMM22 +#define IMM44 IA64_OPND_IMM44 +#define SOF IA64_OPND_SOF +#define SOL IA64_OPND_SOL +#define SOR IA64_OPND_SOR +#define IMM8 IA64_OPND_IMM8 +#define IMM8U4 IA64_OPND_IMM8U4 +#define IMM8M1 IA64_OPND_IMM8M1 +#define IMM8M1U4 IA64_OPND_IMM8M1U4 +#define IMM8M1U8 IA64_OPND_IMM8M1U8 +#define IMM9a IA64_OPND_IMM9a +#define IMM9b IA64_OPND_IMM9b +#define IMMU2 IA64_OPND_IMMU2 +#define IMMU21 IA64_OPND_IMMU21 +#define IMMU24 IA64_OPND_IMMU24 +#define IMMU62 IA64_OPND_IMMU62 +#define IMMU64 IA64_OPND_IMMU64 +#define IMMU7a IA64_OPND_IMMU7a +#define IMMU7b IA64_OPND_IMMU7b +#define IMMU9 IA64_OPND_IMMU9 +#define INC3 IA64_OPND_INC3 +#define LEN4 IA64_OPND_LEN4 +#define LEN6 IA64_OPND_LEN6 +#define MBTYPE4 IA64_OPND_MBTYPE4 +#define MHTYPE8 IA64_OPND_MHTYPE8 +#define POS6 IA64_OPND_POS6 +#define TAG13 IA64_OPND_TAG13 +#define TAG13b IA64_OPND_TAG13b +#define TGT25 IA64_OPND_TGT25 +#define TGT25b IA64_OPND_TGT25b +#define TGT25c IA64_OPND_TGT25c +#define TGT64 IA64_OPND_TGT64 + +#endif diff --git a/contrib/binutils/opcodes/ia64-raw.tbl b/contrib/binutils/opcodes/ia64-raw.tbl new file mode 100644 index 0000000..ec35888 --- /dev/null +++ b/contrib/binutils/opcodes/ia64-raw.tbl @@ -0,0 +1,174 @@ +Resource Name; Writers; Readers; Semantics of Dependency +ALAT; chk.a.clr, IC:mem-readers-alat, IC:mem-writers, IC:invala-all; IC:mem-readers-alat, IC:mem-writers, IC:chk-a, invala.e; none +AR[BSP]; br.call, brl.call, br.ret, cover, IC:mov-to-AR-BSPSTORE, rfi; br.call, brl.call, br.ia, br.ret, cover, flushrs, loadrs, IC:mov-from-AR-BSP, rfi; impliedF +AR[BSPSTORE]; alloc, loadrs, flushrs, IC:mov-to-AR-BSPSTORE; alloc, br.ia, flushrs, IC:mov-from-AR-BSPSTORE; impliedF +AR[CCV]; IC:mov-to-AR-CCV; br.ia, IC:cmpxchg, IC:mov-from-AR-CCV; impliedF +AR[EC]; IC:mod-sched-brs, br.ret, IC:mov-to-AR-EC; br.call, brl.call, br.ia, IC:mod-sched-brs, IC:mov-from-AR-EC; impliedF +AR[FPSR].sf0.controls; IC:mov-to-AR-FPSR, fsetc.s0; br.ia, IC:fp-arith-s0, IC:fcmp-s0, IC:fpcmp-s0, fsetc, IC:mov-from-AR-FPSR; impliedF +AR[FPSR].sf1.controls; IC:mov-to-AR-FPSR, fsetc.s1; br.ia, IC:fp-arith-s1, IC:fcmp-s1, IC:fpcmp-s1, IC:mov-from-AR-FPSR; impliedF +AR[FPSR].sf2.controls; IC:mov-to-AR-FPSR, fsetc.s2; br.ia, IC:fp-arith-s2, IC:fcmp-s2, IC:fpcmp-s2, IC:mov-from-AR-FPSR; impliedF +AR[FPSR].sf3.controls; IC:mov-to-AR-FPSR, fsetc.s3; br.ia, IC:fp-arith-s3, IC:fcmp-s3, IC:fpcmp-s3, IC:mov-from-AR-FPSR; impliedF +AR[FPSR].sf0.flags; IC:fp-arith-s0, fclrf.s0, IC:fcmp-s0, IC:fpcmp-s0, IC:mov-to-AR-FPSR; br.ia, fchkf, IC:mov-from-AR-FPSR; impliedF +AR[FPSR].sf1.flags; IC:fp-arith-s1, fclrf.s1, IC:fcmp-s1, IC:fpcmp-s1, IC:mov-to-AR-FPSR; br.ia, fchkf.s1, IC:mov-from-AR-FPSR; impliedF +AR[FPSR].sf2.flags; IC:fp-arith-s2, fclrf.s2, IC:fcmp-s2, IC:fpcmp-s2, IC:mov-to-AR-FPSR; br.ia, fchkf.s2, IC:mov-from-AR-FPSR; impliedF +AR[FPSR].sf3.flags; IC:fp-arith-s3, fclrf.s3, IC:fcmp-s3, IC:fpcmp-s3, IC:mov-to-AR-FPSR; br.ia, fchkf.s3, IC:mov-from-AR-FPSR; impliedF +AR[FPSR].traps; IC:mov-to-AR-FPSR; br.ia, IC:fp-arith, fchkf, fcmp, fpcmp, IC:mov-from-AR-FPSR; impliedF +AR[FPSR].rv; IC:mov-to-AR-FPSR; br.ia, IC:fp-arith, fchkf, fcmp, fpcmp, IC:mov-from-AR-FPSR; impliedF +AR[ITC]; IC:mov-to-AR-ITC; br.ia, IC:mov-from-AR-ITC; impliedF +AR[K%], % in 0 - 7; IC:mov-to-AR-K+1; br.ia, IC:mov-from-AR-K+1; impliedF +AR[LC]; IC:mod-sched-brs-counted, IC:mov-to-AR-LC; br.ia, IC:mod-sched-brs-counted, IC:mov-from-AR-LC; impliedF +AR[PFS]; br.call, brl.call; alloc, br.ia, br.ret, epc, IC:mov-from-AR-PFS; impliedF +AR[PFS]; IC:mov-to-AR-PFS; alloc, br.ia, epc, IC:mov-from-AR-PFS; impliedF +AR[PFS]; IC:mov-to-AR-PFS; br.ret; none +AR[RNAT]; alloc, flushrs, loadrs, IC:mov-to-AR-RNAT, IC:mov-to-AR-BSPSTORE; alloc, br.ia, flushrs, loadrs, IC:mov-from-AR-RNAT; impliedF +AR[RSC]; IC:mov-to-AR-RSC; alloc, br.ia, flushrs, loadrs, IC:mov-from-AR-RSC, IC:mov-from-AR-BSPSTORE, IC:mov-to-AR-RNAT, IC:mov-from-AR-RNAT, IC:mov-to-AR-BSPSTORE; impliedF +AR[UNAT]{%}, % in 0 - 63; IC:mov-to-AR-UNAT, st8.spill; br.ia, ld8.fill, IC:mov-from-AR-UNAT; impliedF +AR%, % in 8-15, 20, 22-23, 31, 33-35, 37-39, 41-43, 45-47, 67-111; IC:none; br.ia, IC:mov-from-AR-rv+1; none +AR%, % in 48-63, 112-127; IC:mov-to-AR-ig+1; br.ia, IC:mov-from-AR-ig+1; impliedF +BR%, % in 0 - 7; br.call+1, brl.call+1; IC:indirect-brs+1, IC:indirect-brp+1, IC:mov-from-BR+1; impliedF +BR%, % in 0 - 7; IC:mov-to-BR+1; IC:indirect-brs+1; none +BR%, % in 0 - 7; IC:mov-to-BR+1; IC:indirect-brp+1, IC:mov-from-BR+1; impliedF +CFM; IC:mod-sched-brs; IC:mod-sched-brs; impliedF +CFM; IC:mod-sched-brs; cover, alloc, rfi, loadrs, br.ret, br.call, brl.call; impliedF +CFM; IC:mod-sched-brs; IC:cfm-readers+2; impliedF +CFM; br.call, brl.call, br.ret, clrrrb, cover, rfi; IC:cfm-readers; impliedF +CFM; alloc; IC:cfm-readers; none +CPUID#; IC:none; IC:mov-from-IND-CPUID+3; specific +CR[CMCV]; IC:mov-to-CR-CMCV; IC:mov-from-CR-CMCV; data +CR[DCR]; IC:mov-to-CR-DCR; IC:mov-from-CR-DCR, IC:mem-readers-spec; data +CR[EOI]; IC:mov-to-CR-EOI; IC:none; SC Section 10.8.3.4 +CR[GPTA]; IC:mov-to-CR-GPTA; IC:mov-from-CR-GPTA, thash; data +CR[IFA]; IC:mov-to-CR-IFA; itc.i, itc.d, itr.i, itr.d; implied +CR[IFA]; IC:mov-to-CR-IFA; IC:mov-from-CR-IFA; data +CR[IFS]; IC:mov-to-CR-IFS; IC:mov-from-CR-IFS; data +CR[IFS]; IC:mov-to-CR-IFS; rfi; implied +CR[IFS]; cover; rfi, IC:mov-from-CR-IFS; implied +CR[IHA]; IC:mov-to-CR-IHA; IC:mov-from-CR-IHA; data +CR[IIM]; IC:mov-to-CR-IIM; IC:mov-from-CR-IIM; data +CR[IIP]; IC:mov-to-CR-IIP; IC:mov-from-CR-IIP; data +CR[IIP]; IC:mov-to-CR-IIP; rfi; implied +CR[IIPA]; IC:mov-to-CR-IIPA; IC:mov-from-CR-IIPA; data +CR[IPSR]; IC:mov-to-CR-IPSR; IC:mov-from-CR-IPSR; data +CR[IPSR]; IC:mov-to-CR-IPSR; rfi; implied +CR[IRR%], % in 0 - 3; IC:mov-from-CR-IVR; IC:mov-from-CR-IRR+1; data +CR[ISR]; IC:mov-to-CR-ISR; IC:mov-from-CR-ISR; data +CR[ITIR]; IC:mov-to-CR-ITIR; IC:mov-from-CR-ITIR; data +CR[ITIR]; IC:mov-to-CR-ITIR; itc.i, itc.d, itr.i, itr.d; implied +CR[ITM]; IC:mov-to-CR-ITM; IC:mov-from-CR-ITM; data +CR[ITV]; IC:mov-to-CR-ITV; IC:mov-from-CR-ITV; data +CR[IVA]; IC:mov-to-CR-IVA; IC:mov-from-CR-IVA; instr +CR[IVR]; IC:none; IC:mov-from-CR-IVR; SC Section 10.8.3.2 +CR[LID]; IC:mov-to-CR-LID; IC:mov-from-CR-LID; SC Section 10.8.3.1 +CR[LRR%], % in 0 - 1; IC:mov-to-CR-LRR+1; IC:mov-from-CR-LRR+1; data +CR[PMV]; IC:mov-to-CR-PMV; IC:mov-from-CR-PMV; data +CR[PTA]; IC:mov-to-CR-PTA; IC:mov-from-CR-PTA, thash; data +CR[TPR]; IC:mov-to-CR-TPR; IC:mov-from-CR-TPR, IC:mov-from-CR-IVR; data +CR[TPR]; IC:mov-to-CR-TPR; IC:mov-to-PSR-l, rfi, rsm, ssm; SC Section 10.8.3.3 +CR%, % in 3-7, 10-15, 18, 26-63, 75-79, 82-127; IC:none; IC:mov-from-CR-rv+1; none +DBR#; IC:mov-to-IND-DBR+3; IC:mov-from-IND-DBR+3; impliedF +DBR#; IC:mov-to-IND-DBR+3; IC:probe-all, IC:lfetch-all, IC:mem-readers, IC:mem-writers; data +DTC; ptc.e, ptc.g, ptc.ga, ptc.l, ptr.i, ptr.d, itc.i, itc.d, itr.i, itr.d; IC:mem-readers, IC:mem-writers, fc, IC:probe-all, tak, tpa; data +DTC; itc.i, itc.d, itr.i, itr.d; ptc.e, ptc.g, ptc.ga, ptc.l, ptr.i, ptr.d, itc.i, itc.d, itr.i, itr.d; impliedF +DTC; ptc.e, ptc.g, ptc.ga, ptc.l, ptr.i, ptr.d; ptc.e, ptc.g, ptc.ga, ptc.l, ptr.i, ptr.d; none +DTC; ptc.e, ptc.g, ptc.ga, ptc.l, ptr.i, ptr.d; itc.i, itc.d, itr.i, itr.d; impliedF +DTC_LIMIT*; ptc.g, ptc.ga; ptc.g, ptc.ga; impliedF +DTR; itr.d; IC:mem-readers, IC:mem-writers, fc, IC:probe-all, tak, tpa; data +DTR; itr.d; ptc.g, ptc.ga, ptc.l, ptr.d, itr.d; impliedF +DTR; ptr.d; IC:mem-readers, IC:mem-writers, fc, IC:probe-all, tak, tpa; data +DTR; ptr.d; ptc.g, ptc.ga, ptc.l, ptr.d; none +DTR; ptr.d; itr.d, itc.d; impliedF +FR%, % in 0 - 1; IC:none; IC:fr-readers+1; none +FR%, % in 2 - 127; IC:fr-writers+1\IC:ldf-c+1\IC:ldfp-c+1; IC:fr-readers+1; impliedF +FR%, % in 2 - 127; IC:ldf-c+1, IC:ldfp-c+1; IC:fr-readers+1; none +GR0; IC:none; IC:gr-readers+1; none +GR%, % in 1 - 127; IC:ld-c+1+13; IC:gr-readers+1; none +GR%, % in 1 - 127; IC:gr-writers+1\IC:ld-c+1+13; IC:gr-readers+1; impliedF +IBR#; IC:mov-to-IND-IBR+3; IC:mov-from-IND-IBR+3; impliedF +InService*; IC:mov-to-CR-EOI; IC:mov-from-CR-IVR; data +InService*; IC:mov-from-CR-IVR; IC:mov-from-CR-IVR; impliedF +InService*; IC:mov-to-CR-EOI; IC:mov-to-CR-EOI; impliedF +IP; IC:all; IC:all; none +ITC; ptc.e, ptc.g, ptc.ga, ptc.l, ptr.i, ptr.d; epc; instr +ITC; ptc.e, ptc.g, ptc.ga, ptc.l, ptr.i, ptr.d; itc.i, itc.d, itr.i, itr.d; impliedF +ITC; ptc.e, ptc.g, ptc.ga, ptc.l, ptr.i, ptr.d; ptr.i, ptr.d, ptc.e, ptc.g, ptc.ga, ptc.l; none +ITC; itc.i, itc.d, itr.i, itr.d; epc; instr +ITC; itc.i, itc.d, itr.i, itr.d; itc.d, itc.i, itr.d, itr.i, ptr.d, ptr.i, ptc.g, ptc.ga, ptc.l; impliedF +ITC_LIMIT*; ptc.g, ptc.ga; ptc.g, ptc.ga; impliedF +ITR; itr.i; itr.i, itc.i, ptc.g, ptc.ga, ptc.l, ptr.i; impliedF +ITR; itr.i; epc; instr +ITR; ptr.i; itc.i, itr.i; impliedF +ITR; ptr.i; ptc.g, ptc.ga, ptc.l, ptr.i; none +ITR; ptr.i; epc; instr +memory; IC:mem-writers; IC:mem-readers; none +MSR#; IC:mov-to-IND-MSR+5; IC:mov-from-IND-MSR+5; specific +PKR#; IC:mov-to-IND-PKR+3; IC:mem-readers, IC:mem-writers, IC:mov-from-IND-PKR+4, IC:probe-all; data +PKR#; IC:mov-to-IND-PKR+3; IC:mov-to-IND-PKR+4; none +PKR#; IC:mov-to-IND-PKR+3; IC:mov-from-IND-PKR+3; impliedF +PKR#; IC:mov-to-IND-PKR+3; IC:mov-to-IND-PKR+3; impliedF +PMC#; IC:mov-to-IND-PMC+3; IC:mov-from-IND-PMC+3; impliedF +PMC#; IC:mov-to-IND-PMC+3; IC:mov-from-IND-PMD+3; SC+3 Section 12.1.1 +PMD#; IC:mov-to-IND-PMD+3; IC:mov-from-IND-PMD+3; impliedF +PR0; IC:pr-writers+1; IC:pr-readers-br+1, IC:pr-readers-nobr-nomovpr+1, IC:mov-from-PR+12, IC:mov-to-PR+12; none +PR%, % in 1 - 15; IC:pr-writers+1, IC:mov-to-PR-allreg+7; IC:pr-readers-nobr-nomovpr+1, IC:mov-from-PR, IC:mov-to-PR+12; impliedF +PR%, % in 1 - 15; IC:pr-writers-fp+1; IC:pr-readers-br+1; impliedF +PR%, % in 1 - 15; IC:pr-writers-int+1, IC:mov-to-PR-allreg+7; IC:pr-readers-br+1; none +PR%, % in 16 - 62; IC:pr-writers+1, IC:mov-to-PR-allreg+7, IC:mov-to-PR-rotreg; IC:pr-readers-nobr-nomovpr+1, IC:mov-from-PR, IC:mov-to-PR+12; impliedF +PR%, % in 16 - 62; IC:pr-writers-fp+1; IC:pr-readers-br+1; impliedF +PR%, % in 16 - 62; IC:pr-writers-int+1, IC:mov-to-PR-allreg+7, IC:mov-to-PR-rotreg; IC:pr-readers-br+1; none +PR63; IC:mod-sched-brs, IC:pr-writers+1, IC:mov-to-PR-allreg+7, IC:mov-to-PR-rotreg; IC:pr-readers-nobr-nomovpr+1, IC:mov-from-PR, IC:mov-to-PR+12; impliedF +PR63; IC:pr-writers-fp+1, IC:mod-sched-brs; IC:pr-readers-br+1; impliedF +PR63; IC:pr-writers-int+1, IC:mov-to-PR-allreg+7, IC:mov-to-PR-rotreg; IC:pr-readers-br+1; none +PSR.ac; IC:user-mask-writers-partial+7, IC:mov-to-PSR-um; IC:mem-readers, IC:mem-writers; implied +PSR.ac; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:mem-readers, IC:mem-writers; data +PSR.ac; IC:user-mask-writers-partial+7, IC:mov-to-PSR-um, IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:mov-from-PSR, IC:mov-from-PSR-um; impliedF +PSR.be; IC:user-mask-writers-partial+7, IC:mov-to-PSR-um; IC:mem-readers, IC:mem-writers; implied +PSR.be; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:mem-readers, IC:mem-writers; data +PSR.be; IC:user-mask-writers-partial+7, IC:mov-to-PSR-um, IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:mov-from-PSR, IC:mov-from-PSR-um; impliedF +PSR.bn; bsw, rfi; IC:gr-readers+10, IC:gr-writers+10; impliedF +PSR.cpl; epc, br.ret, rfi; IC:priv-ops, br.call, brl.call, epc, IC:mov-from-AR-ITC, IC:mov-to-AR-ITC, IC:mov-to-AR-RSC, IC:mov-to-AR-K, IC:mov-from-IND-PMD, IC:probe-all, IC:mem-readers, IC:mem-writers, IC:lfetch-all; implied +PSR.da; rfi; IC:mem-readers, IC:lfetch-fault, IC:mem-writers, IC:probe-fault; data +PSR.db; IC:mov-to-PSR-l; IC:mem-readers, IC:mem-writers, IC:probe-fault; data +PSR.db; IC:mov-to-PSR-l; IC:mov-from-PSR; impliedF +PSR.db; rfi; IC:mem-readers, IC:mem-writers, IC:mov-from-PSR, IC:probe-fault; data +PSR.dd; rfi; IC:mem-readers, IC:probe-fault, IC:mem-writers, IC:lfetch-fault; data +PSR.dfh; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:fr-readers+8, IC:fr-writers+8; data +PSR.dfh; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:mov-from-PSR; impliedF +PSR.dfl; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:fr-writers+8, IC:fr-readers+8; data +PSR.dfl; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:mov-from-PSR; impliedF +PSR.di; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; br.ia; data +PSR.di; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:mov-from-PSR; impliedF +PSR.dt; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:mem-readers, IC:mem-writers; data +PSR.dt; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:mov-from-PSR; impliedF +PSR.ed; rfi; IC:lfetch-all, IC:mem-readers-spec; data +PSR.i; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l; IC:mov-from-PSR; impliedF +PSR.i; rfi; IC:mov-from-PSR; data +PSR.ia; rfi; IC:none; none +PSR.ic; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:mov-from-PSR; impliedF +PSR.ic; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; cover, itc.i, itc.d, itr.i, itr.d, IC:mov-from-CR-ITIR, IC:mov-from-CR-IFS, IC:mov-from-CR-IIM, IC:mov-from-CR-IIP, IC:mov-from-CR-IPSR, IC:mov-from-CR-ISR, IC:mov-from-CR-IFA, IC:mov-from-CR-IHA, IC:mov-from-CR-IIPA, IC:mov-to-CR-ITIR, IC:mov-to-CR-IFS, IC:mov-to-CR-IIM, IC:mov-to-CR-IIP, IC:mov-to-CR-IPSR, IC:mov-to-CR-ISR, IC:mov-to-CR-IFA, IC:mov-to-CR-IHA, IC:mov-to-CR-IIPA; data +PSR.id; rfi; IC:none; none +PSR.is; br.ia, rfi; IC:none; none +PSR.it; rfi; IC:branches, IC:mov-from-PSR, chk, epc, fchkf; data +PSR.lp; IC:mov-to-PSR-l; IC:mov-from-PSR; impliedF +PSR.lp; IC:mov-to-PSR-l; br.ret; data +PSR.lp; rfi; IC:mov-from-PSR, br.ret; data +PSR.mc; rfi; IC:mov-from-PSR; none +PSR.mfh; IC:fr-writers+9, IC:user-mask-writers-partial+7, IC:mov-to-PSR-um, IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:mov-from-PSR-um, IC:mov-from-PSR; impliedF +PSR.mfl; IC:fr-writers+9, IC:user-mask-writers-partial+7, IC:mov-to-PSR-um, IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:mov-from-PSR-um, IC:mov-from-PSR; impliedF +PSR.pk; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:mem-readers, IC:mem-writers, IC:probe-all; data +PSR.pk; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:mov-from-PSR; impliedF +PSR.pp; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:mov-from-PSR; impliedF +PSR.ri; rfi; IC:none; none +PSR.rt; IC:mov-to-PSR-l; IC:mov-from-PSR; impliedF +PSR.rt; IC:mov-to-PSR-l; alloc, flushrs, loadrs; data +PSR.rt; rfi; IC:mov-from-PSR, alloc, flushrs, loadrs; data +PSR.si; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:mov-from-PSR; impliedF +PSR.si; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:mov-from-AR-ITC; data +PSR.sp; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:mov-from-PSR; impliedF +PSR.sp; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:mov-from-IND-PMD, IC:mov-to-PSR-um, rum, sum; data +PSR.ss; rfi; IC:all; data +PSR.tb; IC:mov-to-PSR-l, rfi; IC:branches, chk, fchkf; data +PSR.tb; IC:mov-to-PSR-l, rfi; IC:mov-from-PSR; impliedF +PSR.up; IC:user-mask-writers-partial+7, IC:mov-to-PSR-um, IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:mov-from-PSR-um, IC:mov-from-PSR; impliedF +RR#; IC:mov-to-IND-RR+6; IC:mem-readers, IC:mem-writers, itc.i, itc.d, itr.i, itr.d, IC:probe-all, ptc.g, ptc.ga, ptc.l, ptr.i, ptr.d, tak, thash, tpa, ttag; data +RR#; IC:mov-to-IND-RR+6; IC:mov-from-IND-RR+6; impliedF +RSE; IC:rse-writers+14; IC:rse-readers+14; impliedF diff --git a/contrib/binutils/opcodes/ia64-war.tbl b/contrib/binutils/opcodes/ia64-war.tbl new file mode 100644 index 0000000..8cdfac5 --- /dev/null +++ b/contrib/binutils/opcodes/ia64-war.tbl @@ -0,0 +1,2 @@ +Resource Name; Readers; Writers; Semantics of Dependency +PR63; IC:pr-readers-br+1; IC:mod-sched-brs; stop diff --git a/contrib/binutils/opcodes/ia64-waw.tbl b/contrib/binutils/opcodes/ia64-waw.tbl new file mode 100644 index 0000000..c8a3365 --- /dev/null +++ b/contrib/binutils/opcodes/ia64-waw.tbl @@ -0,0 +1,128 @@ +Resource Name; Writers; Writers; Semantics of Dependency +ALAT; IC:mem-readers-alat, IC:mem-writers, chk.a.clr, IC:invala-all; IC:mem-readers-alat, IC:mem-writers, chk.a.clr, IC:invala-all; none +AR[BSP]; br.call, brl.call, br.ret, cover, IC:mov-to-AR-BSPSTORE, rfi; br.call, brl.call, br.ret, cover, IC:mov-to-AR-BSPSTORE, rfi; impliedF +AR[BSPSTORE]; alloc, loadrs, flushrs, IC:mov-to-AR-BSPSTORE; alloc, loadrs, flushrs, IC:mov-to-AR-BSPSTORE; impliedF +AR[CCV]; IC:mov-to-AR-CCV; IC:mov-to-AR-CCV; impliedF +AR[EC]; br.ret, IC:mod-sched-brs, IC:mov-to-AR-EC; br.ret, IC:mod-sched-brs, IC:mov-to-AR-EC; impliedF +AR[FPSR].sf0.controls; IC:mov-to-AR-FPSR, fsetc.s0; IC:mov-to-AR-FPSR, fsetc.s0; impliedF +AR[FPSR].sf1.controls; IC:mov-to-AR-FPSR, fsetc.s1; IC:mov-to-AR-FPSR, fsetc.s1; impliedF +AR[FPSR].sf2.controls; IC:mov-to-AR-FPSR, fsetc.s2; IC:mov-to-AR-FPSR, fsetc.s2; impliedF +AR[FPSR].sf3.controls; IC:mov-to-AR-FPSR, fsetc.s3; IC:mov-to-AR-FPSR, fsetc.s3; impliedF +AR[FPSR].sf0.flags; IC:fp-arith-s0, IC:fcmp-s0, IC:fpcmp-s0; IC:fp-arith-s0, IC:fcmp-s0, IC:fpcmp-s0; none +AR[FPSR].sf0.flags; fclrf.s0, IC:fcmp-s0, IC:fp-arith-s0, IC:fpcmp-s0, IC:mov-to-AR-FPSR; fclrf.s0, IC:mov-to-AR-FPSR; impliedF +AR[FPSR].sf1.flags; IC:fp-arith-s1, IC:fcmp-s1, IC:fpcmp-s1; IC:fp-arith-s1, IC:fcmp-s1, IC:fpcmp-s1; none +AR[FPSR].sf1.flags; fclrf.s1, IC:fcmp-s1, IC:fp-arith-s1, IC:fpcmp-s1, IC:mov-to-AR-FPSR; fclrf.s1, IC:mov-to-AR-FPSR; impliedF +AR[FPSR].sf2.flags; IC:fp-arith-s2, IC:fcmp-s2, IC:fpcmp-s2; IC:fp-arith-s2, IC:fcmp-s2, IC:fpcmp-s2; none +AR[FPSR].sf2.flags; fclrf.s2, IC:fcmp-s2, IC:fp-arith-s2, IC:fpcmp-s2, IC:mov-to-AR-FPSR; fclrf.s2, IC:mov-to-AR-FPSR; impliedF +AR[FPSR].sf3.flags; IC:fp-arith-s3, IC:fcmp-s3, IC:fpcmp-s3; IC:fp-arith-s3, IC:fcmp-s3, IC:fpcmp-s3; none +AR[FPSR].sf3.flags; fclrf.s3, IC:fcmp-s3, IC:fp-arith-s3, IC:fpcmp-s3, IC:mov-to-AR-FPSR; fclrf.s3, IC:mov-to-AR-FPSR; impliedF +AR[FPSR].rv; IC:mov-to-AR-FPSR; IC:mov-to-AR-FPSR; impliedF +AR[FPSR].traps; IC:mov-to-AR-FPSR; IC:mov-to-AR-FPSR; impliedF +AR[ITC]; IC:mov-to-AR-ITC; IC:mov-to-AR-ITC; impliedF +AR[K%], % in 0 - 7; IC:mov-to-AR-K+1; IC:mov-to-AR-K+1; impliedF +AR[LC]; IC:mod-sched-brs-counted, IC:mov-to-AR-LC; IC:mod-sched-brs-counted, IC:mov-to-AR-LC; impliedF +AR[PFS]; br.call, brl.call; br.call, brl.call; none +AR[PFS]; br.call, brl.call; IC:mov-to-AR-PFS; impliedF +AR[RNAT]; alloc, flushrs, loadrs, IC:mov-to-AR-RNAT, IC:mov-to-AR-BSPSTORE; alloc, flushrs, loadrs, IC:mov-to-AR-RNAT, IC:mov-to-AR-BSPSTORE; impliedF +AR[RSC]; IC:mov-to-AR-RSC; IC:mov-to-AR-RSC; impliedF +AR[UNAT]{%}, % in 0 - 63; IC:mov-to-AR-UNAT, st8.spill; IC:mov-to-AR-UNAT, st8.spill; impliedF +AR%, % in 8-15, 20, 22-23, 31, 33-35, 37-39, 41-43, 45-47, 67-111; IC:none; IC:none; none +AR%, % in 48 - 63, 112-127; IC:mov-to-AR-ig+1; IC:mov-to-AR-ig+1; impliedF +BR%, % in 0 - 7; br.call+1, brl.call+1; IC:mov-to-BR+1; impliedF +BR%, % in 0 - 7; IC:mov-to-BR+1; IC:mov-to-BR+1; impliedF +BR%, % in 0 - 7; br.call+1, brl.call+1; br.call+1, brl.call+1; none +CFM; IC:mod-sched-brs, br.call, brl.call, br.ret, alloc, clrrrb, cover, rfi; IC:mod-sched-brs, br.call, brl.call, br.ret, alloc, clrrrb, cover, rfi; impliedF +CPUID#; IC:none; IC:none; none +CR[CMCV]; IC:mov-to-CR-CMCV; IC:mov-to-CR-CMCV; impliedF +CR[DCR]; IC:mov-to-CR-DCR; IC:mov-to-CR-DCR; impliedF +CR[EOI]; IC:mov-to-CR-EOI; IC:mov-to-CR-EOI; SC Section 10.8.3.4 +CR[GPTA]; IC:mov-to-CR-GPTA; IC:mov-to-CR-GPTA; impliedF +CR[IFA]; IC:mov-to-CR-IFA; IC:mov-to-CR-IFA; impliedF +CR[IFS]; IC:mov-to-CR-IFS, cover; IC:mov-to-CR-IFS, cover; impliedF +CR[IHA]; IC:mov-to-CR-IHA; IC:mov-to-CR-IHA; impliedF +CR[IIM]; IC:mov-to-CR-IIM; IC:mov-to-CR-IIM; impliedF +CR[IIP]; IC:mov-to-CR-IIP; IC:mov-to-CR-IIP; impliedF +CR[IIPA]; IC:mov-to-CR-IIPA; IC:mov-to-CR-IIPA; impliedF +CR[IPSR]; IC:mov-to-CR-IPSR; IC:mov-to-CR-IPSR; impliedF +CR[IRR%], % in 0 - 3; IC:mov-from-CR-IVR; IC:mov-from-CR-IVR; impliedF +CR[ISR]; IC:mov-to-CR-ISR; IC:mov-to-CR-ISR; impliedF +CR[ITIR]; IC:mov-to-CR-ITIR; IC:mov-to-CR-ITIR; impliedF +CR[ITM]; IC:mov-to-CR-ITM; IC:mov-to-CR-ITM; impliedF +CR[ITV]; IC:mov-to-CR-ITV; IC:mov-to-CR-ITV; impliedF +CR[IVA]; IC:mov-to-CR-IVA; IC:mov-to-CR-IVA; impliedF +CR[IVR]; IC:none; IC:none; SC +CR[LID]; IC:mov-to-CR-LID; IC:mov-to-CR-LID; SC +CR[LRR%], % in 0 - 1; IC:mov-to-CR-LRR+1; IC:mov-to-CR-LRR+1; impliedF +CR[PMV]; IC:mov-to-CR-PMV; IC:mov-to-CR-PMV; impliedF +CR[PTA]; IC:mov-to-CR-PTA; IC:mov-to-CR-PTA; impliedF +CR[TPR]; IC:mov-to-CR-TPR; IC:mov-to-CR-TPR; impliedF +CR%, % in 3-7, 10-15, 18, 26-63, 75-79, 82-127; IC:none; IC:none; none +DBR#; IC:mov-to-IND-DBR+3; IC:mov-to-IND-DBR+3; impliedF +DTC; ptc.e, ptc.g, ptc.ga, ptc.l, ptr.i, ptr.d; ptc.e, ptc.g, ptc.ga, ptc.l, ptr.i, ptr.d; none +DTC; ptc.e, ptc.g, ptc.ga, ptc.l, ptr.i, ptr.d, itc.i, itc.d, itr.i, itr.d; itc.i, itc.d, itr.i, itr.d; impliedF +DTC_LIMIT*; ptc.g, ptc.ga; ptc.g, ptc.ga; impliedF +DTR; itr.d; itr.d; impliedF +DTR; itr.d; ptr.d; impliedF +DTR; ptr.d; ptr.d; none +FR%, % in 0 - 1; IC:none; IC:none; none +FR%, % in 2 - 127; IC:fr-writers+1, IC:ldf-c+1, IC:ldfp-c+1; IC:fr-writers+1, IC:ldf-c+1, IC:ldfp-c+1; impliedF +GR0; IC:none; IC:none; none +GR%, % in 1 - 127; IC:ld-c+1, IC:gr-writers+1; IC:ld-c+1, IC:gr-writers+1; impliedF +IBR#; IC:mov-to-IND-IBR+3; IC:mov-to-IND-IBR+3; impliedF +InService*; IC:mov-to-CR-EOI, IC:mov-from-CR-IVR; IC:mov-to-CR-EOI, IC:mov-from-CR-IVR; SC +IP; IC:all; IC:all; none +ITC; ptc.e, ptc.g, ptc.ga, ptc.l, ptr.i, ptr.d; ptc.e, ptc.g, ptc.ga, ptc.l, ptr.i, ptr.d; none +ITC; ptc.e, ptc.g, ptc.ga, ptc.l, ptr.i, ptr.d, itc.i, itc.d, itr.i, itr.d; itc.i, itc.d, itr.i, itr.d; impliedF +ITR; itr.i; itr.i, ptr.i; impliedF +ITR; ptr.i; ptr.i; none +memory; IC:mem-writers; IC:mem-writers; none +MSR#; IC:mov-to-IND-MSR+5; IC:mov-to-IND-MSR+5; SC +PKR#; IC:mov-to-IND-PKR+3; IC:mov-to-IND-PKR+4; none +PKR#; IC:mov-to-IND-PKR+3; IC:mov-to-IND-PKR+3; impliedF +PMC#; IC:mov-to-IND-PMC+3; IC:mov-to-IND-PMC+3; impliedF +PMD#; IC:mov-to-IND-PMD+3; IC:mov-to-IND-PMD+3; impliedF +PR0; IC:pr-writers+1; IC:pr-writers+1; none +PR%, % in 1 - 15; IC:pr-and-writers+1; IC:pr-and-writers+1; none +PR%, % in 1 - 15; IC:pr-or-writers+1; IC:pr-or-writers+1; none +PR%, % in 1 - 15; IC:pr-unc-writers-fp+1, IC:pr-unc-writers-int+1, IC:pr-norm-writers-fp+1, IC:pr-norm-writers-int+1, IC:pr-and-writers+1, IC:mov-to-PR-allreg+7; IC:pr-unc-writers-fp+1, IC:pr-unc-writers-int+1, IC:pr-norm-writers-fp+1, IC:pr-norm-writers-int+1, IC:pr-or-writers+1, IC:mov-to-PR-allreg+7; impliedF +PR%, % in 16 - 62; IC:pr-and-writers+1; IC:pr-and-writers+1; none +PR%, % in 16 - 62; IC:pr-or-writers+1; IC:pr-or-writers+1; none +PR%, % in 16 - 62; IC:pr-unc-writers-fp+1, IC:pr-unc-writers-int+1, IC:pr-norm-writers-fp+1, IC:pr-norm-writers-int+1, IC:pr-and-writers+1, IC:mov-to-PR-allreg+7, IC:mov-to-PR-rotreg; IC:pr-unc-writers-fp+1, IC:pr-unc-writers-int+1, IC:pr-norm-writers-fp+1, IC:pr-norm-writers-int+1, IC:pr-or-writers+1, IC:mov-to-PR-allreg+7, IC:mov-to-PR-rotreg; impliedF +PR63; IC:pr-and-writers+1; IC:pr-and-writers+1; none +PR63; IC:pr-or-writers+1; IC:pr-or-writers+1; none +PR63; IC:mod-sched-brs, IC:pr-unc-writers-fp+1, IC:pr-unc-writers-int+1, IC:pr-norm-writers-fp+1, IC:pr-norm-writers-int+1, IC:pr-and-writers+1, IC:mov-to-PR-allreg+7, IC:mov-to-PR-rotreg; IC:mod-sched-brs, IC:pr-unc-writers-fp+1, IC:pr-unc-writers-int+1, IC:pr-norm-writers-fp+1, IC:pr-norm-writers-int+1, IC:pr-or-writers+1, IC:mov-to-PR-allreg+7, IC:mov-to-PR-rotreg; impliedF +PSR.ac; IC:user-mask-writers-partial+7, IC:mov-to-PSR-um, IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:user-mask-writers-partial+7, IC:mov-to-PSR-um, IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; impliedF +PSR.be; IC:user-mask-writers-partial+7, IC:mov-to-PSR-um, IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:user-mask-writers-partial+7, IC:mov-to-PSR-um, IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; impliedF +PSR.bn; bsw, rfi; bsw, rfi; impliedF +PSR.cpl; epc, br.ret, rfi; epc, br.ret, rfi; impliedF +PSR.da; rfi; rfi; impliedF +PSR.db; IC:mov-to-PSR-l, rfi; IC:mov-to-PSR-l, rfi; impliedF +PSR.dd; rfi; rfi; impliedF +PSR.dfh; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; impliedF +PSR.dfl; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; impliedF +PSR.di; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; impliedF +PSR.dt; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; impliedF +PSR.ed; rfi; rfi; impliedF +PSR.i; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; impliedF +PSR.ia; rfi; rfi; impliedF +PSR.ic; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; impliedF +PSR.id; rfi; rfi; impliedF +PSR.is; br.ia, rfi; br.ia, rfi; impliedF +PSR.it; rfi; rfi; impliedF +PSR.lp; IC:mov-to-PSR-l, rfi; IC:mov-to-PSR-l, rfi; impliedF +PSR.mc; rfi; rfi; impliedF +PSR.mfh; IC:fr-writers+9; IC:fr-writers+9; none +PSR.mfh; IC:user-mask-writers-partial+7, IC:mov-to-PSR-um, IC:fr-writers+9, IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:user-mask-writers-partial+7, IC:mov-to-PSR-um, IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; impliedF +PSR.mfl; IC:fr-writers+9; IC:fr-writers+9; none +PSR.mfl; IC:user-mask-writers-partial+7, IC:mov-to-PSR-um, IC:fr-writers+9, IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:user-mask-writers-partial+7, IC:mov-to-PSR-um, IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; impliedF +PSR.pk; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; impliedF +PSR.pp; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; impliedF +PSR.ri; rfi; rfi; impliedF +PSR.rt; IC:mov-to-PSR-l, rfi; IC:mov-to-PSR-l, rfi; impliedF +PSR.si; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; impliedF +PSR.sp; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; impliedF +PSR.ss; rfi; rfi; impliedF +PSR.tb; IC:mov-to-PSR-l, rfi; IC:mov-to-PSR-l, rfi; impliedF +PSR.up; IC:user-mask-writers-partial+7, IC:mov-to-PSR-um, IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; IC:user-mask-writers-partial+7, IC:mov-to-PSR-um, IC:sys-mask-writers-partial+7, IC:mov-to-PSR-l, rfi; impliedF +RR#; IC:mov-to-IND-RR+6; IC:mov-to-IND-RR+6; impliedF +RSE; IC:rse-writers+14; IC:rse-writers+14; impliedF |