Revision 903ec55c

b/Makefile.objs
231 231
libdis-$(CONFIG_CRIS_DIS) += cris-dis.o
232 232
libdis-$(CONFIG_HPPA_DIS) += hppa-dis.o
233 233
libdis-$(CONFIG_I386_DIS) += i386-dis.o
234
libdis-$(CONFIG_IA64_DIS) += ia64-dis.o
234 235
libdis-$(CONFIG_M68K_DIS) += m68k-dis.o
235 236
libdis-$(CONFIG_MICROBLAZE_DIS) += microblaze-dis.o
236 237
libdis-$(CONFIG_MIPS_DIS) += mips-dis.o
b/configure
2658 2658
    echo "CONFIG_I386_DIS=y"  >> $config_target_mak
2659 2659
    echo "CONFIG_I386_DIS=y"  >> $libdis_config_mak
2660 2660
  ;;
2661
  ia64*)
2662
    echo "CONFIG_IA64_DIS=y"  >> $config_target_mak
2663
    echo "CONFIG_IA64_DIS=y"  >> $libdis_config_mak
2664
  ;;
2661 2665
  m68k)
2662 2666
    echo "CONFIG_M68K_DIS=y"  >> $config_target_mak
2663 2667
    echo "CONFIG_M68K_DIS=y"  >> $libdis_config_mak
b/dis-asm.h
219 219
#define bfd_mach_cris_v32      32
220 220
#define bfd_mach_cris_v10_v32  1032
221 221
  bfd_arch_microblaze, /* Xilinx MicroBlaze.  */
222
  bfd_arch_ia64,      /* HP/Intel ia64 */
223
#define bfd_mach_ia64_elf64    64
224
#define bfd_mach_ia64_elf32    32
222 225
  bfd_arch_last
223 226
  };
224 227
#define bfd_mach_s390_31 31
......
401 404
extern int print_insn_s390		(bfd_vma, disassemble_info*);
402 405
extern int print_insn_crisv32           (bfd_vma, disassemble_info*);
403 406
extern int print_insn_microblaze        (bfd_vma, disassemble_info*);
407
extern int print_insn_ia64              (bfd_vma, disassemble_info*);
404 408

  
405 409
#if 0
406 410
/* Fetch the disassembler for a given BFD, if that support is available.  */
......
468 472

  
469 473
/* from libbfd */
470 474

  
475
bfd_vma bfd_getl64 (const bfd_byte *addr);
471 476
bfd_vma bfd_getl32 (const bfd_byte *addr);
472 477
bfd_vma bfd_getb32 (const bfd_byte *addr);
473 478
bfd_vma bfd_getl16 (const bfd_byte *addr);
b/disas.c
73 73
  return 1;
74 74
}
75 75

  
76
bfd_vma bfd_getl64 (const bfd_byte *addr)
77
{
78
  unsigned long long v;
79

  
80
  v = (unsigned long long) addr[0];
81
  v |= (unsigned long long) addr[1] << 8;
82
  v |= (unsigned long long) addr[2] << 16;
83
  v |= (unsigned long long) addr[3] << 24;
84
  v |= (unsigned long long) addr[4] << 32;
85
  v |= (unsigned long long) addr[5] << 40;
86
  v |= (unsigned long long) addr[6] << 48;
87
  v |= (unsigned long long) addr[7] << 56;
88
  return (bfd_vma) v;
89
}
90

  
76 91
bfd_vma bfd_getl32 (const bfd_byte *addr)
77 92
{
78 93
  unsigned long v;
......
278 293
    print_insn = print_insn_s390;
279 294
#elif defined(__hppa__)
280 295
    print_insn = print_insn_hppa;
296
#elif defined(__ia64__)
297
    print_insn = print_insn_ia64;
281 298
#else
282 299
    fprintf(out, "0x%lx: Asm output not supported on this arch\n",
283 300
	    (long) code);
b/ia64-dis.c
1
/* ia64-dis.c -- Disassemble ia64 instructions
2
   Copyright 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
3
   Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
4

  
5
   This file is part of GDB, GAS, and the GNU binutils.
6

  
7
   GDB, GAS, and the GNU binutils are free software; you can redistribute
8
   them and/or modify them under the terms of the GNU General Public
9
   License as published by the Free Software Foundation; either version
10
   2, or (at your option) any later version.
11

  
12
   GDB, GAS, and the GNU binutils are distributed in the hope that they
13
   will be useful, but WITHOUT ANY WARRANTY; without even the implied
14
   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
15
   the GNU General Public License for more details.
16

  
17
   You should have received a copy of the GNU General Public License
18
   along with this file; see the file COPYING.  If not, see
19
   <http://www.gnu.org/licenses/>. */
20

  
21
#include <assert.h>
22
#include <string.h>
23

  
24
#include "dis-asm.h"
25

  
26
/* ia64.h -- Header file for ia64 opcode table
27
   Copyright (C) 1998, 1999, 2000, 2002, 2005, 2006
28
   Free Software Foundation, Inc.
29
   Contributed by David Mosberger-Tang <davidm@hpl.hp.com> */
30

  
31
#include <sys/types.h>
32

  
33
typedef uint64_t ia64_insn;
34

  
35
enum ia64_insn_type
36
  {
37
    IA64_TYPE_NIL = 0,	/* illegal type */
38
    IA64_TYPE_A,	/* integer alu (I- or M-unit) */
39
    IA64_TYPE_I,	/* non-alu integer (I-unit) */
40
    IA64_TYPE_M,	/* memory (M-unit) */
41
    IA64_TYPE_B,	/* branch (B-unit) */
42
    IA64_TYPE_F,	/* floating-point (F-unit) */
43
    IA64_TYPE_X,	/* long encoding (X-unit) */
44
    IA64_TYPE_DYN,	/* Dynamic opcode */
45
    IA64_NUM_TYPES
46
  };
47

  
48
enum ia64_unit
49
  {
50
    IA64_UNIT_NIL = 0,	/* illegal unit */
51
    IA64_UNIT_I,	/* integer unit */
52
    IA64_UNIT_M,	/* memory unit */
53
    IA64_UNIT_B,	/* branching unit */
54
    IA64_UNIT_F,	/* floating-point unit */
55
    IA64_UNIT_L,	/* long "unit" */
56
    IA64_UNIT_X,	/* may be integer or branch unit */
57
    IA64_NUM_UNITS
58
  };
59

  
60
/* Changes to this enumeration must be propagated to the operand table in
61
   bfd/cpu-ia64-opc.c
62
 */
63
enum ia64_opnd
64
  {
65
    IA64_OPND_NIL,	/* no operand---MUST BE FIRST!*/
66

  
67
    /* constants */
68
    IA64_OPND_AR_CSD,	/* application register csd (ar.csd) */
69
    IA64_OPND_AR_CCV,	/* application register ccv (ar.ccv) */
70
    IA64_OPND_AR_PFS,	/* application register pfs (ar.pfs) */
71
    IA64_OPND_C1,	/* the constant 1 */
72
    IA64_OPND_C8,	/* the constant 8 */
73
    IA64_OPND_C16,	/* the constant 16 */
74
    IA64_OPND_GR0,	/* gr0 */
75
    IA64_OPND_IP,	/* instruction pointer (ip) */
76
    IA64_OPND_PR,	/* predicate register (pr) */
77
    IA64_OPND_PR_ROT,	/* rotating predicate register (pr.rot) */
78
    IA64_OPND_PSR,	/* processor status register (psr) */
79
    IA64_OPND_PSR_L,	/* processor status register L (psr.l) */
80
    IA64_OPND_PSR_UM,	/* processor status register UM (psr.um) */
81

  
82
    /* register operands: */
83
    IA64_OPND_AR3,	/* third application register # (bits 20-26) */
84
    IA64_OPND_B1,	/* branch register # (bits 6-8) */
85
    IA64_OPND_B2,	/* branch register # (bits 13-15) */
86
    IA64_OPND_CR3,	/* third control register # (bits 20-26) */
87
    IA64_OPND_F1,	/* first floating-point register # */
88
    IA64_OPND_F2,	/* second floating-point register # */
89
    IA64_OPND_F3,	/* third floating-point register # */
90
    IA64_OPND_F4,	/* fourth floating-point register # */
91
    IA64_OPND_P1,	/* first predicate # */
92
    IA64_OPND_P2,	/* second predicate # */
93
    IA64_OPND_R1,	/* first register # */
94
    IA64_OPND_R2,	/* second register # */
95
    IA64_OPND_R3,	/* third register # */
96
    IA64_OPND_R3_2,	/* third register # (limited to gr0-gr3) */
97

  
98
    /* memory operands: */
99
    IA64_OPND_MR3,	/* memory at addr of third register # */
100

  
101
    /* indirect operands: */
102
    IA64_OPND_CPUID_R3,	/* cpuid[reg] */
103
    IA64_OPND_DBR_R3,	/* dbr[reg] */
104
    IA64_OPND_DTR_R3,	/* dtr[reg] */
105
    IA64_OPND_ITR_R3,	/* itr[reg] */
106
    IA64_OPND_IBR_R3,	/* ibr[reg] */
107
    IA64_OPND_MSR_R3,	/* msr[reg] */
108
    IA64_OPND_PKR_R3,	/* pkr[reg] */
109
    IA64_OPND_PMC_R3,	/* pmc[reg] */
110
    IA64_OPND_PMD_R3,	/* pmd[reg] */
111
    IA64_OPND_RR_R3,	/* rr[reg] */
112

  
113
    /* immediate operands: */
114
    IA64_OPND_CCNT5,	/* 5-bit count (31 - bits 20-24) */
115
    IA64_OPND_CNT2a,	/* 2-bit count (1 + bits 27-28) */
116
    IA64_OPND_CNT2b,	/* 2-bit count (bits 27-28): 1, 2, 3 */
117
    IA64_OPND_CNT2c,	/* 2-bit count (bits 30-31): 0, 7, 15, or 16 */
118
    IA64_OPND_CNT5,	/* 5-bit count (bits 14-18) */
119
    IA64_OPND_CNT6,	/* 6-bit count (bits 27-32) */
120
    IA64_OPND_CPOS6a,	/* 6-bit count (63 - bits 20-25) */
121
    IA64_OPND_CPOS6b,	/* 6-bit count (63 - bits 14-19) */
122
    IA64_OPND_CPOS6c,	/* 6-bit count (63 - bits 31-36) */
123
    IA64_OPND_IMM1,	/* signed 1-bit immediate (bit 36) */
124
    IA64_OPND_IMMU2,	/* unsigned 2-bit immediate (bits 13-14) */
125
    IA64_OPND_IMMU5b,	/* unsigned 5-bit immediate (32 + bits 14-18) */
126
    IA64_OPND_IMMU7a,	/* unsigned 7-bit immediate (bits 13-19) */
127
    IA64_OPND_IMMU7b,	/* unsigned 7-bit immediate (bits 20-26) */
128
    IA64_OPND_SOF,	/* 8-bit stack frame size */
129
    IA64_OPND_SOL,	/* 8-bit size of locals */
130
    IA64_OPND_SOR,	/* 6-bit number of rotating registers (scaled by 8) */
131
    IA64_OPND_IMM8,	/* signed 8-bit immediate (bits 13-19 & 36) */
132
    IA64_OPND_IMM8U4,	/* cmp4*u signed 8-bit immediate (bits 13-19 & 36) */
133
    IA64_OPND_IMM8M1,	/* signed 8-bit immediate -1 (bits 13-19 & 36) */
134
    IA64_OPND_IMM8M1U4,	/* cmp4*u signed 8-bit immediate -1 (bits 13-19 & 36)*/
135
    IA64_OPND_IMM8M1U8,	/* cmp*u signed 8-bit immediate -1 (bits 13-19 & 36) */
136
    IA64_OPND_IMMU9,	/* unsigned 9-bit immediate (bits 33-34, 20-26) */
137
    IA64_OPND_IMM9a,	/* signed 9-bit immediate (bits 6-12, 27, 36) */
138
    IA64_OPND_IMM9b,	/* signed 9-bit immediate (bits 13-19, 27, 36) */
139
    IA64_OPND_IMM14,	/* signed 14-bit immediate (bits 13-19, 27-32, 36) */
140
    IA64_OPND_IMM17,	/* signed 17-bit immediate (2*bits 6-12, 24-31, 36) */
141
    IA64_OPND_IMMU21,	/* unsigned 21-bit immediate (bits 6-25, 36) */
142
    IA64_OPND_IMM22,	/* signed 22-bit immediate (bits 13-19, 22-36) */
143
    IA64_OPND_IMMU24,	/* unsigned 24-bit immediate (bits 6-26, 31-32, 36) */
144
    IA64_OPND_IMM44,	/* signed 44-bit immediate (2^16*bits 6-32, 36) */
145
    IA64_OPND_IMMU62,	/* unsigned 62-bit immediate */
146
    IA64_OPND_IMMU64,	/* unsigned 64-bit immediate (lotsa bits...) */
147
    IA64_OPND_INC3,	/* signed 3-bit (bits 13-15): +/-1, 4, 8, 16 */
148
    IA64_OPND_LEN4,	/* 4-bit count (bits 27-30 + 1) */
149
    IA64_OPND_LEN6,	/* 6-bit count (bits 27-32 + 1) */
150
    IA64_OPND_MBTYPE4,	/* 4-bit mux type (bits 20-23) */
151
    IA64_OPND_MHTYPE8,	/* 8-bit mux type (bits 20-27) */
152
    IA64_OPND_POS6,	/* 6-bit count (bits 14-19) */
153
    IA64_OPND_TAG13,	/* signed 13-bit tag (ip + 16*bits 6-12, 33-34) */
154
    IA64_OPND_TAG13b,	/* signed 13-bit tag (ip + 16*bits 24-32) */
155
    IA64_OPND_TGT25,	/* signed 25-bit (ip + 16*bits 6-25, 36) */
156
    IA64_OPND_TGT25b,	/* signed 25-bit (ip + 16*bits 6-12, 20-32, 36) */
157
    IA64_OPND_TGT25c,	/* signed 25-bit (ip + 16*bits 13-32, 36) */
158
    IA64_OPND_TGT64,    /* 64-bit (ip + 16*bits 13-32, 36, 2-40(L)) */
159
    IA64_OPND_LDXMOV,	/* any symbol, generates R_IA64_LDXMOV.  */
160

  
161
    IA64_OPND_COUNT	/* # of operand types (MUST BE LAST!) */
162
  };
163

  
164
enum ia64_dependency_mode
165
{
166
  IA64_DV_RAW,
167
  IA64_DV_WAW,
168
  IA64_DV_WAR,
169
};
170

  
171
enum ia64_dependency_semantics
172
{
173
  IA64_DVS_NONE,
174
  IA64_DVS_IMPLIED,
175
  IA64_DVS_IMPLIEDF,
176
  IA64_DVS_DATA,
177
  IA64_DVS_INSTR,
178
  IA64_DVS_SPECIFIC,
179
  IA64_DVS_STOP,
180
  IA64_DVS_OTHER,
181
};
182

  
183
enum ia64_resource_specifier
184
{
185
  IA64_RS_ANY,
186
  IA64_RS_AR_K,
187
  IA64_RS_AR_UNAT,
188
  IA64_RS_AR, /* 8-15, 20, 22-23, 31, 33-35, 37-39, 41-43, 45-47, 67-111 */
189
  IA64_RS_ARb, /* 48-63, 112-127 */
190
  IA64_RS_BR,
191
  IA64_RS_CFM,
192
  IA64_RS_CPUID,
193
  IA64_RS_CR_IRR,
194
  IA64_RS_CR_LRR,
195
  IA64_RS_CR, /* 3-7,10-15,18,26-63,75-79,82-127 */
196
  IA64_RS_DBR,
197
  IA64_RS_FR,
198
  IA64_RS_FRb,
199
  IA64_RS_GR0,
200
  IA64_RS_GR,
201
  IA64_RS_IBR,
202
  IA64_RS_INSERVICE, /* CR[EOI] or CR[IVR] */
203
  IA64_RS_MSR,
204
  IA64_RS_PKR,
205
  IA64_RS_PMC,
206
  IA64_RS_PMD,
207
  IA64_RS_PR,  /* non-rotating, 1-15 */
208
  IA64_RS_PRr, /* rotating, 16-62 */
209
  IA64_RS_PR63,
210
  IA64_RS_RR,
211

  
212
  IA64_RS_ARX, /* ARs not in RS_AR or RS_ARb */
213
  IA64_RS_CRX, /* CRs not in RS_CR */
214
  IA64_RS_PSR, /* PSR bits */
215
  IA64_RS_RSE, /* implementation-specific RSE resources */
216
  IA64_RS_AR_FPSR,
217
};
218

  
219
enum ia64_rse_resource
220
{
221
  IA64_RSE_N_STACKED_PHYS,
222
  IA64_RSE_BOF,
223
  IA64_RSE_STORE_REG,
224
  IA64_RSE_LOAD_REG,
225
  IA64_RSE_BSPLOAD,
226
  IA64_RSE_RNATBITINDEX,
227
  IA64_RSE_CFLE,
228
  IA64_RSE_NDIRTY,
229
};
230

  
231
/* Information about a given resource dependency */
232
struct ia64_dependency
233
{
234
  /* Name of the resource */
235
  const char *name;
236
  /* Does this dependency need further specification? */
237
  enum ia64_resource_specifier specifier;
238
  /* Mode of dependency */
239
  enum ia64_dependency_mode mode;
240
  /* Dependency semantics */
241
  enum ia64_dependency_semantics semantics;
242
  /* Register index, if applicable (distinguishes AR, CR, and PSR deps) */
243
#define REG_NONE (-1)
244
  int regindex;
245
  /* Special info on semantics */
246
  const char *info;
247
};
248

  
249
/* Two arrays of indexes into the ia64_dependency table.
250
   chks are dependencies to check for conflicts when an opcode is
251
   encountered; regs are dependencies to register (mark as used) when an
252
   opcode is used.  chks correspond to readers (RAW) or writers (WAW or
253
   WAR) of a resource, while regs correspond to writers (RAW or WAW) and
254
   readers (WAR) of a resource.  */
255
struct ia64_opcode_dependency
256
{
257
  int nchks;
258
  const unsigned short *chks;
259
  int nregs;
260
  const unsigned short *regs;
261
};
262

  
263
/* encode/extract the note/index for a dependency */
264
#define RDEP(N,X) (((N)<<11)|(X))
265
#define NOTE(X) (((X)>>11)&0x1F)
266
#define DEP(X) ((X)&0x7FF)
267

  
268
/* A template descriptor describes the execution units that are active
269
   for each of the three slots.  It also specifies the location of
270
   instruction group boundaries that may be present between two slots.  */
271
struct ia64_templ_desc
272
  {
273
    int group_boundary;	/* 0=no boundary, 1=between slot 0 & 1, etc. */
274
    enum ia64_unit exec_unit[3];
275
    const char *name;
276
  };
277

  
278
/* The opcode table is an array of struct ia64_opcode.  */
279

  
280
struct ia64_opcode
281
  {
282
    /* The opcode name.  */
283
    const char *name;
284

  
285
    /* The type of the instruction: */
286
    enum ia64_insn_type type;
287

  
288
    /* Number of output operands: */
289
    int num_outputs;
290

  
291
    /* The opcode itself.  Those bits which will be filled in with
292
       operands are zeroes.  */
293
    ia64_insn opcode;
294

  
295
    /* The opcode mask.  This is used by the disassembler.  This is a
296
       mask containing ones indicating those bits which must match the
297
       opcode field, and zeroes indicating those bits which need not
298
       match (and are presumably filled in by operands).  */
299
    ia64_insn mask;
300

  
301
    /* An array of operand codes.  Each code is an index into the
302
       operand table.  They appear in the order which the operands must
303
       appear in assembly code, and are terminated by a zero.  */
304
    enum ia64_opnd operands[5];
305

  
306
    /* One bit flags for the opcode.  These are primarily used to
307
       indicate specific processors and environments support the
308
       instructions.  The defined values are listed below. */
309
    unsigned int flags;
310

  
311
    /* Used by ia64_find_next_opcode (). */
312
    short ent_index;
313

  
314
    /* Opcode dependencies. */
315
    const struct ia64_opcode_dependency *dependencies;
316
  };
317

  
318
/* Values defined for the flags field of a struct ia64_opcode.  */
319

  
320
#define IA64_OPCODE_FIRST	(1<<0)	/* must be first in an insn group */
321
#define IA64_OPCODE_X_IN_MLX	(1<<1)	/* insn is allowed in X slot of MLX */
322
#define IA64_OPCODE_LAST	(1<<2)	/* must be last in an insn group */
323
#define IA64_OPCODE_PRIV	(1<<3)	/* privileged instruct */
324
#define IA64_OPCODE_SLOT2	(1<<4)	/* insn allowed in slot 2 only */
325
#define IA64_OPCODE_NO_PRED	(1<<5)	/* insn cannot be predicated */
326
#define IA64_OPCODE_PSEUDO	(1<<6)	/* insn is a pseudo-op */
327
#define IA64_OPCODE_F2_EQ_F3	(1<<7)	/* constraint: F2 == F3 */
328
#define IA64_OPCODE_LEN_EQ_64MCNT	(1<<8)	/* constraint: LEN == 64-CNT */
329
#define IA64_OPCODE_MOD_RRBS    (1<<9)	/* modifies all rrbs in CFM */
330
#define IA64_OPCODE_POSTINC	(1<<10)	/* postincrement MR3 operand */
331

  
332
/* A macro to extract the major opcode from an instruction.  */
333
#define IA64_OP(i)	(((i) >> 37) & 0xf)
334

  
335
enum ia64_operand_class
336
  {
337
    IA64_OPND_CLASS_CST,	/* constant */
338
    IA64_OPND_CLASS_REG,	/* register */
339
    IA64_OPND_CLASS_IND,	/* indirect register */
340
    IA64_OPND_CLASS_ABS,	/* absolute value */
341
    IA64_OPND_CLASS_REL,	/* IP-relative value */
342
  };
343

  
344
/* The operands table is an array of struct ia64_operand.  */
345

  
346
struct ia64_operand
347
{
348
  enum ia64_operand_class class;
349

  
350
  /* Set VALUE as the operand bits for the operand of type SELF in the
351
     instruction pointed to by CODE.  If an error occurs, *CODE is not
352
     modified and the returned string describes the cause of the
353
     error.  If no error occurs, NULL is returned.  */
354
  const char *(*insert) (const struct ia64_operand *self, ia64_insn value,
355
			 ia64_insn *code);
356

  
357
  /* Extract the operand bits for an operand of type SELF from
358
     instruction CODE store them in *VALUE.  If an error occurs, the
359
     cause of the error is described by the string returned.  If no
360
     error occurs, NULL is returned.  */
361
  const char *(*extract) (const struct ia64_operand *self, ia64_insn code,
362
			  ia64_insn *value);
363

  
364
  /* A string whose meaning depends on the operand class.  */
365

  
366
  const char *str;
367

  
368
  struct bit_field
369
    {
370
      /* The number of bits in the operand.  */
371
      int bits;
372

  
373
      /* How far the operand is left shifted in the instruction.  */
374
      int shift;
375
    }
376
  field[4];		/* no operand has more than this many bit-fields */
377

  
378
  unsigned int flags;
379

  
380
  const char *desc;	/* brief description */
381
};
382

  
383
/* Values defined for the flags field of a struct ia64_operand.  */
384

  
385
/* Disassemble as signed decimal (instead of hex): */
386
#define IA64_OPND_FLAG_DECIMAL_SIGNED	(1<<0)
387
/* Disassemble as unsigned decimal (instead of hex): */
388
#define IA64_OPND_FLAG_DECIMAL_UNSIGNED	(1<<1)
389

  
390
#define NELEMS(a)	((int) (sizeof (a) / sizeof (a[0])))
391

  
392
static const char*
393
ins_rsvd (const struct ia64_operand *self ATTRIBUTE_UNUSED,
394
	  ia64_insn value ATTRIBUTE_UNUSED, ia64_insn *code ATTRIBUTE_UNUSED)
395
{
396
  return "internal error---this shouldn't happen";
397
}
398

  
399
static const char*
400
ext_rsvd (const struct ia64_operand *self ATTRIBUTE_UNUSED,
401
	  ia64_insn code ATTRIBUTE_UNUSED, ia64_insn *valuep ATTRIBUTE_UNUSED)
402
{
403
  return "internal error---this shouldn't happen";
404
}
405

  
406
static const char*
407
ins_const (const struct ia64_operand *self ATTRIBUTE_UNUSED,
408
	   ia64_insn value ATTRIBUTE_UNUSED, ia64_insn *code ATTRIBUTE_UNUSED)
409
{
410
  return 0;
411
}
412

  
413
static const char*
414
ext_const (const struct ia64_operand *self ATTRIBUTE_UNUSED,
415
	   ia64_insn code ATTRIBUTE_UNUSED, ia64_insn *valuep ATTRIBUTE_UNUSED)
416
{
417
  return 0;
418
}
419

  
420
static const char*
421
ins_reg (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
422
{
423
  if (value >= 1u << self->field[0].bits)
424
    return "register number out of range";
425

  
426
  *code |= value << self->field[0].shift;
427
  return 0;
428
}
429

  
430
static const char*
431
ext_reg (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
432
{
433
  *valuep = ((code >> self->field[0].shift)
434
	     & ((1u << self->field[0].bits) - 1));
435
  return 0;
436
}
437

  
438
static const char*
439
ins_immu (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
440
{
441
  ia64_insn new = 0;
442
  int i;
443

  
444
  for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
445
    {
446
      new |= ((value & ((((ia64_insn) 1) << self->field[i].bits) - 1))
447
	      << self->field[i].shift);
448
      value >>= self->field[i].bits;
449
    }
450
  if (value)
451
    return "integer operand out of range";
452

  
453
  *code |= new;
454
  return 0;
455
}
456

  
457
static const char*
458
ext_immu (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
459
{
460
  uint64_t value = 0;
461
  int i, bits = 0, total = 0;
462

  
463
  for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
464
    {
465
      bits = self->field[i].bits;
466
      value |= ((code >> self->field[i].shift)
467
		& ((((uint64_t) 1) << bits) - 1)) << total;
468
      total += bits;
469
    }
470
  *valuep = value;
471
  return 0;
472
}
473

  
474
static const char*
475
ins_immu5b (const struct ia64_operand *self, ia64_insn value,
476
	    ia64_insn *code)
477
{
478
  if (value < 32 || value > 63)
479
    return "value must be between 32 and 63";
480
  return ins_immu (self, value - 32, code);
481
}
482

  
483
static const char*
484
ext_immu5b (const struct ia64_operand *self, ia64_insn code,
485
	    ia64_insn *valuep)
486
{
487
  const char *result;
488

  
489
  result = ext_immu (self, code, valuep);
490
  if (result)
491
    return result;
492

  
493
  *valuep = *valuep + 32;
494
  return 0;
495
}
496

  
497
static const char*
498
ins_immus8 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
499
{
500
  if (value & 0x7)
501
    return "value not an integer multiple of 8";
502
  return ins_immu (self, value >> 3, code);
503
}
504

  
505
static const char*
506
ext_immus8 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
507
{
508
  const char *result;
509

  
510
  result = ext_immu (self, code, valuep);
511
  if (result)
512
    return result;
513

  
514
  *valuep = *valuep << 3;
515
  return 0;
516
}
517

  
518
static const char*
519
ins_imms_scaled (const struct ia64_operand *self, ia64_insn value,
520
		 ia64_insn *code, int scale)
521
{
522
  int64_t svalue = value, sign_bit = 0;
523
  ia64_insn new = 0;
524
  int i;
525

  
526
  svalue >>= scale;
527

  
528
  for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
529
    {
530
      new |= ((svalue & ((((ia64_insn) 1) << self->field[i].bits) - 1))
531
	      << self->field[i].shift);
532
      sign_bit = (svalue >> (self->field[i].bits - 1)) & 1;
533
      svalue >>= self->field[i].bits;
534
    }
535
  if ((!sign_bit && svalue != 0) || (sign_bit && svalue != -1))
536
    return "integer operand out of range";
537

  
538
  *code |= new;
539
  return 0;
540
}
541

  
542
static const char*
543
ext_imms_scaled (const struct ia64_operand *self, ia64_insn code,
544
		 ia64_insn *valuep, int scale)
545
{
546
  int i, bits = 0, total = 0;
547
  int64_t val = 0, sign;
548

  
549
  for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
550
    {
551
      bits = self->field[i].bits;
552
      val |= ((code >> self->field[i].shift)
553
	      & ((((uint64_t) 1) << bits) - 1)) << total;
554
      total += bits;
555
    }
556
  /* sign extend: */
557
  sign = (int64_t) 1 << (total - 1);
558
  val = (val ^ sign) - sign;
559

  
560
  *valuep = (val << scale);
561
  return 0;
562
}
563

  
564
static const char*
565
ins_imms (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
566
{
567
  return ins_imms_scaled (self, value, code, 0);
568
}
569

  
570
static const char*
571
ins_immsu4 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
572
{
573
  value = ((value & 0xffffffff) ^ 0x80000000) - 0x80000000;
574

  
575
  return ins_imms_scaled (self, value, code, 0);
576
}
577

  
578
static const char*
579
ext_imms (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
580
{
581
  return ext_imms_scaled (self, code, valuep, 0);
582
}
583

  
584
static const char*
585
ins_immsm1 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
586
{
587
  --value;
588
  return ins_imms_scaled (self, value, code, 0);
589
}
590

  
591
static const char*
592
ins_immsm1u4 (const struct ia64_operand *self, ia64_insn value,
593
	      ia64_insn *code)
594
{
595
  value = ((value & 0xffffffff) ^ 0x80000000) - 0x80000000;
596

  
597
  --value;
598
  return ins_imms_scaled (self, value, code, 0);
599
}
600

  
601
static const char*
602
ext_immsm1 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
603
{
604
  const char *res = ext_imms_scaled (self, code, valuep, 0);
605

  
606
  ++*valuep;
607
  return res;
608
}
609

  
610
static const char*
611
ins_imms1 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
612
{
613
  return ins_imms_scaled (self, value, code, 1);
614
}
615

  
616
static const char*
617
ext_imms1 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
618
{
619
  return ext_imms_scaled (self, code, valuep, 1);
620
}
621

  
622
static const char*
623
ins_imms4 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
624
{
625
  return ins_imms_scaled (self, value, code, 4);
626
}
627

  
628
static const char*
629
ext_imms4 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
630
{
631
  return ext_imms_scaled (self, code, valuep, 4);
632
}
633

  
634
static const char*
635
ins_imms16 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
636
{
637
  return ins_imms_scaled (self, value, code, 16);
638
}
639

  
640
static const char*
641
ext_imms16 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
642
{
643
  return ext_imms_scaled (self, code, valuep, 16);
644
}
645

  
646
static const char*
647
ins_cimmu (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
648
{
649
  ia64_insn mask = (((ia64_insn) 1) << self->field[0].bits) - 1;
650
  return ins_immu (self, value ^ mask, code);
651
}
652

  
653
static const char*
654
ext_cimmu (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
655
{
656
  const char *result;
657
  ia64_insn mask;
658

  
659
  mask = (((ia64_insn) 1) << self->field[0].bits) - 1;
660
  result = ext_immu (self, code, valuep);
661
  if (!result)
662
    {
663
      mask = (((ia64_insn) 1) << self->field[0].bits) - 1;
664
      *valuep ^= mask;
665
    }
666
  return result;
667
}
668

  
669
static const char*
670
ins_cnt (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
671
{
672
  --value;
673
  if (value >= ((uint64_t) 1) << self->field[0].bits)
674
    return "count out of range";
675

  
676
  *code |= value << self->field[0].shift;
677
  return 0;
678
}
679

  
680
static const char*
681
ext_cnt (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
682
{
683
  *valuep = ((code >> self->field[0].shift)
684
	     & ((((uint64_t) 1) << self->field[0].bits) - 1)) + 1;
685
  return 0;
686
}
687

  
688
static const char*
689
ins_cnt2b (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
690
{
691
  --value;
692

  
693
  if (value > 2)
694
    return "count must be in range 1..3";
695

  
696
  *code |= value << self->field[0].shift;
697
  return 0;
698
}
699

  
700
static const char*
701
ext_cnt2b (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
702
{
703
  *valuep = ((code >> self->field[0].shift) & 0x3) + 1;
704
  return 0;
705
}
706

  
707
static const char*
708
ins_cnt2c (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
709
{
710
  switch (value)
711
    {
712
    case 0:	value = 0; break;
713
    case 7:	value = 1; break;
714
    case 15:	value = 2; break;
715
    case 16:	value = 3; break;
716
    default:	return "count must be 0, 7, 15, or 16";
717
    }
718
  *code |= value << self->field[0].shift;
719
  return 0;
720
}
721

  
722
static const char*
723
ext_cnt2c (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
724
{
725
  ia64_insn value;
726

  
727
  value = (code >> self->field[0].shift) & 0x3;
728
  switch (value)
729
    {
730
    case 0: value =  0; break;
731
    case 1: value =  7; break;
732
    case 2: value = 15; break;
733
    case 3: value = 16; break;
734
    }
735
  *valuep = value;
736
  return 0;
737
}
738

  
739
static const char*
740
ins_inc3 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code)
741
{
742
  int64_t val = value;
743
  uint64_t sign = 0;
744

  
745
  if (val < 0)
746
    {
747
      sign = 0x4;
748
      value = -value;
749
    }
750
  switch (value)
751
    {
752
    case  1:	value = 3; break;
753
    case  4:	value = 2; break;
754
    case  8:	value = 1; break;
755
    case 16:	value = 0; break;
756
    default:	return "count must be +/- 1, 4, 8, or 16";
757
    }
758
  *code |= (sign | value) << self->field[0].shift;
759
  return 0;
760
}
761

  
762
static const char*
763
ext_inc3 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep)
764
{
765
  int64_t val;
766
  int negate;
767

  
768
  val = (code >> self->field[0].shift) & 0x7;
769
  negate = val & 0x4;
770
  switch (val & 0x3)
771
    {
772
    case 0: val = 16; break;
773
    case 1: val =  8; break;
774
    case 2: val =  4; break;
775
    case 3: val =  1; break;
776
    }
777
  if (negate)
778
    val = -val;
779

  
780
  *valuep = val;
781
  return 0;
782
}
783

  
784
#define CST	IA64_OPND_CLASS_CST
785
#define REG	IA64_OPND_CLASS_REG
786
#define IND	IA64_OPND_CLASS_IND
787
#define ABS	IA64_OPND_CLASS_ABS
788
#define REL	IA64_OPND_CLASS_REL
789

  
790
#define SDEC	IA64_OPND_FLAG_DECIMAL_SIGNED
791
#define UDEC	IA64_OPND_FLAG_DECIMAL_UNSIGNED
792

  
793
const struct ia64_operand elf64_ia64_operands[IA64_OPND_COUNT] =
794
  {
795
    /* constants: */
796
    { CST, ins_const, ext_const, "NIL",		{{ 0, 0}}, 0, "<none>" },
797
    { CST, ins_const, ext_const, "ar.csd",	{{ 0, 0}}, 0, "ar.csd" },
798
    { CST, ins_const, ext_const, "ar.ccv",	{{ 0, 0}}, 0, "ar.ccv" },
799
    { CST, ins_const, ext_const, "ar.pfs",	{{ 0, 0}}, 0, "ar.pfs" },
800
    { CST, ins_const, ext_const, "1",		{{ 0, 0}}, 0, "1" },
801
    { CST, ins_const, ext_const, "8",		{{ 0, 0}}, 0, "8" },
802
    { CST, ins_const, ext_const, "16",		{{ 0, 0}}, 0, "16" },
803
    { CST, ins_const, ext_const, "r0",		{{ 0, 0}}, 0, "r0" },
804
    { CST, ins_const, ext_const, "ip",		{{ 0, 0}}, 0, "ip" },
805
    { CST, ins_const, ext_const, "pr",		{{ 0, 0}}, 0, "pr" },
806
    { CST, ins_const, ext_const, "pr.rot",	{{ 0, 0}}, 0, "pr.rot" },
807
    { CST, ins_const, ext_const, "psr",		{{ 0, 0}}, 0, "psr" },
808
    { CST, ins_const, ext_const, "psr.l",	{{ 0, 0}}, 0, "psr.l" },
809
    { CST, ins_const, ext_const, "psr.um",	{{ 0, 0}}, 0, "psr.um" },
810

  
811
    /* register operands: */
812
    { REG, ins_reg,   ext_reg,	"ar", {{ 7, 20}}, 0,		/* AR3 */
813
      "an application register" },
814
    { REG, ins_reg,   ext_reg,	 "b", {{ 3,  6}}, 0,		/* B1 */
815
      "a branch register" },
816
    { REG, ins_reg,   ext_reg,	 "b", {{ 3, 13}}, 0,		/* B2 */
817
      "a branch register"},
818
    { REG, ins_reg,   ext_reg,	"cr", {{ 7, 20}}, 0,		/* CR */
819
      "a control register"},
820
    { REG, ins_reg,   ext_reg,	 "f", {{ 7,  6}}, 0,		/* F1 */
821
      "a floating-point register" },
822
    { REG, ins_reg,   ext_reg,	 "f", {{ 7, 13}}, 0,		/* F2 */
823
      "a floating-point register" },
824
    { REG, ins_reg,   ext_reg,	 "f", {{ 7, 20}}, 0,		/* F3 */
825
      "a floating-point register" },
826
    { REG, ins_reg,   ext_reg,	 "f", {{ 7, 27}}, 0,		/* F4 */
827
      "a floating-point register" },
828
    { REG, ins_reg,   ext_reg,	 "p", {{ 6,  6}}, 0,		/* P1 */
829
      "a predicate register" },
830
    { REG, ins_reg,   ext_reg,	 "p", {{ 6, 27}}, 0,		/* P2 */
831
      "a predicate register" },
832
    { REG, ins_reg,   ext_reg,	 "r", {{ 7,  6}}, 0,		/* R1 */
833
      "a general register" },
834
    { REG, ins_reg,   ext_reg,	 "r", {{ 7, 13}}, 0,		/* R2 */
835
      "a general register" },
836
    { REG, ins_reg,   ext_reg,	 "r", {{ 7, 20}}, 0,		/* R3 */
837
      "a general register" },
838
    { REG, ins_reg,   ext_reg,	 "r", {{ 2, 20}}, 0,		/* R3_2 */
839
      "a general register r0-r3" },
840

  
841
    /* memory operands: */
842
    { IND, ins_reg,   ext_reg,	"",      {{7, 20}}, 0,		/* MR3 */
843
      "a memory address" },
844

  
845
    /* indirect operands: */
846
    { IND, ins_reg,   ext_reg,	"cpuid", {{7, 20}}, 0,		/* CPUID_R3 */
847
      "a cpuid register" },
848
    { IND, ins_reg,   ext_reg,	"dbr",   {{7, 20}}, 0,		/* DBR_R3 */
849
      "a dbr register" },
850
    { IND, ins_reg,   ext_reg,	"dtr",   {{7, 20}}, 0,		/* DTR_R3 */
851
      "a dtr register" },
852
    { IND, ins_reg,   ext_reg,	"itr",   {{7, 20}}, 0,		/* ITR_R3 */
853
      "an itr register" },
854
    { IND, ins_reg,   ext_reg,	"ibr",   {{7, 20}}, 0,		/* IBR_R3 */
855
      "an ibr register" },
856
    { IND, ins_reg,   ext_reg,	"msr",   {{7, 20}}, 0,		/* MSR_R3 */
857
      "an msr register" },
858
    { IND, ins_reg,   ext_reg,	"pkr",   {{7, 20}}, 0,		/* PKR_R3 */
859
      "a pkr register" },
860
    { IND, ins_reg,   ext_reg,	"pmc",   {{7, 20}}, 0,		/* PMC_R3 */
861
      "a pmc register" },
862
    { IND, ins_reg,   ext_reg,	"pmd",   {{7, 20}}, 0,		/* PMD_R3 */
863
      "a pmd register" },
864
    { IND, ins_reg,   ext_reg,	"rr",    {{7, 20}}, 0,		/* RR_R3 */
865
      "an rr register" },
866

  
867
    /* immediate operands: */
868
    { ABS, ins_cimmu, ext_cimmu, 0, {{ 5, 20 }}, UDEC,		/* CCNT5 */
869
      "a 5-bit count (0-31)" },
870
    { ABS, ins_cnt,   ext_cnt,   0, {{ 2, 27 }}, UDEC,		/* CNT2a */
871
      "a 2-bit count (1-4)" },
872
    { ABS, ins_cnt2b, ext_cnt2b, 0, {{ 2, 27 }}, UDEC,		/* CNT2b */
873
      "a 2-bit count (1-3)" },
874
    { ABS, ins_cnt2c, ext_cnt2c, 0, {{ 2, 30 }}, UDEC,		/* CNT2c */
875
      "a count (0, 7, 15, or 16)" },
876
    { ABS, ins_immu,  ext_immu,  0, {{ 5, 14}}, UDEC,		/* CNT5 */
877
      "a 5-bit count (0-31)" },
878
    { ABS, ins_immu,  ext_immu,  0, {{ 6, 27}}, UDEC,		/* CNT6 */
879
      "a 6-bit count (0-63)" },
880
    { ABS, ins_cimmu, ext_cimmu, 0, {{ 6, 20}}, UDEC,		/* CPOS6a */
881
      "a 6-bit bit pos (0-63)" },
882
    { ABS, ins_cimmu, ext_cimmu, 0, {{ 6, 14}}, UDEC,		/* CPOS6b */
883
      "a 6-bit bit pos (0-63)" },
884
    { ABS, ins_cimmu, ext_cimmu, 0, {{ 6, 31}}, UDEC,		/* CPOS6c */
885
      "a 6-bit bit pos (0-63)" },
886
    { ABS, ins_imms,  ext_imms,  0, {{ 1, 36}}, SDEC,		/* IMM1 */
887
      "a 1-bit integer (-1, 0)" },
888
    { ABS, ins_immu,  ext_immu,  0, {{ 2, 13}}, UDEC,		/* IMMU2 */
889
      "a 2-bit unsigned (0-3)" },
890
    { ABS, ins_immu5b,  ext_immu5b,  0, {{ 5, 14}}, UDEC,	/* IMMU5b */
891
      "a 5-bit unsigned (32 + (0-31))" },
892
    { ABS, ins_immu,  ext_immu,  0, {{ 7, 13}}, 0,		/* IMMU7a */
893
      "a 7-bit unsigned (0-127)" },
894
    { ABS, ins_immu,  ext_immu,  0, {{ 7, 20}}, 0,		/* IMMU7b */
895
      "a 7-bit unsigned (0-127)" },
896
    { ABS, ins_immu,  ext_immu,  0, {{ 7, 13}}, UDEC,		/* SOF */
897
      "a frame size (register count)" },
898
    { ABS, ins_immu,  ext_immu,  0, {{ 7, 20}}, UDEC,		/* SOL */
899
      "a local register count" },
900
    { ABS, ins_immus8,ext_immus8,0, {{ 4, 27}}, UDEC,		/* SOR */
901
      "a rotating register count (integer multiple of 8)" },
902
    { ABS, ins_imms,  ext_imms,  0,				/* IMM8 */
903
      {{ 7, 13}, { 1, 36}}, SDEC,
904
      "an 8-bit integer (-128-127)" },
905
    { ABS, ins_immsu4,  ext_imms,  0,				/* IMM8U4 */
906
      {{ 7, 13}, { 1, 36}}, SDEC,
907
      "an 8-bit signed integer for 32-bit unsigned compare (-128-127)" },
908
    { ABS, ins_immsm1,  ext_immsm1,  0,				/* IMM8M1 */
909
      {{ 7, 13}, { 1, 36}}, SDEC,
910
      "an 8-bit integer (-127-128)" },
911
    { ABS, ins_immsm1u4,  ext_immsm1,  0,			/* IMM8M1U4 */
912
      {{ 7, 13}, { 1, 36}}, SDEC,
913
      "an 8-bit integer for 32-bit unsigned compare (-127-(-1),1-128,0x100000000)" },
914
    { ABS, ins_immsm1,  ext_immsm1,  0,				/* IMM8M1U8 */
915
      {{ 7, 13}, { 1, 36}}, SDEC,
916
      "an 8-bit integer for 64-bit unsigned compare (-127-(-1),1-128,0x10000000000000000)" },
917
    { ABS, ins_immu,  ext_immu,  0, {{ 2, 33}, { 7, 20}}, 0,	/* IMMU9 */
918
      "a 9-bit unsigned (0-511)" },
919
    { ABS, ins_imms,  ext_imms,  0,				/* IMM9a */
920
      {{ 7,  6}, { 1, 27}, { 1, 36}}, SDEC,
921
      "a 9-bit integer (-256-255)" },
922
    { ABS, ins_imms,  ext_imms, 0,				/* IMM9b */
923
      {{ 7, 13}, { 1, 27}, { 1, 36}}, SDEC,
924
      "a 9-bit integer (-256-255)" },
925
    { ABS, ins_imms,  ext_imms, 0,				/* IMM14 */
926
      {{ 7, 13}, { 6, 27}, { 1, 36}}, SDEC,
927
      "a 14-bit integer (-8192-8191)" },
928
    { ABS, ins_imms1, ext_imms1, 0,				/* IMM17 */
929
      {{ 7,  6}, { 8, 24}, { 1, 36}}, 0,
930
      "a 17-bit integer (-65536-65535)" },
931
    { ABS, ins_immu,  ext_immu,  0, {{20,  6}, { 1, 36}}, 0,	/* IMMU21 */
932
      "a 21-bit unsigned" },
933
    { ABS, ins_imms,  ext_imms,  0,				/* IMM22 */
934
      {{ 7, 13}, { 9, 27}, { 5, 22}, { 1, 36}}, SDEC,
935
      "a 22-bit signed integer" },
936
    { ABS, ins_immu,  ext_immu,  0,				/* IMMU24 */
937
      {{21,  6}, { 2, 31}, { 1, 36}}, 0,
938
      "a 24-bit unsigned" },
939
    { ABS, ins_imms16,ext_imms16,0, {{27,  6}, { 1, 36}}, 0,	/* IMM44 */
940
      "a 44-bit unsigned (least 16 bits ignored/zeroes)" },
941
    { ABS, ins_rsvd,  ext_rsvd,	0, {{0,  0}}, 0,		/* IMMU62 */
942
      "a 62-bit unsigned" },
943
    { ABS, ins_rsvd,  ext_rsvd,	0, {{0,  0}}, 0,		/* IMMU64 */
944
      "a 64-bit unsigned" },
945
    { ABS, ins_inc3,  ext_inc3,  0, {{ 3, 13}}, SDEC,		/* INC3 */
946
      "an increment (+/- 1, 4, 8, or 16)" },
947
    { ABS, ins_cnt,   ext_cnt,   0, {{ 4, 27}}, UDEC,		/* LEN4 */
948
      "a 4-bit length (1-16)" },
949
    { ABS, ins_cnt,   ext_cnt,   0, {{ 6, 27}}, UDEC,		/* LEN6 */
950
      "a 6-bit length (1-64)" },
951
    { ABS, ins_immu,  ext_immu,  0, {{ 4, 20}},	0,		/* MBTYPE4 */
952
      "a mix type (@rev, @mix, @shuf, @alt, or @brcst)" },
953
    { ABS, ins_immu,  ext_immu,  0, {{ 8, 20}},	0,		/* MBTYPE8 */
954
      "an 8-bit mix type" },
955
    { ABS, ins_immu,  ext_immu,  0, {{ 6, 14}}, UDEC,		/* POS6 */
956
      "a 6-bit bit pos (0-63)" },
957
    { REL, ins_imms4, ext_imms4, 0, {{ 7,  6}, { 2, 33}}, 0,	/* TAG13 */
958
      "a branch tag" },
959
    { REL, ins_imms4, ext_imms4, 0, {{ 9, 24}}, 0,		/* TAG13b */
960
      "a branch tag" },
961
    { REL, ins_imms4, ext_imms4, 0, {{20,  6}, { 1, 36}}, 0,	/* TGT25 */
962
      "a branch target" },
963
    { REL, ins_imms4, ext_imms4, 0,				/* TGT25b */
964
      {{ 7,  6}, {13, 20}, { 1, 36}}, 0,
965
      "a branch target" },
966
    { REL, ins_imms4, ext_imms4, 0, {{20, 13}, { 1, 36}}, 0,	/* TGT25c */
967
      "a branch target" },
968
    { REL, ins_rsvd, ext_rsvd, 0, {{0, 0}}, 0,                  /* TGT64  */
969
      "a branch target" },
970

  
971
    { ABS, ins_const, ext_const, 0, {{0, 0}}, 0,		/* LDXMOV */
972
      "ldxmov target" },
973
  };
974

  
975

  
976
/* ia64-asmtab.h -- Header for compacted IA-64 opcode tables.
977
   Copyright 1999, 2000 Free Software Foundation, Inc.
978
   Contributed by Bob Manson of Cygnus Support <manson@cygnus.com>
979

  
980
   This file is part of GDB, GAS, and the GNU binutils.
981

  
982
   GDB, GAS, and the GNU binutils are free software; you can redistribute
983
   them and/or modify them under the terms of the GNU General Public
984
   License as published by the Free Software Foundation; either version
985
   2, or (at your option) any later version.
986

  
987
   GDB, GAS, and the GNU binutils are distributed in the hope that they
988
   will be useful, but WITHOUT ANY WARRANTY; without even the implied
989
   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
990
   the GNU General Public License for more details.
991

  
992
   You should have received a copy of the GNU General Public License
993
   along with this file; see the file COPYING.  If not, write to the
994
   Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
995
   02110-1301, USA.  */
996

  
997
/* The primary opcode table is made up of the following: */
998
struct ia64_main_table
999
{
1000
  /* The entry in the string table that corresponds to the name of this
1001
     opcode. */
1002
  unsigned short name_index;
1003

  
1004
  /* The type of opcode; corresponds to the TYPE field in
1005
     struct ia64_opcode. */
1006
  unsigned char opcode_type;
1007

  
1008
  /* The number of outputs for this opcode. */
1009
  unsigned char num_outputs;
1010

  
1011
  /* The base insn value for this opcode.  It may be modified by completers. */
1012
  ia64_insn opcode;
1013

  
1014
  /* The mask of valid bits in OPCODE. Zeros indicate operand fields. */
1015
  ia64_insn mask;
1016

  
1017
  /* The operands of this instruction.  Corresponds to the OPERANDS field
1018
     in struct ia64_opcode. */
1019
  unsigned char operands[5];
1020

  
1021
  /* The flags for this instruction.  Corresponds to the FLAGS field in
1022
     struct ia64_opcode. */
1023
  short flags;
1024

  
1025
  /* The tree of completers for this instruction; this is an offset into
1026
     completer_table. */
1027
  short completers;
1028
};
1029

  
1030
/* Each instruction has a set of possible "completers", or additional
1031
   suffixes that can alter the instruction's behavior, and which has
1032
   potentially different dependencies.
1033

  
1034
   The completer entries modify certain bits in the instruction opcode.
1035
   Which bits are to be modified are marked by the BITS, MASK and
1036
   OFFSET fields.  The completer entry may also note dependencies for the
1037
   opcode.
1038

  
1039
   These completers are arranged in a DAG; the pointers are indexes
1040
   into the completer_table array.  The completer DAG is searched by
1041
   find_completer () and ia64_find_matching_opcode ().
1042

  
1043
   Note that each completer needs to be applied in turn, so that if we
1044
   have the instruction
1045
	cmp.lt.unc
1046
   the completer entries for both "lt" and "unc" would need to be applied
1047
   to the opcode's value.
1048

  
1049
   Some instructions do not require any completers; these contain an
1050
   empty completer entry.  Instructions that require a completer do
1051
   not contain an empty entry.
1052

  
1053
   Terminal completers (those completers that validly complete an
1054
   instruction) are marked by having the TERMINAL_COMPLETER flag set.
1055

  
1056
   Only dependencies listed in the terminal completer for an opcode are
1057
   considered to apply to that opcode instance. */
1058

  
1059
struct ia64_completer_table
1060
{
1061
  /* The bit value that this completer sets. */
1062
  unsigned int bits;
1063

  
1064
  /* And its mask. 1s are bits that are to be modified in the
1065
     instruction. */
1066
  unsigned int mask;
1067

  
1068
  /* The entry in the string table that corresponds to the name of this
1069
     completer. */
1070
  unsigned short name_index;
1071

  
1072
  /* An alternative completer, or -1 if this is the end of the chain. */
1073
  short alternative;
1074

  
1075
  /* A pointer to the DAG of completers that can potentially follow
1076
     this one, or -1. */
1077
  short subentries;
1078

  
1079
  /* The bit offset in the instruction where BITS and MASK should be
1080
     applied. */
1081
  unsigned char offset : 7;
1082

  
1083
  unsigned char terminal_completer : 1;
1084

  
1085
  /* Index into the dependency list table */
1086
  short dependencies;
1087
};
1088

  
1089
/* This contains sufficient information for the disassembler to resolve
1090
   the complete name of the original instruction.  */
1091
struct ia64_dis_names
1092
{
1093
  /* COMPLETER_INDEX represents the tree of completers that make up
1094
     the instruction.  The LSB represents the top of the tree for the
1095
     specified instruction.
1096

  
1097
     A 0 bit indicates to go to the next alternate completer via the
1098
     alternative field; a 1 bit indicates that the current completer
1099
     is part of the instruction, and to go down the subentries index.
1100
     We know we've reached the final completer when we run out of 1
1101
     bits.
1102

  
1103
     There is always at least one 1 bit. */
1104
  unsigned int completer_index : 20;
1105

  
1106
  /* The index in the main_table[] array for the instruction. */
1107
  unsigned short insn_index : 11;
1108

  
1109
  /* If set, the next entry in this table is an alternate possibility
1110
     for this instruction encoding.  Which one to use is determined by
1111
     the instruction type and other factors (see opcode_verify ()).  */
1112
  unsigned int next_flag : 1;
1113

  
1114
  /* The disassembly priority of this entry among instructions. */
1115
  unsigned short priority;
1116
};
1117

  
1118
static const char * const ia64_strings[] = {
1119
  "", "0", "1", "a", "acq", "add", "addl", "addp4", "adds", "alloc", "and",
1120
  "andcm", "b", "bias", "br", "break", "brl", "brp", "bsw", "c", "call",
1121
  "cexit", "chk", "cloop", "clr", "clrrrb", "cmp", "cmp4", "cmp8xchg16",
1122
  "cmpxchg1", "cmpxchg2", "cmpxchg4", "cmpxchg8", "cond", "cover", "ctop",
1123
  "czx1", "czx2", "d", "dep", "dpnt", "dptk", "e", "epc", "eq", "excl",
1124
  "exit", "exp", "extr", "f", "fabs", "fadd", "famax", "famin", "fand",
1125
  "fandcm", "fault", "fc", "fchkf", "fclass", "fclrf", "fcmp", "fcvt",
1126
  "fetchadd4", "fetchadd8", "few", "fill", "flushrs", "fma", "fmax",
1127
  "fmerge", "fmin", "fmix", "fmpy", "fms", "fneg", "fnegabs", "fnma",
1128
  "fnmpy", "fnorm", "for", "fpabs", "fpack", "fpamax", "fpamin", "fpcmp",
1129
  "fpcvt", "fpma", "fpmax", "fpmerge", "fpmin", "fpmpy", "fpms", "fpneg",
1130
  "fpnegabs", "fpnma", "fpnmpy", "fprcpa", "fprsqrta", "frcpa", "frsqrta",
1131
  "fselect", "fsetc", "fsub", "fswap", "fsxt", "fwb", "fx", "fxor", "fxu",
1132
  "g", "ga", "ge", "getf", "geu", "gt", "gtu", "h", "hint", "hu", "i", "ia",
1133
  "imp", "invala", "itc", "itr", "l", "ld1", "ld16", "ld2", "ld4", "ld8",
1134
  "ldf", "ldf8", "ldfd", "ldfe", "ldfp8", "ldfpd", "ldfps", "ldfs", "le",
1135
  "leu", "lfetch", "loadrs", "loop", "lr", "lt", "ltu", "lu", "m", "many",
1136
  "mf", "mix1", "mix2", "mix4", "mov", "movl", "mux1", "mux2", "nc", "ne",
1137
  "neq", "nge", "ngt", "nl", "nle", "nlt", "nm", "nop", "nr", "ns", "nt1",
1138
  "nt2", "nta", "nz", "or", "orcm", "ord", "pack2", "pack4", "padd1",
1139
  "padd2", "padd4", "pavg1", "pavg2", "pavgsub1", "pavgsub2", "pcmp1",
1140
  "pcmp2", "pcmp4", "pmax1", "pmax2", "pmin1", "pmin2", "pmpy2", "pmpyshr2",
1141
  "popcnt", "pr", "probe", "psad1", "pshl2", "pshl4", "pshladd2", "pshr2",
1142
  "pshr4", "pshradd2", "psub1", "psub2", "psub4", "ptc", "ptr", "r", "raz",
1143
  "rel", "ret", "rfi", "rsm", "rum", "rw", "s", "s0", "s1", "s2", "s3",
1144
  "sa", "se", "setf", "shl", "shladd", "shladdp4", "shr", "shrp", "sig",
1145
  "spill", "spnt", "sptk", "srlz", "ssm", "sss", "st1", "st16", "st2",
1146
  "st4", "st8", "stf", "stf8", "stfd", "stfe", "stfs", "sub", "sum", "sxt1",
1147
  "sxt2", "sxt4", "sync", "tak", "tbit", "tf", "thash", "tnat", "tpa",
1148
  "trunc", "ttag", "u", "unc", "unord", "unpack1", "unpack2", "unpack4",
1149
  "uss", "uus", "uuu", "vmsw", "w", "wexit", "wtop", "x", "xchg1", "xchg2",
1150
  "xchg4", "xchg8", "xf", "xma", "xmpy", "xor", "xuf", "z", "zxt1", "zxt2",
1151
  "zxt4",
1152
};
1153

  
1154
static const struct ia64_dependency
1155
dependencies[] = {
1156
  { "ALAT", 0, 0, 0, -1, NULL, },
1157
  { "AR[BSP]", 26, 0, 2, 17, NULL, },
1158
  { "AR[BSPSTORE]", 26, 0, 2, 18, NULL, },
1159
  { "AR[CCV]", 26, 0, 2, 32, NULL, },
1160
  { "AR[CFLG]", 26, 0, 2, 27, NULL, },
1161
  { "AR[CSD]", 26, 0, 2, 25, NULL, },
1162
  { "AR[EC]", 26, 0, 2, 66, NULL, },
1163
  { "AR[EFLAG]", 26, 0, 2, 24, NULL, },
1164
  { "AR[FCR]", 26, 0, 2, 21, NULL, },
1165
  { "AR[FDR]", 26, 0, 2, 30, NULL, },
1166
  { "AR[FIR]", 26, 0, 2, 29, NULL, },
1167
  { "AR[FPSR].sf0.controls", 30, 0, 2, -1, NULL, },
1168
  { "AR[FPSR].sf1.controls", 30, 0, 2, -1, NULL, },
1169
  { "AR[FPSR].sf2.controls", 30, 0, 2, -1, NULL, },
1170
  { "AR[FPSR].sf3.controls", 30, 0, 2, -1, NULL, },
1171
  { "AR[FPSR].sf0.flags", 30, 0, 2, -1, NULL, },
1172
  { "AR[FPSR].sf1.flags", 30, 0, 2, -1, NULL, },
1173
  { "AR[FPSR].sf2.flags", 30, 0, 2, -1, NULL, },
1174
  { "AR[FPSR].sf3.flags", 30, 0, 2, -1, NULL, },
1175
  { "AR[FPSR].traps", 30, 0, 2, -1, NULL, },
1176
  { "AR[FPSR].rv", 30, 0, 2, -1, NULL, },
1177
  { "AR[FSR]", 26, 0, 2, 28, NULL, },
1178
  { "AR[ITC]", 26, 0, 2, 44, NULL, },
1179
  { "AR[K%], % in 0 - 7", 1, 0, 2, -1, NULL, },
1180
  { "AR[LC]", 26, 0, 2, 65, NULL, },
1181
  { "AR[PFS]", 26, 0, 2, 64, NULL, },
1182
  { "AR[PFS]", 26, 0, 2, 64, NULL, },
1183
  { "AR[PFS]", 26, 0, 0, 64, NULL, },
1184
  { "AR[RNAT]", 26, 0, 2, 19, NULL, },
1185
  { "AR[RSC]", 26, 0, 2, 16, NULL, },
1186
  { "AR[SSD]", 26, 0, 2, 26, NULL, },
1187
  { "AR[UNAT]{%}, % in 0 - 63", 2, 0, 2, -1, NULL, },
1188
  { "AR%, % in 8-15, 20, 22-23, 31, 33-35, 37-39, 41-43, 45-47, 67-111", 3, 0, 0, -1, NULL, },
1189
  { "AR%, % in 48-63, 112-127", 4, 0, 2, -1, NULL, },
1190
  { "BR%, % in 0 - 7", 5, 0, 2, -1, NULL, },
1191
  { "BR%, % in 0 - 7", 5, 0, 0, -1, NULL, },
1192
  { "BR%, % in 0 - 7", 5, 0, 2, -1, NULL, },
1193
  { "CFM", 6, 0, 2, -1, NULL, },
1194
  { "CFM", 6, 0, 2, -1, NULL, },
1195
  { "CFM", 6, 0, 2, -1, NULL, },
1196
  { "CFM", 6, 0, 2, -1, NULL, },
1197
  { "CFM", 6, 0, 0, -1, NULL, },
1198
  { "CPUID#", 7, 0, 5, -1, NULL, },
1199
  { "CR[CMCV]", 27, 0, 3, 74, NULL, },
1200
  { "CR[DCR]", 27, 0, 3, 0, NULL, },
1201
  { "CR[EOI]", 27, 0, 7, 67, "SC Section 5.8.3.4, \"End of External Interrupt Register (EOI Ð CR67)\" on page 2:119", },
1202
  { "CR[GPTA]", 27, 0, 3, 9, NULL, },
1203
  { "CR[IFA]", 27, 0, 1, 20, NULL, },
1204
  { "CR[IFA]", 27, 0, 3, 20, NULL, },
1205
  { "CR[IFS]", 27, 0, 3, 23, NULL, },
1206
  { "CR[IFS]", 27, 0, 1, 23, NULL, },
1207
  { "CR[IFS]", 27, 0, 1, 23, NULL, },
1208
  { "CR[IHA]", 27, 0, 3, 25, NULL, },
1209
  { "CR[IIM]", 27, 0, 3, 24, NULL, },
1210
  { "CR[IIP]", 27, 0, 3, 19, NULL, },
1211
  { "CR[IIP]", 27, 0, 1, 19, NULL, },
1212
  { "CR[IIPA]", 27, 0, 3, 22, NULL, },
1213
  { "CR[IPSR]", 27, 0, 3, 16, NULL, },
1214
  { "CR[IPSR]", 27, 0, 1, 16, NULL, },
1215
  { "CR[IRR%], % in 0 - 3", 8, 0, 3, -1, NULL, },
1216
  { "CR[ISR]", 27, 0, 3, 17, NULL, },
1217
  { "CR[ITIR]", 27, 0, 3, 21, NULL, },
1218
  { "CR[ITIR]", 27, 0, 1, 21, NULL, },
1219
  { "CR[ITM]", 27, 0, 3, 1, NULL, },
1220
  { "CR[ITV]", 27, 0, 3, 72, NULL, },
1221
  { "CR[IVA]", 27, 0, 4, 2, NULL, },
1222
  { "CR[IVR]", 27, 0, 7, 65, "SC Section 5.8.3.2, \"External Interrupt Vector Register (IVR Ð CR65)\" on page 2:118", },
1223
  { "CR[LID]", 27, 0, 7, 64, "SC Section 5.8.3.1, \"Local ID (LID Ð CR64)\" on page 2:117", },
1224
  { "CR[LRR%], % in 0 - 1", 9, 0, 3, -1, NULL, },
1225
  { "CR[PMV]", 27, 0, 3, 73, NULL, },
1226
  { "CR[PTA]", 27, 0, 3, 8, NULL, },
1227
  { "CR[TPR]", 27, 0, 3, 66, NULL, },
1228
  { "CR[TPR]", 27, 0, 7, 66, "SC Section 5.8.3.3, \"Task Priority Register (TPR Ð CR66)\" on page 2:119", },
1229
  { "CR[TPR]", 27, 0, 1, 66, NULL, },
1230
  { "CR%, % in 3-7, 10-15, 18, 26-63, 75-79, 82-127", 10, 0, 0, -1, NULL, },
1231
  { "DBR#", 11, 0, 2, -1, NULL, },
1232
  { "DBR#", 11, 0, 3, -1, NULL, },
1233
  { "DTC", 0, 0, 3, -1, NULL, },
1234
  { "DTC", 0, 0, 2, -1, NULL, },
1235
  { "DTC", 0, 0, 0, -1, NULL, },
1236
  { "DTC", 0, 0, 2, -1, NULL, },
1237
  { "DTC_LIMIT*", 0, 0, 2, -1, NULL, },
1238
  { "DTR", 0, 0, 3, -1, NULL, },
1239
  { "DTR", 0, 0, 2, -1, NULL, },
1240
  { "DTR", 0, 0, 3, -1, NULL, },
1241
  { "DTR", 0, 0, 0, -1, NULL, },
1242
  { "DTR", 0, 0, 2, -1, NULL, },
1243
  { "FR%, % in 0 - 1", 12, 0, 0, -1, NULL, },
1244
  { "FR%, % in 2 - 127", 13, 0, 2, -1, NULL, },
1245
  { "FR%, % in 2 - 127", 13, 0, 0, -1, NULL, },
1246
  { "GR0", 14, 0, 0, -1, NULL, },
1247
  { "GR%, % in 1 - 127", 15, 0, 0, -1, NULL, },
1248
  { "GR%, % in 1 - 127", 15, 0, 2, -1, NULL, },
1249
  { "IBR#", 16, 0, 2, -1, NULL, },
1250
  { "InService*", 17, 0, 3, -1, NULL, },
1251
  { "InService*", 17, 0, 2, -1, NULL, },
1252
  { "InService*", 17, 0, 2, -1, NULL, },
1253
  { "IP", 0, 0, 0, -1, NULL, },
1254
  { "ITC", 0, 0, 4, -1, NULL, },
1255
  { "ITC", 0, 0, 2, -1, NULL, },
1256
  { "ITC", 0, 0, 0, -1, NULL, },
1257
  { "ITC", 0, 0, 4, -1, NULL, },
1258
  { "ITC", 0, 0, 2, -1, NULL, },
1259
  { "ITC_LIMIT*", 0, 0, 2, -1, NULL, },
1260
  { "ITR", 0, 0, 2, -1, NULL, },
1261
  { "ITR", 0, 0, 4, -1, NULL, },
1262
  { "ITR", 0, 0, 2, -1, NULL, },
1263
  { "ITR", 0, 0, 0, -1, NULL, },
1264
  { "ITR", 0, 0, 4, -1, NULL, },
1265
  { "memory", 0, 0, 0, -1, NULL, },
1266
  { "MSR#", 18, 0, 5, -1, NULL, },
1267
  { "PKR#", 19, 0, 3, -1, NULL, },
1268
  { "PKR#", 19, 0, 0, -1, NULL, },
1269
  { "PKR#", 19, 0, 2, -1, NULL, },
1270
  { "PKR#", 19, 0, 2, -1, NULL, },
1271
  { "PMC#", 20, 0, 2, -1, NULL, },
1272
  { "PMC#", 20, 0, 7, -1, "SC Section 7.2.1, \"Generic Performance Counter Registers\" for PMC[0].fr on page 2:150", },
1273
  { "PMD#", 21, 0, 2, -1, NULL, },
1274
  { "PR0", 0, 0, 0, -1, NULL, },
1275
  { "PR%, % in 1 - 15", 22, 0, 2, -1, NULL, },
1276
  { "PR%, % in 1 - 15", 22, 0, 2, -1, NULL, },
1277
  { "PR%, % in 1 - 15", 22, 0, 0, -1, NULL, },
1278
  { "PR%, % in 16 - 62", 23, 0, 2, -1, NULL, },
1279
  { "PR%, % in 16 - 62", 23, 0, 2, -1, NULL, },
1280
  { "PR%, % in 16 - 62", 23, 0, 0, -1, NULL, },
1281
  { "PR63", 24, 0, 2, -1, NULL, },
1282
  { "PR63", 24, 0, 2, -1, NULL, },
1283
  { "PR63", 24, 0, 0, -1, NULL, },
1284
  { "PSR.ac", 28, 0, 1, 3, NULL, },
1285
  { "PSR.ac", 28, 0, 3, 3, NULL, },
1286
  { "PSR.ac", 28, 0, 2, 3, NULL, },
1287
  { "PSR.ac", 28, 0, 2, 3, NULL, },
1288
  { "PSR.be", 28, 0, 1, 1, NULL, },
1289
  { "PSR.be", 28, 0, 3, 1, NULL, },
1290
  { "PSR.be", 28, 0, 2, 1, NULL, },
1291
  { "PSR.be", 28, 0, 2, 1, NULL, },
1292
  { "PSR.bn", 28, 0, 2, 44, NULL, },
1293
  { "PSR.cpl", 28, 0, 1, 32, NULL, },
1294
  { "PSR.cpl", 28, 0, 2, 32, NULL, },
1295
  { "PSR.da", 28, 0, 2, 38, NULL, },
1296
  { "PSR.db", 28, 0, 3, 24, NULL, },
1297
  { "PSR.db", 28, 0, 2, 24, NULL, },
1298
  { "PSR.db", 28, 0, 2, 24, NULL, },
1299
  { "PSR.dd", 28, 0, 2, 39, NULL, },
1300
  { "PSR.dfh", 28, 0, 3, 19, NULL, },
1301
  { "PSR.dfh", 28, 0, 2, 19, NULL, },
1302
  { "PSR.dfh", 28, 0, 2, 19, NULL, },
1303
  { "PSR.dfl", 28, 0, 3, 18, NULL, },
1304
  { "PSR.dfl", 28, 0, 2, 18, NULL, },
1305
  { "PSR.dfl", 28, 0, 2, 18, NULL, },
1306
  { "PSR.di", 28, 0, 3, 22, NULL, },
1307
  { "PSR.di", 28, 0, 2, 22, NULL, },
1308
  { "PSR.di", 28, 0, 2, 22, NULL, },
1309
  { "PSR.dt", 28, 0, 3, 17, NULL, },
1310
  { "PSR.dt", 28, 0, 2, 17, NULL, },
1311
  { "PSR.dt", 28, 0, 2, 17, NULL, },
1312
  { "PSR.ed", 28, 0, 2, 43, NULL, },
1313
  { "PSR.i", 28, 0, 2, 14, NULL, },
1314
  { "PSR.ia", 28, 0, 0, 14, NULL, },
1315
  { "PSR.ic", 28, 0, 2, 13, NULL, },
1316
  { "PSR.ic", 28, 0, 3, 13, NULL, },
1317
  { "PSR.ic", 28, 0, 2, 13, NULL, },
1318
  { "PSR.id", 28, 0, 0, 14, NULL, },
1319
  { "PSR.is", 28, 0, 0, 14, NULL, },
1320
  { "PSR.it", 28, 0, 2, 14, NULL, },
1321
  { "PSR.lp", 28, 0, 2, 25, NULL, },
1322
  { "PSR.lp", 28, 0, 3, 25, NULL, },
1323
  { "PSR.lp", 28, 0, 2, 25, NULL, },
1324
  { "PSR.mc", 28, 0, 2, 35, NULL, },
1325
  { "PSR.mfh", 28, 0, 2, 5, NULL, },
1326
  { "PSR.mfl", 28, 0, 2, 4, NULL, },
1327
  { "PSR.pk", 28, 0, 3, 15, NULL, },
1328
  { "PSR.pk", 28, 0, 2, 15, NULL, },
1329
  { "PSR.pk", 28, 0, 2, 15, NULL, },
1330
  { "PSR.pp", 28, 0, 2, 21, NULL, },
1331
  { "PSR.ri", 28, 0, 0, 41, NULL, },
1332
  { "PSR.rt", 28, 0, 2, 27, NULL, },
1333
  { "PSR.rt", 28, 0, 3, 27, NULL, },
1334
  { "PSR.rt", 28, 0, 2, 27, NULL, },
1335
  { "PSR.si", 28, 0, 2, 23, NULL, },
1336
  { "PSR.si", 28, 0, 3, 23, NULL, },
1337
  { "PSR.si", 28, 0, 2, 23, NULL, },
1338
  { "PSR.sp", 28, 0, 2, 20, NULL, },
1339
  { "PSR.sp", 28, 0, 3, 20, NULL, },
1340
  { "PSR.sp", 28, 0, 2, 20, NULL, },
1341
  { "PSR.ss", 28, 0, 2, 40, NULL, },
1342
  { "PSR.tb", 28, 0, 3, 26, NULL, },
1343
  { "PSR.tb", 28, 0, 2, 26, NULL, },
1344
  { "PSR.tb", 28, 0, 2, 26, NULL, },
1345
  { "PSR.up", 28, 0, 2, 2, NULL, },
1346
  { "PSR.vm", 28, 0, 1, 46, NULL, },
1347
  { "PSR.vm", 28, 0, 2, 46, NULL, },
1348
  { "RR#", 25, 0, 3, -1, NULL, },
1349
  { "RR#", 25, 0, 2, -1, NULL, },
1350
  { "RSE", 29, 0, 2, -1, NULL, },
1351
  { "ALAT", 0, 1, 0, -1, NULL, },
1352
  { "AR[BSP]", 26, 1, 2, 17, NULL, },
1353
  { "AR[BSPSTORE]", 26, 1, 2, 18, NULL, },
1354
  { "AR[CCV]", 26, 1, 2, 32, NULL, },
1355
  { "AR[CFLG]", 26, 1, 2, 27, NULL, },
1356
  { "AR[CSD]", 26, 1, 2, 25, NULL, },
1357
  { "AR[EC]", 26, 1, 2, 66, NULL, },
1358
  { "AR[EFLAG]", 26, 1, 2, 24, NULL, },
1359
  { "AR[FCR]", 26, 1, 2, 21, NULL, },
1360
  { "AR[FDR]", 26, 1, 2, 30, NULL, },
1361
  { "AR[FIR]", 26, 1, 2, 29, NULL, },
1362
  { "AR[FPSR].sf0.controls", 30, 1, 2, -1, NULL, },
1363
  { "AR[FPSR].sf1.controls", 30, 1, 2, -1, NULL, },
1364
  { "AR[FPSR].sf2.controls", 30, 1, 2, -1, NULL, },
1365
  { "AR[FPSR].sf3.controls", 30, 1, 2, -1, NULL, },
1366
  { "AR[FPSR].sf0.flags", 30, 1, 0, -1, NULL, },
1367
  { "AR[FPSR].sf0.flags", 30, 1, 2, -1, NULL, },
1368
  { "AR[FPSR].sf0.flags", 30, 1, 2, -1, NULL, },
1369
  { "AR[FPSR].sf1.flags", 30, 1, 0, -1, NULL, },
1370
  { "AR[FPSR].sf1.flags", 30, 1, 2, -1, NULL, },
1371
  { "AR[FPSR].sf1.flags", 30, 1, 2, -1, NULL, },
1372
  { "AR[FPSR].sf2.flags", 30, 1, 0, -1, NULL, },
1373
  { "AR[FPSR].sf2.flags", 30, 1, 2, -1, NULL, },
1374
  { "AR[FPSR].sf2.flags", 30, 1, 2, -1, NULL, },
1375
  { "AR[FPSR].sf3.flags", 30, 1, 0, -1, NULL, },
1376
  { "AR[FPSR].sf3.flags", 30, 1, 2, -1, NULL, },
1377
  { "AR[FPSR].sf3.flags", 30, 1, 2, -1, NULL, },
1378
  { "AR[FPSR].rv", 30, 1, 2, -1, NULL, },
1379
  { "AR[FPSR].traps", 30, 1, 2, -1, NULL, },
1380
  { "AR[FSR]", 26, 1, 2, 28, NULL, },
1381
  { "AR[ITC]", 26, 1, 2, 44, NULL, },
1382
  { "AR[K%], % in 0 - 7", 1, 1, 2, -1, NULL, },
1383
  { "AR[LC]", 26, 1, 2, 65, NULL, },
1384
  { "AR[PFS]", 26, 1, 0, 64, NULL, },
1385
  { "AR[PFS]", 26, 1, 2, 64, NULL, },
1386
  { "AR[PFS]", 26, 1, 2, 64, NULL, },
1387
  { "AR[RNAT]", 26, 1, 2, 19, NULL, },
1388
  { "AR[RSC]", 26, 1, 2, 16, NULL, },
1389
  { "AR[SSD]", 26, 1, 2, 26, NULL, },
1390
  { "AR[UNAT]{%}, % in 0 - 63", 2, 1, 2, -1, NULL, },
1391
  { "AR%, % in 8-15, 20, 22-23, 31, 33-35, 37-39, 41-43, 45-47, 67-111", 3, 1, 0, -1, NULL, },
1392
  { "AR%, % in 48 - 63, 112-127", 4, 1, 2, -1, NULL, },
1393
  { "BR%, % in 0 - 7", 5, 1, 2, -1, NULL, },
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff